NatRadioButton
public final class NatRadioButton : UIView
NatRadioButton is a class that represents the RadioButton component from the design system.
Example of usage:
radioButton.configure(isSelected: true) radioButton.configure(isEnabled: true) radioButton.configure(text: “Example with label”) radioButton.configure(addToGroup: natRadioButtonGroup)
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 radioButton: NatSelectionControl
-
Undocumented
Declaration
Swift
public init(theme: AvailableTheme = .none)
-
Attribute that sets a label to the component
Declaration
Swift
public func configure(text: String?)
-
Attribute that sets and checks if the component is selected.
Declaration
Swift
public func configure(isSelected: Bool)
-
Attribute that sets and checks if the component is enabled.
Declaration
Swift
public func configure(isEnabled: Bool)
-
Attribute that adds the radioButton is a group.
Declaration
Swift
@available(*, deprecated, message: "Use NatRadioButtonGroup class to manage radio buttons group instead this method") public func configure(addToGroup: [NatRadioButton])
-
Sets the handler to be executed when
isSelected
value changesExample of usage:
radioButton.configure { isSelected in }
Declaration
Swift
public func configure(selectionHandler: @escaping SelectionHandler)
Parameters
selectionHandler
A closure to notify value change