iOS Developer Library

Developer

UIKit Framework Reference UICollectionViewFlowLayoutInvalidationContext Class Reference

Options
Deployment Target:

On This Page
Language:

UICollectionViewFlowLayoutInvalidationContext

Inheritance


Conforms To


Import Statement


Swift

import UIKit

Objective-C

@import UIKit;

Availability


Available in iOS 7.0 and later.

A UICollectionViewFlowLayoutInvalidationContext object specifies properties for determining whether to recompute the size of items or their position in the layout. The flow layout object creates instances of this class when it needs to invalidate its contents in response to changes. You can also create instances when invalidating the flow layout manually.

  • A Boolean indicating whether to recompute the size of items and views in the layout.

    Declaration

    Swift

    var invalidateFlowLayoutDelegateMetrics: Bool

    Objective-C

    @property(nonatomic) BOOL invalidateFlowLayoutDelegateMetrics

    Discussion

    The default value of this property is NOfalse. Set this property to YEStrue if you are invalidating the layout because of changes to the size of any items.

    When this property is set to YEStrue, the flow layout object recomputes the size of its items and views, querying the delegate object as needed for that information.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • A Boolean indicating whether to recompute the layout attributes for items and views in the layout.

    Declaration

    Swift

    var invalidateFlowLayoutAttributes: Bool

    Objective-C

    @property(nonatomic) BOOL invalidateFlowLayoutAttributes

    Discussion

    The default value of this property is NOfalse. Set this property to YEStrue if there are changes to the position of items on the screen. For example, the flow layout object sets this property to YEStrue when the collection view’s bounds change in a way that affects the number of items in a column or row.

    When this property is set to YEStrue, the flow layout object recomputes the layout attributes for its items and views. If the invalidateFlowLayoutDelegateMetrics property is set to NOfalse it recomputes this information without asking for new size information.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.