FUISectionLayoutManager
open class FUISectionLayoutManager : NSObject
A collection view section layout manager that computes the position and size in a section. This is a base class which defines the common properties of a collection section. This class is not supposed to be used directly. Instead, subclass this one and implement prepare()
for calculating frames for views in collection view.
-
Section index.
Declaration
Swift
open var section: Int
-
Section offset in content view.
Declaration
Swift
open var offset: CGPoint { get set }
-
Section inset for content cells.
Declaration
Swift
open var inset: UIEdgeInsets
-
Section width.
Declaration
Swift
open var sectionWidth: CGFloat
-
Number of items in section.
Declaration
Swift
open var numberOfItems: Int
-
Spacing between two cells on the same row.
Declaration
Swift
open var interItemSpacing: CGFloat
-
Spacing between two lines.
Declaration
Swift
open var lineSpacing: CGFloat
-
Sizes for cells.
Declaration
Swift
open var itemSizes: [CGSize]
-
Height for section header
Declaration
Swift
open var headerHeight: CGFloat
-
Height for section footer
Declaration
Swift
open var footerHeight: CGFloat
-
Frames for cells relative to section.
Declaration
Swift
open var itemFrames: [CGRect]
-
Frame for section header relative to section.
Declaration
Swift
open var headerFrame: CGRect?
-
Frame for section footer relative to section.
Declaration
Swift
open var footerFrame: CGRect?
-
Layout attributes for cells.
Declaration
Swift
open var itemAttributes: [UICollectionViewLayoutAttributes]
-
Layout attribute for header.
Declaration
Swift
open var headerAttribute: UICollectionViewLayoutAttributes?
-
Layout attribute for footer.
Declaration
Swift
open var footerAttribute: UICollectionViewLayoutAttributes?
-
Indicating whether layout needs to be recomputed.
Declaration
Swift
open var needsLayout: Bool
-
Indicating whether attributes need updating.
Declaration
Swift
open var needsUpdateAttributes: Bool
-
Section bounds (including header and footer)
Declaration
Swift
open var bounds: CGRect
-
Section frame in collection view’s content view.
Declaration
Swift
open var frame: CGRect { get }
-
Calulate frames for items, header, footer and bounds for section. Always call super at the end when overriding.
Declaration
Swift
open func prepare()
-
Computes layout attributes based on frames. Default implementation sets layout attribute’s frame to the view frame(relative to section) offset by section offset.
Declaration
Swift
open func updateAttributes()
-
Returns the layout attributes for all of the cells and views in the specified rectangle.
Declaration
Swift
open func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]?
Parameters
rect
The rectangle (specified in the collection view’s coordinate system) containing the target views.
Return Value
An array of UICollectionViewLayoutAttributes objects representing the layout information for the cells and views. The default implementation returns nil.
-
Returns the layout attributes for the item at the specified index.
Declaration
Swift
open func layoutAttributesForItem(at index: Int) -> UICollectionViewLayoutAttributes?
Parameters
index
The index of the item in section.
Return Value
A layout attributes object containing the information to apply to the item’s cell.
-
Returns the layout attributes for the header.
Declaration
Swift
open func layoutAttributeForHeader() -> UICollectionViewLayoutAttributes?
Return Value
A layout attributes object containing the information to apply to the header.
-
Returns the layout attributes for the footer.
Declaration
Swift
open func layoutAttributeForFooter() -> UICollectionViewLayoutAttributes?
Return Value
A layout attributes object containing the information to apply to the footer.