NatAlert
public final class NatAlert : UIView
NatAlert is a class that represents the alert component from the design system. An alert displays a short, important message in a way that attracts the user’s attention without interrupting the user’s task
Example of usage:
natAlert.configure(titleText: "Title example")
natAlert.configure(color: .systemRed)
natAlert.configure(descriptionText: "Description of your alert")
natAlert.configure(primaryButtonTitle: "Primary Button Title")
natAlert.configure(secondaryButtonTitle: "Secondary Button Title")
natAlert.configure(showIcon: false)
natAlert.configure(getIcon(icon: .outlinedAlertNotification))
Requires
It’s necessary to configure the Design System with a theme or fatalError will be raised.
DesignSystem().configure(with: AvailableTheme)
-
Undocumented
Declaration
Swift
public var primaryButtonTitle: String { get set } -
Undocumented
Declaration
Swift
public var secondaryButtonTitle: String { get set } -
Undocumented
Declaration
Swift
public var showTitle: Bool { get set } -
Undocumented
Declaration
Swift
public var titleText: String? { get set } -
Undocumented
Declaration
Swift
public var descriptionText: String? { get set }
-
Undocumented
Declaration
Swift
public init(style: AlertStyle = .info, type: AlertType = .contained)
-
Sets the title of the component.
Example of usage:
natAlert.configure(titleText: "Texto exemplo")Declaration
Swift
public func configure(titleText: String?)Parameters
titleTextAn
Stringthat changes the title of the component -
Sets the text description of the component.
Example of usage:
natAlert.configure(descriptionText: "Texto exemplo")Declaration
Swift
public func configure(descriptionText: String?)Parameters
descriptionTextAn
Stringthat changes the description of the component -
Sets the title for the primary button of the component.
Example of usage:
natAlert.configure(primaryButtonTitle: "Texto exemplo")Declaration
Swift
public func configure(primaryButtonTitle: String)Parameters
primaryButtonTitleAn
Stringthat changes the title of the primary button of the component -
Sets the title for the secondary button of the component.
Example of usage:
natAlert.configure(secondaryButtonTitle: "Texto exemplo")Declaration
Swift
public func configure(secondaryButtonTitle: String)Parameters
secondaryButtonTitleAn
Stringthat changes the title of the secondary button of the component -
Sets if the component should show an icon or not
Example of usage:
natAlert.configure(showIcon: false)Declaration
Swift
public func configure(showIcon: Bool = true)Parameters
showIconA
Booleanthat changes if the component should show an icon or not -
Sets an icon for the alert
Example of usage:
natAlert.configure(icon: getIcon(icon: .outlinedAlertNotification))Declaration
Swift
public func configure(icon: String)Parameters
iconA
Stringthat sets an image for the icon -
Undocumented
See moreDeclaration
Swift
public enum AlertStyle -
Undocumented
See moreDeclaration
Swift
public enum AlertType