-
Notifications
You must be signed in to change notification settings - Fork 485
Memory management guidelines #216
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
Comments
Yeah, doing that is fine. #186 adds some more control over the FUIArray's activity, so you can suspend their observers on |
Wow, #186 looks really valuable. Do you think it will get merged in the next week or two? Today I'm working on dealing with drag/drop handling and the overrideable behaviors in the new FUICollection would be handy there. I'd rather submit a PR to enhance the docs for the "good stuff" if it'll be in soon. ;) I'd love your feedback on timeline, but let's close this ticket so it's not clogging up the pipes in the meantime. |
I personally would like to merge it ASAP, but it's pending some discussion about how loose we'd like to be about cross-platform feature parity across the FirebaseUI libraries and I haven't had those conversations yet. |
@crrobinson14 What drag/drop features are you handling? Is this related to #218 ? |
@ugiacoman Nothing I'm doing is related to #218 or #186 that I KNOW of. It's just that right now today I'm implementing drag/drop reorder handling in my app where the tableview is wired via FirebaseUI. It's not clear to me from the docs what the "best" way to handle this is. FUITableDataSource doesn't interfere with the UITableViewDelegate so currently I'm planning to implement I only mentioned this above because the new FUICollection in #186 is more sophisticated. All of this stuff is very fresh in my head from the "implementor's" perspective and I was going to submit a PR to enhance the README.md with more details and examples of how to do the things I'm dealing with right now. The sample project is fairly basic, and there's not a lot of other documentation / examples floating around the Internet. I figured my recent experience would help jump-start some others. |
@crrobinson14 Haha you moved to Firebase after leaving Realm too? I have a feeling you're going to run into the same issue as we're facing. We implemented the collectionView equivalent |
You weren't specific about what issue you were facing. The way we implemented this in Realm we had items in a table sorted by a weight value, basically just an int ascending-sort key 0..N. In In Realm we still had some visual glitches with this method so after much analysis and StackOverflow prodding we ended up using a static array. When the server notified us there was a dataset update, we'd make a local mutable array copy. Then in the
|
n.b. the ordering question is off-topic from the title and we should probably either change the ticket or move the conversation elsewhere to avoid confusion. |
The docs for
FUITableDataSource
aren't very clear about memory management. The docs for Firebase itself ARE, and there's even a best-practices blog post on it here:https://firebase.googleblog.com/2015/10/best-practices-for-ios-uiviewcontroller_6.html
FUIArray
has a dealloc handler that removes its listeners but it's not clear what the best UIViewController pattern is for making sure this gets fired. What I've settled on is creating thedataSource
reference inviewWillAppear
and setting it to nil inviewDidDisappear
. If this is appropriate I'm happy to submit a PR to enhance theREADME.md
to talk about memory management, but wanted to confirm first that this was correct.The text was updated successfully, but these errors were encountered: