zenangst / Blueprints

:cyclone: Blueprints - A framework that is meant to make your life easier when working with collection view flow layouts.
Other
990 stars 56 forks source link

Bug/rogue calls to prepare without invalidating the context #108

Closed christoff-1992 closed 5 years ago

christoff-1992 commented 5 years ago

Fixes #107 - I don't think we should be having to do this, but occasionally prepare is called without the context been invalidated causing additional calls to things like sizeForItemAt.

This would normally go unnoticed, but I have been playing around with resizable child containers that have collection views with the custom layouts.

Occasionally the rogue calls would add more items than needed into the dynamic height cache I had held causing some cells to have the incorrect size.

zenangst commented 5 years ago

@christoff-1992 do you know what is invoking the prepare method? I mean, if you set a breakpoint, can you see what the previous stack frame comes from?

christoff-1992 commented 5 years ago

@christoff-1992 do you know what is invoking the prepare method? I mean, if you set a breakpoint, can you see what the previous stack frame comes from?

@zenangst - Unfortunately not in this scenario as it's been called by the system, I wish it did show us! If you have any tips on trying to find out where this is been called from I can investigate further.

zenangst commented 5 years ago

@christoff-1992 do you know what is invoking the prepare method? I mean, if you set a breakpoint, can you see what the previous stack frame comes from?

@zenangst - Unfortunately not in this scenario as it's been called by the system, I wish it did show us! If you have any tips on trying to find out where this is been called from I can investigate further.

@christoff-1992 And there is nothing in there hinting what could trigger it? Do you have any examples?

christoff-1992 commented 5 years ago

@christoff-1992 do you know what is invoking the prepare method? I mean, if you set a breakpoint, can you see what the previous stack frame comes from?

@zenangst - Unfortunately not in this scenario as it's been called by the system, I wish it did show us! If you have any tips on trying to find out where this is been called from I can investigate further.

@christoff-1992 And there is nothing in there hinting what could trigger it? Do you have any examples?

@zenangst - Just that its part of UIApplication, I can't share the current example but I will look at adding something in a new branch this weekend :)

zenangst commented 5 years ago

@christoff-1992 any updates on this? Should we merge it and then continue the investigation?