New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table View scrolling stops when datasource is updated #19
Comments
Tried a couple things self.datasource = tempDatasource
self.tableView.reloadData() self.tableView.beginUpdates()
tempDatasource.addObject(posts[0] as Post)
self.datasource = tempDatasource
self.tableView.insertRowsAtIndexPaths([NSIndexPath(forRow: self.datasource.count-1, inSection: 0)], withRowAnimation: UITableViewRowAnimation.Fade)
self.tableView.endUpdates() tried wrapping in GCD dispatch_async(dispatch_get_main_queue(), {
} All to no avail :/ I am curious if the issue is that it is a UITableViewDelegate subclass and self.datasource is an NSArray instead of setting it to an NSMutableArray that can be updated and calling reloadData() |
I know exactly what it is. This is the cache write which is not multi threaded. I tried to dispatch it but for some reason I'm getting an unknown error with Swift. I'll wait for beta 5. This call should be put on a background queue. Well, it's also the model HTML scrapping, I'll dispatch all that in a later version. No more scroll stop :) |
Ya, that is definitely a strange error while trying the following there public override func setObject(object: AnyObject, key: String) {
dispatch_async(dispatch_get_global_queue(self.priority, UInt(0)), {
NSKeyedArchiver.archiveRootObject(object, toFile: self.fullPath(key))
})
} |
I have made is successfully compile and work with tests in Dimillian/HackerSwifter#12 It doesn't seem to fix the scroll stop, I will keep looking into it. |
Is this bug still there or its been fixed?? |
In NewsViewController.swift function loadMore()
https://github.com/Dimillian/SwiftHN/blob/master/SwiftHN/ViewControllers/NewsViewController.swift#L72
The text was updated successfully, but these errors were encountered: