Open finder39 opened 10 years ago
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 https://github.com/Dimillian/HackerSwifter/pull/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