MUToast

@IBDesignable
open class MUToast : MUNibView

Class that define a card (title, description, indicator and image) with screen animation.

  • The toast’s corner radius.

    Declaration

    Swift

    @IBInspectable
    open dynamic var cornerRadius: CGFloat { get set }
  • The current title.

    Declaration

    Swift

    @IBInspectable
    open var title: String { get set }
  • The title’s font.

    Declaration

    Swift

    open var titleFont: UIFont { get set }
  • The title’s text color.

    Declaration

    Swift

    @IBInspectable
    open dynamic var titleColor: UIColor { get set }
  • The current detail description.

    Declaration

    Swift

    @IBInspectable
    open var detail: String { get set }
  • The detail’s font.

    Declaration

    Swift

    open var detailFont: UIFont { get set }
  • The detail’s text color.

    Declaration

    Swift

    @IBInspectable
    open dynamic var detailColor: UIColor { get set }
  • The text’s horizontal alignment.

    Declaration

    Swift

    @objc
    open dynamic var textAlignment: NSTextAlignment { get set }
  • Optional: The IBInspectable version of the text’s horizontal alignment.

    Declaration

    Swift

    @IBInspectable
    open var textAlignmentInt: Int { get set }
  • The Title and Detail text vertical spacing.

    Declaration

    Swift

    @IBInspectable
    open var spacing: CGFloat { get set }
  • The header’s horizontal padding.

    Declaration

    Swift

    @IBInspectable
    open var headerHorizontalPadding: CGFloat { get set }
  • The header’s vertical padding.

    Declaration

    Swift

    @IBInspectable
    open var headerVerticalPadding: CGFloat { get set }
  • Returns the image of the toast.

    Declaration

    Swift

    @IBInspectable
    open dynamic var icon: UIImage? { get set }
  • The icon’s left padding.

    Declaration

    Swift

    @IBInspectable
    open var iconLeftPadding: CGFloat { get set }
  • The icon’s width.

    Declaration

    Swift

    @IBInspectable
    open var iconWidth: CGFloat { get set }
  • The indicator’s width.

    Declaration

    Swift

    @IBInspectable
    open dynamic var indicatorWidth: CGFloat { get set }
  • The indicator’s color.

    Declaration

    Swift

    @IBInspectable
    open dynamic var indicatorColor: UIColor { get set }
  • The total duration of the animations, measured in seconds. If you specify a negative value or 0, the changes are made without animating them.

    Declaration

    Swift

    @IBInspectable
    open dynamic var animationDuration: Double
  • The total duration of the display, measured in seconds. If you specify a negative value or 0, the toast will not hide automatically once animation end.

    Declaration

    Swift

    @IBInspectable
    open dynamic var displayDuration: Double
  • The position where the toast will be visible.

    Declaration

    Swift

    open var displayPosition: MUToastPosition
  • The toast’s priority. Higher will be on top of lower toasts.

    Declaration

    Swift

    open var displayPriority: MUToastPriority
  • The toast’s horizontal padding.

    Declaration

    Swift

    @IBInspectable
    open var horizontalPadding: CGFloat
  • The toast’s vertical padding.

    Declaration

    Swift

    @IBInspectable
    open var verticalPadding: CGFloat
  • Default setup to load the view from a xib file.

    Declaration

    Swift

    open override func xibSetup()
  • Performs a show animation using the animation’s values.

    Declaration

    Swift

    open func show(in vc: UIViewController, onTap: (() -> Void)? = nil, completion: ((Bool) -> Void)? = nil)
  • Optional: If you want to hide the toast sooner than the normal animation.

    Declaration

    Swift

    open func hide(completion: ((Bool) -> Void)? = nil)