Go to file
Alex 217c630b3c Initial commit 2018-08-28 21:28:35 +02:00
Configs Initial commit 2018-08-28 21:28:35 +02:00
Example Initial commit 2018-08-28 21:28:35 +02:00
ParticlePullToRefresh.xcodeproj Initial commit 2018-08-28 21:28:35 +02:00
Sources Initial commit 2018-08-28 21:28:35 +02:00
Tests Initial commit 2018-08-28 21:28:35 +02:00
.gitignore Initial commit 2018-08-28 21:28:35 +02:00
LICENSE Initial commit 2018-08-28 21:28:35 +02:00
Package.swift Initial commit 2018-08-28 21:28:35 +02:00
ParticlePullToRefresh.podspec Initial commit 2018-08-28 21:28:35 +02:00
README.md Initial commit 2018-08-28 21:28:35 +02:00
example.gif Initial commit 2018-08-28 21:28:35 +02:00

README.md

ParticlePullToRefresh

Example

Example

To run the example project clone the repo and run Example target

Requirements

  • Xcode 9
  • Swift 4.1
  • iOS 11

Installation

ParticlePullToRefresh doesn't contain any external dependencies

CocoaPods

pod 'ParticlePullToRefresh'

Usage

Add pull-to-refresh to the scroll view subclass and provide an action closure. Call endRefreshing() when you are done to finish the animation

tableView.addParticlePullToRefresh { [weak self] in
  DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
    self?.tableView.particlePullToRefresh?.endRefreshing()
  }
}

Remove pull-to-refresh on deinit

deinit {
  tableView.removeParticlePullToRefresh()
}

Customization

You can optionally pass the color when you add pull-to-refresh to the scroll view subclass

tableView.addParticlePullToRefresh(color: .yellow) { [weak self] in
  DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
    self?.tableView.particlePullToRefresh?.endRefreshing()
  }
}

Author

Alex Demchenko, alex.demchenko@10clouds.com

License

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