ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - dekatotoro/PullToRefreshSwift: iOS Simple Cool PullToRefresh Library. It is written in pure swift.
iOS Simple Cool PullToRefresh Library. It is written in pure swift. - dekatotoro/PullToRefreshSwift
Visit Site

GitHub - dekatotoro/PullToRefreshSwift: iOS Simple Cool PullToRefresh Library. It is written in pure swift.

GitHub - dekatotoro/PullToRefreshSwift: iOS Simple Cool PullToRefresh Library. It is written in pure swift.

PullToRefreshSwift

Platform Language License Issues

iOS Simple PullToRefresh Library.

sample

##Installation

####CocoaPods

pod 'PullToRefreshSwift'

####Manually Add the following files to your project. pulltorefresharrow.png PullToRefreshView.swift PullToRefreshConst.swift UIScrollViewExtension.swift

##Usage

###Setup

In your UIViewController Including UITableView, UICollectionView, UIScrollView:

  override func viewDidLoad() {
        self.tableView.addPullToRefresh({ [weak self] in
            // refresh code
            
            self?.tableView.reloadData()
            self?.tableView.stopPullToRefresh()
        })
  }

You can use PullToRefreshOption class at addPullToRefresh func option parameter:

  override func viewDidLoad() {
       let options = PullToRefreshOption()
        options.backgroundColor = UIColor.blueColor()
        options.indicatorColor = UIColor.whiteColor()
        
        self.tableView.addPullToRefresh(options: options, { [weak self] in
            // some code
            
            self?.tableView.reloadData()
            self?.tableView.stopPullToRefresh()
        })
        
  }

If you want to fixed pulltoRefreshView, please implement scrollViewDidScroll.

  func scrollViewDidScroll(scrollView: UIScrollView) {
    self.tableView.fixedPullToRefreshViewForDidScroll()
  }  

If you want to use the custom const, please change the PullToRefreshConst class.

struct PullToRefreshConst {
    static let tag = 810
    static let alpha = true
    static let height: CGFloat = 80
    static let imageName: String = "pulltorefresharrow.png"
    static let animationDuration: Double = 0.4
    static let fixedTop = true // PullToRefreshView fixed Top
}

If you want to use the custom option, please change the PullToRefreshOption class. You can use this class at addPullToRefresh func option parameter.

class PullToRefreshOption {
    var backgroundColor = UIColor.clearColor()
    var indicatorColor = UIColor.grayColor()
    var autoStopTime: Double = 0.7 // 0 is not auto stop
    var fixedSectionHeader = false  // Update the content inset for fixed section headers
}

Requirements

Requires Swift3.0 and iOS 8.0 and ARC.
If you are developing in the Swift1.1 ~ 2.3, please use branch of Swift1.1 ~ Swift2.3.

Features

  • Highly customizable
  • Complete example
  • Refactoring

Contributing

Forks, patches and other feedback are welcome.

Creator

Yuji Hato Blog

License

PullToRefreshSwift is available under the MIT license. See the LICENSE file for more info.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory