Class
UICollectionViewLayoutInvalidationContext
A context object that declares which parts of your layout need to be updated when the layout is invalidated.
--一个用于无效化的上下文对象,声明当布局无效时需要更新布局的哪些部分。
Declaration
class UICollectionViewLayoutInvalidationContext : NSObject
Overview --概览
Layout objects that are designed to support invalidation contexts can use the information in a UICollectionViewLayoutInvalidationContext
object to optimize their behavior during the invalidation cycle. You can create an invalidation context object as a precursor to invalidating a layout object. After configuring the invalidation context object, pass it to the layout object’s invalidateLayout(with:)
method, which is responsible for using the context object to update the layout efficiently. The collection view also creates invalidation contexts in response to specific changes. For example, it creates an invalidation context when you change the layout or data source object, when you insert or delete items, and when you call the reloadData()
method.
--设计用来支持“无效上下文”的布局对象可以使用uiCollectionViewLayoutValidationContext对象中的信息来优化它们在无效化的运行循环期间的行为。你可以创建“无效上下文”