SimpleButton
open class SimpleButton : UIButton
Undocumented
-
Loading view. UIActivityIndicatorView as default
Declaration
Swift
open var loadingView: UIView? -
Default duration of animated state change.
Declaration
Swift
open var defaultAnimationDuration: TimeInterval -
Represents current button state.
Declaration
Swift
open override var state: UIControl.State { get }
-
Undocumented
Declaration
Swift
override open var isEnabled: Bool { get set } -
Undocumented
Declaration
Swift
override open var isHighlighted: Bool { get set } -
Undocumented
Declaration
Swift
override open var isSelected: Bool { get set }
-
A Boolean value that determines the SimpleButton´s loading state. Specify
trueto switch to the loading state. If set totrue, SimpleButton showsloadingViewand hides the defaulttitleLabelandimageViewDeclaration
Swift
open var isLoading: Bool { get set }
-
Undocumented
Declaration
Swift
required override public init(frame: CGRect) -
Undocumented
Declaration
Swift
required public init?(coder aDecoder: NSCoder) -
Undocumented
Declaration
Swift
open override func prepareForInterfaceBuilder() -
Undocumented
Declaration
Swift
open override func awakeFromNib()
-
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
UIControlStateDeclaration
Swift
open func setScale(_ scale: CGFloat, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)Parameters
scalescale of button
statedetermines at which state that scale applies
animateddetermines if that change in scale should animate. Default is
trueanimationDurationset 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
UIControlStateDeclaration
Swift
open func setBackgroundColor(_ color: UIColor, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)Parameters
colorbackground color of button
statedetermines at which state that background color applies
animateddetermines if that change in background color should animate. Default is
trueanimationDurationset 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
UIControlStateDeclaration
Swift
open func setBorderWidth(_ width: CGFloat, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)Parameters
widthborder width of button
statedetermines at which state that border width applies
animateddetermines if that change in border width should animate. Default is
trueanimationDurationset 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
UIControlStateDeclaration
Swift
open func setBorderColor(_ color: UIColor, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)Parameters
colorborder color of button
statedetermines at which state that border color applies
animateddetermines if that change in border color should animate. Default is
trueanimationDurationset 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
UIControlStateDeclaration
Swift
open func setCornerRadius(_ radius: CGFloat, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)Parameters
radiuscorner radius of button
statedetermines at which state that corner radius applies
animateddetermines if that change in radius of the corners should animate. Default is
trueanimationDurationset 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
UIControlStateDeclaration
Swift
open func setShadowColor(_ color: UIColor, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)Parameters
colorshadow color of button
statedetermines at which state that shadow color applies
animateddetermines if that change in shadow color should animate. Default is
trueanimationDurationset 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
UIControlStateDeclaration
Swift
open func setShadowOpacity(_ opacity: Float, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)Parameters
opacityshadow opacity of button
statedetermines at which state that shadow opacity applies
animateddetermines if that change in shadow opacity should animate. Default is
trueanimationDurationset 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
UIControlStateDeclaration
Swift
open func setShadowRadius(_ radius: CGFloat, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)Parameters
radiusshadow radius of button
statedetermines at which state that shadow radius applies
animateddetermines if that change in shadow radius should animate. Default is
trueanimationDurationset 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
UIControlStateDeclaration
Swift
open func setShadowOffset(_ offset: CGSize, for state: UIControl.State = .normal, animated: Bool = true, animationDuration: TimeInterval? = nil)Parameters
offsetshadow offset of button
statedetermines at which state that shadow offset applies
animateddetermines if that change in shadow offset should animate. Default is
trueanimationDurationset 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
titleLabelandimageViewDeclaration
Swift
open func setTitleImageSpacing(_ spacing: CGFloat)Parameters
spacingspacing between
titleLabelandimageView
-
Undocumented
Declaration
Swift
override open func layoutSubviews()
View on GitHub
Install in Dash
SimpleButton Class Reference