MMMStackContainer

Objective-C

@interface MMMStackContainer : UIView

Swift

class MMMStackContainer : UIView

A container which lays out its subviews in certain direction one after another using fixed spacing between them. It also aligns all the items along the layout line according to the given alignment settings. Note that you must use setSubviews: method instead of feeding them one by one via addSubview:. This is kind of a UIStackView that we understand the internals of.

  • Sets subviews to be laid out. Previously set subviews will be removed from this container first.

    Declaration

    Objective-C

    - (void)setSubviews:(nonnull NSArray<UIView *> *)subviews;

    Swift

    func setSubviews(_ subviews: [UIView])
  • Insets define the padding around all the subviews. Alignment influences horizontal constraints added for the subviews. Spacing is the fixed distance to set between items.

    Declaration

    Objective-C

    - (nonnull id)initWithDirection:(MMMLayoutDirection)direction
                             insets:(UIEdgeInsets)insets
                          alignment:(MMMLayoutAlignment)alignment
                            spacing:(CGFloat)spacing;

    Swift

    init(direction: MMMLayoutDirection, insets: UIEdgeInsets, alignment: MMMLayoutAlignment, spacing: CGFloat)
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (id)init NS_UNAVAILABLE;
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (id)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (id)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;