项目
在 GitHub 查看
takuoka/PullToBounce
关于
适用于 UIScrollView 的动画“下拉刷新”库。灵感来自 https://dribbble.com/shots/1797373-Pull-Down-To-Refresh
开发工具实测星标增长
- 24小时
- 0
- 7天
- -1
- 15天
- -1
- 1个月
- -3
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文PullToBounce
Animated "Pull To Refresh" Library for UIScrollView.
You can add animated "pull to refresh" action to your UIScrollView, UITableView and UICollectionView.
Inspired by https://dribbble.com/shots/1797373-Pull-Down-To-Refresh
ScreenShot

You can play demo at appetize.io.
Installation
You can install this to your project via CocoaPods.
pod 'PullToBounce'
Usage
Please Wrap your scroll view
// Please wrap your scroll view
tableView.frame = yourFrame
let tableViewWrapper = PullToBounceWrapper(scrollView: tableView)
// Please add wrapper view to your view instead of your scroll view.
bodyView.addSubview(tableViewWrapper)
The frame of wrapper will be same as your scrollView.
And the color will be same as your scrollView's background color.
Event Handler
tableViewWrapper.didPullToRefresh = {
didFinishYourLoading() {
tableViewWrapper.stopLoadingAnimation()
}
}
Custom Animation
Default arguments of "init" of PullToBounceWrapper
init(
scrollView: UIScrollView, // this is the only required argument
bounceDuration: CFTimeInterval = 0.8,
ballSize:CGFloat = 36,
ballMoveTimingFunc: CAMediaTimingFunction = CAMediaTimingFunction(controlPoints:0.49,0.13,0.29,1.61),
moveUpDuration: CFTimeInterval = 0.25,
pullDistance: CGFloat = 96,
bendDistance: CGFloat = 40,
didPullToRefresh: (()->())? = nil
)
You can use these arguments to customize animation.
探索相关项目
加载中…