[quote='827001022, Frameworks Engineer, /thread/775436?answerId=827001022#827001022']
I would recommend you try to trigger your lazy variables to evaluate earlier
[/quote]
Hello Team,
I think this is not a optimal solution.
As we know, lazy variables are designed to be initialized only once upon their first access, ensuring efficient memory usage. However, I’ve encountered a situation where UIKit seems to assume that supplementary view registrations are being recreated each time a supplementary view is requested. This is leading to the following warning:
"Creating a new registration each time a supplementary view is requested will prevent reuse and cause created supplementary views to remain inaccessible in memory for the lifetime of the collection view. Registrations should be created up front and reused."
This behavior appears to conflict with the intended use of lazy variables, which should only be initialized once. It seems that UIKit is not recognizing the lazy initialization pattern. If a cell is registered lazily, UIKit should reuse it, right?
Is this an expected behavior, or could it be an issue with how UIKit handles lazy variables in this context? Any clarification or guidance on this matter would be greatly appreciated.
Thank you for your attention to this issue.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: