@IBDesignable public final class DSButton: UIButton
An Enterprise-styled push button element. It includes properties for adding and positioning Enterprise icons as well as all normal UIButton functionality.
For storyboards, add a UIButton to your view and change the class name to DSButton. BE SURE THE TYPE IS SET TO CUSTOM otherwise some colors won't show correctly.
Initialize and set properties as needed.
let button = DSButton(renderingType: .primary) button.setTitle("Settings", for: .normal) button.icon = .gear
The renderingType decides the behavior and appearance of the button. Enterprise Button is supported by primary, secondary and tertiary. For older Anatomy-style buttons, which appear as teal green, use the anatomyPrimary, anatomyDefault and anatomyTertiary rendering types.
If the button performs an asynchronous operation, you can present a spinning indicator by setting isLoading to true. (Anatomy button styles only.)
anatomyButton.isLoading = true