Closed yusuftor closed 7 years ago
Ok I'm an idiot, sorry.
Just realised that because they're not on screen they're not going to be in the collection context! So if anyone is wondering the solution is to have an "attributedString" parameter that is set when you retrieve the caption. That way, when the cell is loaded on screen by using cellForItem(), it can check to see if the attributedString parameter has been set and then use that value.
I'm gonna close this.
Thanks @yusuftor !
New issue checklist
README
and documentationGeneral information
IGListKit
version: 1.0 Master branchI'm using the working range delegate to preload both images and generate an attributed string out of text. Inside the delegate function
sectionControllerWillEnterWorkingRange
, I have the following code:This successfully retrieves my
caption
but returns nil forcellForItem()
, therefore never setting the attributed text. This is odd because after retrieving the caption, it retrieves the image in a similar fashion but thecellForItem()
call succeeds. My working range is set to 2.You can test the retrieval of a
nil
cell by adding the following code in the demo projectWorkingRangeSectionController
undersectionControllerWillEnterWorkingRange
:This will cause some of the output to say "This cell is: nil". Is this a bug, or is there a reason it does this that I'm not aware of?
P.S. It looks like the website where the images for the
WorkingRangeSectionController
come from is down.