SimpleButton

open class SimpleButton : UIButton

Undocumented

  • A Boolean value that determines the SimpleButton´s loading state. Specify true to switch to the loading state. If set to true, SimpleButton shows loadingView and hides the default titleLabel and imageView

    Declaration

    Swift

    open var isLoading: Bool { get set }
  • To define various styles for specific button states, override this function and set attributes for specific states (e.g. setBackgroundColor(UIColor.blueColor(), for: .Highlighted, animated: true))

    Declaration

    Swift

    open func configureButtonStyles()
  • Sets the scale for a specific UIControlState

    Declaration

    Swift

    open func setScale(_ scale: CGFloat, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)

    Parameters

    scale

    scale of button

    state

    determines at which state that scale applies

    animated

    determines if that change in scale should animate. Default is true

    animationDuration

    set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from defaultAnimationDuration

  • Sets the background color for a specific UIControlState

    Declaration

    Swift

    open func setBackgroundColor(_ color: UIColor, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)

    Parameters

    color

    background color of button

    state

    determines at which state that background color applies

    animated

    determines if that change in background color should animate. Default is true

    animationDuration

    set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from defaultAnimationDuration

  • Sets the border width for a specific UIControlState

    Declaration

    Swift

    open func setBorderWidth(_ width: CGFloat, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)

    Parameters

    width

    border width of button

    state

    determines at which state that border width applies

    animated

    determines if that change in border width should animate. Default is true

    animationDuration

    set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from defaultAnimationDuration

  • Sets the border color for a specific UIControlState

    Declaration

    Swift

    open func setBorderColor(_ color: UIColor, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)

    Parameters

    color

    border color of button

    state

    determines at which state that border color applies

    animated

    determines if that change in border color should animate. Default is true

    animationDuration

    set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from defaultAnimationDuration

  • Sets the corner radius for a specific UIControlState

    Declaration

    Swift

    open func setCornerRadius(_ radius: CGFloat, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)

    Parameters

    radius

    corner radius of button

    state

    determines at which state that corner radius applies

    animated

    determines if that change in radius of the corners should animate. Default is true

    animationDuration

    set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from defaultAnimationDuration

  • Sets the shadow color for a specific UIControlState

    Declaration

    Swift

    open func setShadowColor(_ color: UIColor, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)

    Parameters

    color

    shadow color of button

    state

    determines at which state that shadow color applies

    animated

    determines if that change in shadow color should animate. Default is true

    animationDuration

    set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from defaultAnimationDuration

  • Sets the shadow opacity for a specific UIControlState

    Declaration

    Swift

    open func setShadowOpacity(_ opacity: Float, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)

    Parameters

    opacity

    shadow opacity of button

    state

    determines at which state that shadow opacity applies

    animated

    determines if that change in shadow opacity should animate. Default is true

    animationDuration

    set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from defaultAnimationDuration

  • Sets the shadow radius for a specific UIControlState

    Declaration

    Swift

    open func setShadowRadius(_ radius: CGFloat, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)

    Parameters

    radius

    shadow radius of button

    state

    determines at which state that shadow radius applies

    animated

    determines if that change in shadow radius should animate. Default is true

    animationDuration

    set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from defaultAnimationDuration

  • Sets the shadow offset for a specific UIControlState

    Declaration

    Swift

    open func setShadowOffset(_ offset: CGSize, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)

    Parameters

    offset

    shadow offset of button

    state

    determines at which state that shadow offset applies

    animated

    determines if that change in shadow offset should animate. Default is true

    animationDuration

    set this value if you need a specific animation duration for this specific state change. If this is nil, the animation duration is taken from defaultAnimationDuration

  • Sets the spacing between titleLabel and imageView

    Declaration

    Swift

    open func setTitleImageSpacing(_ spacing: CGFloat)

    Parameters

    spacing

    spacing between titleLabel and imageView