EnterpriseDS Documentation

Structure DSUIButton

@available(iOS 13.0, tvOS 13.0, *)
public struct DSUIButton: View  

An Enterprise-styled push button element for use in SwiftUI. Enterprise icons as well as all normal SwiftUI Button functionality.

Initialize and set properties as needed.

DSUIButton(title: "Next",
    icon: .action,
    isLoading: $isLoading,
    isFitMaxWidth: true,
    action: {
        self.isNextActive = true
    })

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 using isLoading binding . (Anatomy button styles only.)

anatomyButton.isLoading = true
DSUIButton DSUIButton View View DSUIButton->View

Conforms To

View

Initializers

init(title:​icon:​rendering​Type:​image​Location:​is​Loading:​is​Fit​Max​Width:​action:​)

public init(title: String, icon: DSIconRenderingType? = nil, renderingType: DSButtonRenderingType = .secondary, imageLocation: DSButtonImageLocationType = .leading, isLoading: Binding<Bool> = .constant(false), isFitMaxWidth: Bool = false, action: @escaping () -> Void)  

Properties

body

public var body: some View