When I call for self.refreshControl.endRefreshing()
it snaps the tableView back to it original spot like it should. How should I go about animating it so that it fluently returns to its original spot on endRefreshing()
?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
To anyone having this issue, you must call your
endRefreshing
method before you reload the table data. Otherwise when the table updates it will override the refresher and cause it to look buggy.In Swift 3 iOS 10, I got a similar approach as ibrahimyilmaz and here it is:
At first I was dispatching the endRefreshing as proposed in many threads but in fact it's the other way around that works for me.
Additional info: This code is executed in the location:didChange: delegate, not in viewDidLoad or viewWillAppear. Going through other threads, It seems that there is an issue in the Apple SDK when you try to endRefreshing AND try to show a popup at the same time.
I was having this issue and tried every suggestion above (and others from similar threads).
What the problem turned out to be in my case was... I hadn't enabled refreshing in interface builder. I only added the code to create a refresh control and listen for the value changed event. It worked, but was "jumpy" as others have described.
Enabling it in interface builder fixed my problem. If you've tried everything else, check your storyboard!
Try this
I've run into this issue as well. For
endRefreshing()
The documentation states:I wrap the call in a UIView animation block and the transition becomes smooth:
This works for me with Swift 2