takuoka / pulltobounce Goto Github PK
View Code? Open in Web Editor NEWAnimated "Pull To Refresh" Library for UIScrollView. Inspired by https://dribbble.com/shots/1797373-Pull-Down-To-Refresh
License: MIT License
Animated "Pull To Refresh" Library for UIScrollView. Inspired by https://dribbble.com/shots/1797373-Pull-Down-To-Refresh
License: MIT License
As the issue title says, I am trying to use it with a scrollView made via the storyboard. Do you guys know how to implement it, and use it ?
Regards,
Hary.
Can't seem to access any of the methods in objective c?
it'd be cool to have a swift 3 version, if you have any interest to create a branch i would like to help with that.
I have tried to get this working in my project in Swift 4 but when i add the control, my scrollview content doesn't load and it just loads with a white view in the scrollview.
MY view hierarchy is as follows:
UIViewController -> View -> ScrollView -> 3x UIViews & 3x UICollectionViews
The scrollview is implemented via the storyboard with the layout constraints that is is aligned top, leading, trailing, bottom to the main view controller view.
I want to add the pull to refresh to my scrollview
I have done the following code, and tried variations but it doesn't work:
// Please wrap your scroll view
scrollView.frame = self.view.frame
let tableViewWrapper = PullToBounceWrapper(scrollView: scrollView)
// Please add wrapper view to your view instead of your scroll view.
self.view.addSubview(tableViewWrapper)
I've also tried creating a new UIview bodyview per your tutorial:
let bodyView = UIView()
bodyView.frame = scrollView.frame
let tableViewWrapper = PullToBounceWrapper(scrollView: scrollView)
bodyView.add(tableViewWrapper)
self.view.addSubview(bodyView)
I'm either missing something very simple, or something isn't working and would appreciate some guidance if you're able to!
App is not working in the xcode 9.2 with the minimum deployment 9.0
How should I wrap UITableView if I'm using UITableViewController?
Certain things not available when downloading straight from github and can not find replacement
Tried to apply this to a UITableViewController. Here are the codes:
override func viewDidLoad() {
super.viewDidLoad()
let bodyView = UIView()
bodyView.frame = self.view.frame
bodyView.frame.y += 20 + 44
self.view.addSubview(bodyView)
// pull to refresh usage
let tableViewWrapper = PullToBounceWrapper(scrollView: tableView)
bodyView.addSubview(tableViewWrapper)
tableViewWrapper.didPullToRefresh = {
NSTimer.schedule(delay: 2) { timer in
tableViewWrapper.stopLoadingAnimation()
}
}
// createHeader()
}
Terminating app due to uncaught exception 'CALayerInvalid', reason: 'layer <CALayer: 0x7fd501f5dc60> is a part of cycle in its layer tree'. Anyone else have this issue?
Pull to Refresh is really awesome. Add some guidelines to use your controls in Objective-C Project
when i used snp layout llike
`
func createTableview() -> Void {
let changeCityTableView = ChangeCityTableView()
self.view.addSubview(changeCityTableView)
changeCityTableView.snp.makeConstraints { (make) in
make.edges.equalToSuperview()
}
let tableViewWrapper = PullToBounceWrapper(scrollView: changeCityTableView)
self.view.addSubview(tableViewWrapper)
tableViewWrapper.didPullToRefresh = {
Timer.schedule(delay: 2) { timer in
tableViewWrapper.stopLoadingAnimation()
}
}
}
`
a crash open
assert(false, "Wow, scrollView.frame is CGRectZero. Please set frame size.")
Can you please provide a objective c version of your code snippet?
There is my code :
let ballSize = self.view.bounds.size.width / 12
_pullToBounce = PullToBounceWrapper(scrollView: _collectionView,
bounceDuration: 0.8, /
ballSize: ballSize,
ballMoveTimingFunc: CAMediaTimingFunction(controlPoints:0.49,0.13,0.29,1.61),
moveUpDuration: 0.25,
pullDistance: ballSize * 2,
bendDistance: ballSize * 1.8,
didPullToRefresh: {
// test
NSTimer.schedule(delay: 6) {
[unowned self] timer in
self._pullToBounce?.stopLoadingAnimation()
}
})
The ballSize
is related to Screen bound,
when i set bendDistance
as benDistance * 1.8
, the code works well on iPhone 6s but crashes on iPhone 5s, and then i set bendDistance
as benDistance * 1.9
it crashes on iPhone 6s but works well on iPhone 5s.
What is the connection between Screen size
and bendDistance
on different devices?
I saw that you updated the repo to swift 3 however cocoa pods still has the swift 2 version. Could you please update the cocoa pod?
It seems that swift 2 does not accept the '#' syntax for the function arguments.
This can cause compiling error.
I want to know if there is a way to start the loading animation programmatically
Can't install with Carthage
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.