Yet another custom pull to refresh for your needs.
Inspire by this dribble and Google Chrome iOS app
For the example of usage see viewController.swift file in demo project
/*
* To initialize ADChromePullToRefresh use this designated initializer
* @param view - view to overlay by pull to refresh
* @param scrollView - for which scrollView we add pull to refresh
* @param scrollViewOriginalOffsetY - initial offset y of the given scrollView
* @param delegate - object conformed to ADChromePullToRefreshDelegate protocol
*/
init(view: UIView, forScrollView scrollView: UIScrollView, scrollViewOriginalOffsetY: CGFloat, delegate: ADChromePullToRefreshDelegate)
You must implement two delegate functions
/*
* Use this function to provide an action for the given action view type
*/
func chromePullToRefresh(pullToRefresh: ADChromePullToRefresh, actionForViewWithType: ADChromePullToRefreshActionViewType) -> ADChromePullToRefreshAction?
/*
* Use this function to create view with icon for the given pullToRefresh. To customize view use subclass of
* ADChromePullToRefreshActionView
* @see ADChromePullToRefreshActionView.swift
* @see UITableViewDelegate - similar method to get header and footer view
*/
func chromePullToRefresh(pullToRefresh: ADChromePullToRefresh, viewWithType: ADChromePullToRefreshActionViewType) -> ADChromePullToRefreshActionView
Add pod 'ADChromePullToRefresh'
to your Podfile.