Class
Chip
public final class Chip: UIButton
Chips are compact elements that allow users to enter, make selections, filter content, or trigger actions.
Prefer to use make(style:title:leftAccessory:rightAccessory:)
to create a Chip.
Chips can appear in one of four contexts:
-
input: Input chips represent a complex piece of information in compact form, such as an entity (person, place, or thing) or text.
-
choice: Choice chips allow selection of a single chip from a set of options.
-
filter: Filter chips use tags or descriptive words to filter content.
-
action: Action chips offer actions related to primary content. They should appear dynamically and contextually in a UI.
Relationships
Nested Types
Chip.Style
An enum representing default color styles for Chip components
Conforms To
UIButton
Initializers
init(style:title:leftAccessory:rightAccessory:)
public init(style: Style, title: String, leftAccessory: UIImage? = nil, rightAccessory: UIImage? = nil)
Creates a new Chip.
Prefer to use make(style:title:leftAccessory:rightAccessory:)
over this method.
Properties
style
public var style: Style
isEnabled
public override var isEnabled: Bool
isHighlighted
public override var isHighlighted: Bool
isSelected
public override var isSelected: Bool
isToggleable
public var isToggleable: Bool = false
Methods
make(style:title:leftAccessory:rightAccessory:)
public static func make(style: Style, title: String, leftAccessory: UIImage? = nil, rightAccessory: UIImage? = nil) -> Chip
Creates a new Chip.
layoutSubviews()
public override func layoutSubviews()
touchesBegan(_:with:)
public override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)
touchesEnded(_:with:)
public override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?)