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
true
to switch to the loading state. If set totrue
, SimpleButton showsloadingView
and hides the defaulttitleLabel
andimageView
Declaration
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
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
andimageView
Declaration
Swift
open func setTitleImageSpacing(_ spacing: CGFloat)
Parameters
spacing
spacing between
titleLabel
andimageView
-
Undocumented
Declaration
Swift
override open func layoutSubviews()