All Projects → jcavar → Refresher

jcavar / Refresher

Licence: mit
DEPRECATED: Pull to refresh in Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Refresher

Xcode Complete Guide
Productivity guide for Xcode.
Stars: ✭ 19 (-97.85%)
Mutual labels:  xcode
Fapanels
FAPanels - Swift
Stars: ✭ 850 (-3.95%)
Mutual labels:  xcode
Jazzy
Both Swift and Objective-C projects are supported.
Stars: ✭ 7,078 (+699.77%)
Mutual labels:  xcode
Qmui ios codesnippets
用于Xcode使用的iOS通用代码片段,其中也包含若干专用于QMUI iOS框架的代码片段。
Stars: ✭ 922 (+4.18%)
Mutual labels:  xcode
Crrefresh
An easy way to use pull-to-refresh
Stars: ✭ 832 (-5.99%)
Mutual labels:  pull-to-refresh
Agalertviewwithprogressbar
Stars: ✭ 9 (-98.98%)
Mutual labels:  xcode
Swiftui Animation Library
SwiftUI Animation Library. Useful SwiftUI animations including Loading/progress, Looping, On-off, Enter, Exit, Fade, Spin and Background animations that you can directly implement in your next iOS application or project. The library also contains huge examples of spring animations such as Inertial Bounce, Shake, Twirl, Jelly, Jiggle, Rubber Band, Kitchen Sink and Wobble effects. Browse, find and download the animation that fits your needs.
Stars: ✭ 898 (+1.47%)
Mutual labels:  xcode
Xcode Starter Pack
My personal default xcconfig files and whatnot for a new project
Stars: ✭ 15 (-98.31%)
Mutual labels:  xcode
Xcodeeditor
An API for manipulating Xcode project files.
Stars: ✭ 851 (-3.84%)
Mutual labels:  xcode
Streetmusicmap
StreetMusicMap is a collab line up of street music performers from all over the world.
Stars: ✭ 13 (-98.53%)
Mutual labels:  xcode
Apprepositorytemplate
The easiest way to start a new application project without any manual configuration
Stars: ✭ 24 (-97.29%)
Mutual labels:  xcode
Pullrefresh
前端, 下拉刷新
Stars: ✭ 7 (-99.21%)
Mutual labels:  pull-to-refresh
Drl Theme Manager
Xcode File Template to generate theme manager for Swift 3+
Stars: ✭ 12 (-98.64%)
Mutual labels:  xcode
Swipeabletabbarcontroller
UITabBarController with swipe interaction between its tabs.
Stars: ✭ 919 (+3.84%)
Mutual labels:  xcode
Xcbt
⌛️xcbt shows Xcode build time of a specified project.
Stars: ✭ 14 (-98.42%)
Mutual labels:  xcode
Exhibit
Exhibit is a managed screensaver App for tvOS.
Stars: ✭ 19 (-97.85%)
Mutual labels:  xcode
U17
精仿有妖气漫画(Swift5)
Stars: ✭ 853 (-3.62%)
Mutual labels:  xcode
Awesome Swiftui
A collaborative list of awesome articles, talks, books, videos and code examples about SwiftUI.
Stars: ✭ 878 (-0.79%)
Mutual labels:  xcode
Swiftinfo
📊 Extract and analyze the evolution of an iOS app's code.
Stars: ✭ 880 (-0.56%)
Mutual labels:  xcode
Swiftui Grid
🚀 SwiftUI Grid layout with custom styles
Stars: ✭ 872 (-1.47%)
Mutual labels:  xcode

DEPRECATED

This library is no longer maintained. I am not using it in any of my projects, and I, unfortunately, don't have time to maintain it in my free time. Please open an issue if you are willing to become the new maintainer.

Build Status

Refresher is pull to refresh library written in Swift. It provides easy to use UIScrollView methods to add pull to refresh to your view. Refresher also supports custom animations.

Usage

Basic usage

tableView.addPullToRefreshWithAction {
	NSOperationQueue().addOperationWithBlock {
    	sleep(2)
        NSOperationQueue.mainQueue().addOperationWithBlock {
        	self.tableView.stopPullToRefresh()
        }
    }
}

Custom animations

Refresher supports custom animations on PullToRefreshView. You need to create object that conforms to PullToRefreshViewAnimator protocol. Then, just pass your custom animator in addPullToRefrshWithAction:

tableView.addPullToRefreshWithAction({           
  	NSOperationQueue().addOperationWithBlock {
   		sleep(2)
        NSOperationQueue.mainQueue().addOperationWithBlock {
        	self.tableView.stopPullToRefresh()
        }
    }
}, withAnimator: CustomAnimator())

Required methods that your custom object need to implement are:

  • func pullToRefreshAnimationDidStart(view: PullToRefreshView)- Called when user releases finger and when loading actually starts. Start your animations here.
  • func pullToRefreshAnimationDidEnd(view: PullToRefreshView) - Called when animation is over. Perform any necessary after animation cleanup here.
  • func pullToRefresh(view: PullToRefreshView, progressDidChange progress: CGFloat) - Called while user is pulling scroll view. Useful if you want to implement some kind of progress like behaviour.
  • func pullToRefresh(view: PullToRefreshView, stateDidChange state: PullToRefreshViewState) - Called when PullToRefreshView changes its state

Custom views

You can use your own custom UIView subclass as pull to refresh view.

if let customSubview = NSBundle.mainBundle().loadNibNamed("CustomSubview", owner: self, options: nil).first as? CustomSubview {
	tableView.addPullToRefreshWithAction({
		NSOperationQueue().addOperationWithBlock {
			sleep(2)
			NSOperationQueue.mainQueue().addOperationWithBlock {
				self.tableView.stopPullToRefresh()
			}
		}
	}, withAnimator: customSubview)
}

Your custom subclass has to conform to PullToRefreshViewDelegate.

Requirements

  • Xcode 6
  • iOS 8.0

Installation

Git submodule

  1. Add Refresher as a git submodule into your top-level project directory or simply copy whole folder
  2. Find PullToRefresh.xcodeproj and drag it into the file navigator of your app project.
  3. In Xcode, navigate to the target configuration window by clicking on the blue project icon, and selecting the application target under the "Targets" heading in the sidebar.
  4. Under "General" panel go to "Linked Frameworks and Libraries" and add Refresher.framework

Framework

  1. Simply download Refresher
  2. Build it and you should find Refresher.framework under "Products" group.
  3. Right click on it and select "Show in Finder" option.
  4. Just drag and drop Refresher.framework to your project

Cocoapods

  1. Add pod 'Refresher' to your Podfile
  2. Run pod install

Examples

Refresher: preview default Refresher: preview beat Refresher: preview pacman

Credits

Refresher is created by Josip Ćavar and inspired by SVPullToRefresh. If you have suggestions or bug reports, feel free to send pull request or create new issue.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].