You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys, first let me say that I really appreciate what you do. I love using RxDataSources!
I am working on an application that uses collection view to display educational courses. To simplify things up, the model of the course looks like this:
The courses are downloaded from API and saved to Realm. Afterwards, from the collection view, they are fetched from Realm, mapped via CourseEntity protocol to CourseModel and bound to collection view data source.
As you can see, the courses can be bookmarked or completed (indicated by the "Completed" badge over the course).
If the course is completed (=> completed badge is visible), when the data are bound to the collection view (the completion status is received from the API) and user clicks on the bookmark icon, everything works just fine. The bookmark icon nicely animates due to the Equatable difference in bookmarked property, cellConfiguration function gets called once.
However, if the course is not completed, when the data are bound to the collection view and user completes it in the app (=> the Realm db entity is updated and the "Completed" badge is shown), then, when user clicks on the bookmark icon, the cellConfiguration function gets called twice - once with the original model (completed = false) and once with the newly updated model (completed = true). Since the section model is AnimatedSectionModel, the "Completed" badge fades out and then fades in again.
If you want, I can post more source code, but everything is quite straight forward:
Hi guys, first let me say that I really appreciate what you do. I love using RxDataSources!
I am working on an application that uses collection view to display educational courses. To simplify things up, the model of the course looks like this:
And the section model for RxDataSources looks like this:
The courses are downloaded from API and saved to Realm. Afterwards, from the collection view, they are fetched from Realm, mapped via
CourseEntity
protocol toCourseModel
and bound to collection view data source.As you can see, the courses can be bookmarked or completed (indicated by the "Completed" badge over the course).
If the course is completed (=> completed badge is visible), when the data are bound to the collection view (the completion status is received from the API) and user clicks on the bookmark icon, everything works just fine. The bookmark icon nicely animates due to the
Equatable
difference inbookmarked
property,cellConfiguration
function gets called once.However, if the course is not completed, when the data are bound to the collection view and user completes it in the app (=> the Realm db entity is updated and the "Completed" badge is shown), then, when user clicks on the bookmark icon, the
cellConfiguration
function gets called twice - once with the original model (completed = false) and once with the newly updated model (completed = true). Since the section model isAnimatedSectionModel
, the "Completed" badge fades out and then fades in again.If you want, I can post more source code, but everything is quite straight forward:
Thanks in advance for any help!
The text was updated successfully, but these errors were encountered: