Closed otymartin closed 7 years ago
@otymartin instead of using the mutable dataArray.count
in the section controller, I would use an immutable object that represents the data in your section. Whenever a network request finishes, you can call performUpdates(...)
and recreate your immutable models.
Take a look at my weather app data source as an example. Anytime something changes I recreate the models which power my different section controllers.
Thanks @rnystrom Looks like I have to dive into a new topic immutable models
. Thanks for providing your code, its helping alot.
🎉
@rnystrom
In my sectionController
numberOfItems
, I would like to return mydataArray.count
as opposed to justreturn 1
per sectionController. My dataArray.count varies as its populated by network queries.The problem is my
dataArray
is in myviewController
which is my datasource.I can try to instantiate my
viewController
in mysectionArray
and access thedataArray.count
but problem I found isnumberOfItems
and I think the whole sectionController loads before my viewController'sviewDidLoad
method resulting innil
for mydataArray.count
.How can I fix this?
New issue checklist
README
and documentationGeneral information
IGListKit
version: 2.0