-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[ASDKgram Example] fix crash on startup #566
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Hannah ❤️
Actually, hold off on merging this. I'm missing a file. |
ready to merge |
Generated by 🚫 Danger |
@@ -59,7 +59,7 @@ - (void)refreshFeed | |||
|
|||
[_activityIndicatorView stopAnimating]; | |||
|
|||
[self insertNewRows:newPhotos]; | |||
[self.tableView reloadData]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would personally shy away from calling reloadData
in a sample project, as we've been asking people to avoid using it and call insert/delete/move instead. Maybe it's time to employ a diffing algorithm (either built-in or from 3rd-party) to show how it's supposed to be done? A bit overkill I know, as the data almost certainly has new rows only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nguyenhuy Yes, I agree. A couple thoughts though:
-
We do have the IGListKit version of ASDKgram in place; we could consider making it the only implementation, although I'm not sure how easy it is for a new developer to get set up using it with ASCollectionNode, because we don't have docs about it.
-
This fix addresses a pretty serious crash that has been in place for a while. I asked Hannah offline and she is planning to make other changes to ensure only edit operations are used, but the network / loading code needs a small overhaul to be able to do it.
Fortunately the reloadData only occurs during a full reload (e.g. pull to refresh or first load), so it doesn't affect the loading of new batches / pages while scrolling down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👌
* fix crash on ASDKgram startup * quicker fix
No description provided.