AKPFlowLayout

public final class AKPFlowLayout: UICollectionViewFlowLayout

Global / Sticky / Stretchy Headers using UICollectionViewFlowLayout. Works for iOS8 and above.

  • Layout configuration options

    Declaration

    Swift

    public var layoutOptions: AKPLayoutConfigOptions = [.FirstSectionIsGlobalHeader,
  • For stretchy headers, allowis limiting amount of stretch

    Declaration

    Swift

    public var firsSectionMaximumStretchHeight = CGFloat.max
  • Undocumented

    Declaration

    Swift

    public final class AKPFlowLayout: UICollectionViewFlowLayout
  • Undocumented

    Declaration

    Swift

    public final class AKPFlowLayout: UICollectionViewFlowLayout
  • Declaration

    Swift

    override public class func layoutAttributesClass() -> AnyClass

    Return Value

    AKPFlowLayoutAttributes class for handling layout attributes

  • Returns layout attributes for specified rectangle, with added custom headers

    Declaration

    Swift

    override public func layoutAttributesForElementsInRect(rect: CGRect) -> [UICollectionViewLayoutAttributes]?
  • Adjusts layout attributes for the custom section headers

    Declaration

    Swift

    override public func layoutAttributesForSupplementaryViewOfKind(elementKind: String,
                                                                 atIndexPath indexPath: NSIndexPath)
                                                                        -> UICollectionViewLayoutAttributes?
  • Declaration

    Swift

    override public func shouldInvalidateLayoutForBoundsChange(newBounds: CGRect) -> Bool

    Return Value

    true, unless running on iOS9 with sectionHeadersPinToVisibleBounds set to true

  • Custom invalidation

    Declaration

    Swift

    override public func invalidationContextForBoundsChange(newBounds: CGRect)
                                            -> UICollectionViewLayoutInvalidationContext
  • KVO check for sectionHeadersPinToVisibleBounds. For iOS9, needs to ensure the impl does not interfere with sectionHeadersPinToVisibleBounds

    Declaration

    Swift

    override public func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?,
                                                    change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>)