Skip to content

CollectionView Reordering Cells, Updating with Old Cell #218

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

Closed
ugiacoman opened this issue Dec 9, 2016 · 11 comments
Closed

CollectionView Reordering Cells, Updating with Old Cell #218

ugiacoman opened this issue Dec 9, 2016 · 11 comments

Comments

@ugiacoman
Copy link

ugiacoman commented Dec 9, 2016

Step 2: Describe your environment

  • Objective C or Swift: Swift
  • iOS version: 9.3
  • Firebase SDK version: 3.9
  • FirebaseUI version: 1.0
  • CocoaPods Version: 1.1.1

Step 3: Describe the problem:

CollectionView is updating incorrectly on reordering of the cells. I am using priority to order my datasource. Not sure if this is a bug, or there is a workaround for this.

Observed Results:

In my collectionView I am reordering cells. When I reorder cells without updating the data source, the cells fall into place. When I reorder and update the datasource, FirebaseUI thinks that it needs to populate the cell again and populates the destination cell with the old cell. When I leave the view and come back, the order is updated properly, just as it should be.

Expected Results:

  • I believe that FirebaseUI responds to datasource changes and updates the UI for you. However, this becomes a problem when the user is making UI changes, such as when reordering cells.
@morganchen12
Copy link
Contributor

FirebaseUI currently assumes it's the only thing making changes to the collection view, so it's expected that you'll run into issues if you try to transform it yourself. The best way to do this is to make changes to the items in Firebase Database, which the FirebaseUI data sources will then pull and update the collection view automatically.

@ugiacoman
Copy link
Author

@morganchen12 Thanks for the reply! Yeah, that's going to be an issue for reordering items. Is there a way to override the method that calls populateCell? Is that API open? If this were available we'd be able to control events such as the user reordering.

@morganchen12
Copy link
Contributor

That's being added in #186, but doesn't quite exist yet.

@ugiacoman
Copy link
Author

Gotcha, do you know what the timeline is for it?

@morganchen12
Copy link
Contributor

I want to say within a week, but I can't give any guarantees.

Now that there's been strong requests for #186 to get merged, though, I'm inclined to say it may happen faster.

@morganchen12
Copy link
Contributor

Update on this: There's been some contentious discussion on the Android side of this issue, since the Firebase maintainer folk are cautions around adding client-side query filtering and thus enabling people to accidentally download massive data sets only to display small slices of those sets. After agreeing to make filtering a deliberate non-goal, Android is now happy with this sort of PR and will hopefully finish it soon.

The holiday season is going to slow things down somewhat, though.

@ugiacoman
Copy link
Author

@morganchen12 Great, thanks for the update! I've been implementing methods via FUIArray.......let's just say I'm glad there is an update coming haha :D This is specifically for #186 correct?

@morganchen12
Copy link
Contributor

Yes.

@morganchen12
Copy link
Contributor

#186 has been merged. Release coming soon.

@morganchen12
Copy link
Contributor

v2.0.0 has been released. Thanks for waiting!

@ugiacoman
Copy link
Author

@morganchen12 Thank you, we'll definitely take a look! We've had a lot of success adding observers to FUIArray and creating a separate object to manage the content of our Tableviews/Collections. We've already implemented it into two of our apps. Thanks for developing such a reliable platform :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants