Collapsable

public protocol Collapsable

Represents a collapsable element.

  • Collapse self.

    Declaration

    Swift

    func collapse(animated: Bool, animationDuration: TimeInterval)

    Parameters

    animated

    Indicates if the collapse should be animated.

    animationDuration

    The animationDuration of the collapse.

  • Uncollapse self.

    Declaration

    Swift

    func uncollapse(animated: Bool, animationDuration: TimeInterval)

    Parameters

    animated

    Indicates if the collapse should be animated.

    animationDuration

    The animationDuration of the collapse.

Available where Self: UIView

  • collapse(animated:animationDuration:) Default implementation

    Default Implementation

    Collapse a view by adding/modifying constraint height. It works also if they view already has a constraint.

    Warning

    It is intended to be used to collapse a view without subviews.

    Declaration

    Swift

    public func collapse(animated: Bool = true, animationDuration: TimeInterval = 1)

    Parameters

    view

    The view to collapse

    animated

    Indicates if the collapse should be animated.

    animationDuration

    The animationDuration of the collapse.

  • Default Implementation

    Uncollapse a view by removing/modifying constraint height. It works also if they view already has a constraint.

    Warning: It is intended to be used to uncollapse a view without subviews.

    Declaration

    Swift

    public func uncollapse(animated: Bool = true, animationDuration: TimeInterval = 1)

    Parameters

    view

    The view to collapse

    animated

    Indicates if the collapse should be animated.

    animationDuration

    The animationDuration of the collapse.