NatChipFilter
public final class NatChipFilter : UIView
NatChipFilter is a class that represents the ChipFilter component from the design system.
Example of usage:
let chipFilter = NatChipFilter(size: .semi, color: .neutral)
chipFilter.configure(text: "NatChipFilter example text")
chipFilter.configure(icon: getIcon(.outlinedDefaultMockup), position: .left)
chipFilter.configure(avatar: natAvatar, position: .right)
chipFilter.configure(state: .normal)
chipFilter.configure(actionHandler: { isSelect in
//do something
})
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 static var currentTheme: AvailableTheme
-
Undocumented
Declaration
Swift
public private(set) var state: UIControl.State { get set }
-
Undocumented
Declaration
Swift
public private(set) var isSelected: Bool { get set }
-
Undocumented
Declaration
Swift
public private(set) var theme: AvailableTheme { get set }
-
Undocumented
Declaration
Swift
public var color: ThemeColor { get set }
-
Undocumented
Declaration
Swift
public init(size: NatChipFilter.Size = .semi, color: NatChipFilter.Color = .neutral, theme: AvailableTheme = .none)
-
Undocumented
Declaration
Swift
public override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)
-
Undocumented
Declaration
Swift
public override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?)
-
Sets the text of the component.
Example of usage:
NatChipFilter.configure(text: "NatChipFilter example text")
Declaration
Swift
public func configure(text: String)
Parameters
text
A
String
that set the text of the component -
Sets an icon to the component.
Example of usage:
NatChipFilter.configure(icon: getIcon(.outlinedDefaultMockup), position: .left)
Declaration
Swift
public func configure(icon: String?, position: NatChipFilter.Position)
Parameters
icon
A
String
that set an icon to the componentposition
A
NatChipFilter.Position
that indicates the position of the icon -
Sets an avatar to the component.
Example of usage:
NatChipFilter.configure(avatar: natAvatar, position: .left)
Parameters
avatar
A
NatAvatar
that set an avatar to the componentposition
A
NatChipFilter.Position
that indicates the position of the avatar -
Sets the state of the component.
Example of usage:
NatChipFilter.configure(state: .normal)
Declaration
Swift
public func configure(state: UIControl.State)
Parameters
state
An
UIControl.State
that changes the state of the component -
Sets the handler to be executed when
isSelected
value changesExample of usage:
NatChipFilter.configure { isSelected in }
Declaration
Swift
public func configure(actionHandler: @escaping (Bool) -> Void)
Parameters
actionHandler
A closure to notify value change
-
Undocumented
Declaration
Swift
public func configure(color: Color)
-
Undocumented
See moreDeclaration
Swift
public enum Color
-
Undocumented
See moreDeclaration
Swift
public struct ThemeColor
-
Undocumented
See moreDeclaration
Swift
public enum Position
-
Size is an enum that represents the possible sizes for the NatChip size. The default size is
semi
.These are all sizes allowed for a NatChip:
- semi
- semiX
- medium
Declaration
Swift
public enum Size : CaseIterable