BLTNInterfaceBuilder

@objc
open class BLTNInterfaceBuilder : NSObject

Generates interface elements for bulletins. Use this class to create custom bulletin items with standard components.

  • The item for which the interface builder was created.

    Declaration

    Swift

    @objc
    public weak var item: BLTNItem?
  • The appearance to use to generate the items.

    Declaration

    Swift

    @objc
    public let appearance: BLTNItemAppearance
  • Creates a new interface builder.

    Declaration

    Swift

    @objc
    public required init(appearance: BLTNItemAppearance, item: BLTNItem)
  • Creates a standard title label.

    Declaration

    Swift

    @objc
    open func makeTitleLabel() -> BLTNTitleLabelContainer
  • Creates a standard description label.

    Declaration

    Swift

    @objc
    open func makeDescriptionLabel() -> UILabel
  • Creates a standard text field with an optional delegate.

    Declaration

    Swift

    @objc
    open func makeTextField(placeholder: String? = nil,
                            returnKey: UIReturnKeyType = .default,
                            delegate: UITextFieldDelegate? = nil) -> UITextField

    Parameters

    placeholder

    The placeholder text.

    returnKey

    The type of return key to apply to the text field.

    delegate

    The delegate for the text field.

  • Creates a standard action (main) button.

    The created button will have rounded corners, a background color set to the tintColor and a title color set to actionButtonTitleColor.

    Declaration

    Swift

    @objc
    open func makeActionButton(title: String) -> BLTNHighlightButtonWrapper

    Parameters

    title

    The title of the button.

  • Creates a standard alternative button.

    The created button will have no background color and a title color set to tintColor.

    Declaration

    Swift

    @objc
    open func makeAlternativeButton(title: String) -> UIButton

    Parameters

    title

    The title of the button.

  • Creates a stack view to contain a group of objects.

    Declaration

    Swift

    @objc
    open func makeGroupStack(spacing: CGFloat = 10) -> UIStackView

    Parameters

    spacing

    The spacing between elements. Defaults to 10.

  • Wraps a view without intrinsic content size inside a view with an intrinsic content size.

    This method allows you to display view without an intrinsic content size, such as collection views, inside stack views; by using the returned BLTNContentView view.

    Declaration

    Swift

    @objc
    open func wrapView(_ view: UIView, width: NSNumber?, height: NSNumber?, position: BLTNViewPosition) -> BLTNContainerView

    Parameters

    view

    The view to wrap in the container.

    width

    The width of the content. Pass nil if the content has a flexible width.

    height

    The height of the content. Pass nil if the content has a flexible height.

    position

    The position of view inside its parent.

    Return Value

    The view that contains the view and an intrinsic content size. You can add the returned view to a stack view.