CreationKit Documentation

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.

Chip Chip UIButton UIButton Chip->UIButton

Nested Types

Chip.Style

An enum representing default color styles for Chip components

Conforms To

UIButton

Initializers

init(style:​title:​left​Accessory:​right​Accessory:​)

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  

is​Enabled

public override var isEnabled: Bool  

is​Highlighted

public override var isHighlighted: Bool  

is​Selected

public override var isSelected: Bool  

is​Toggleable

public var isToggleable: Bool = false

Methods

make(style:​title:​left​Accessory:​right​Accessory:​)

public static func make(style: Style, title: String, leftAccessory: UIImage? = nil, rightAccessory: UIImage? = nil) -> Chip  

Creates a new Chip.

layout​Subviews()

public override func layoutSubviews()  

touches​Began(_:​with:​)

public override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)  

touches​Ended(_:​with:​)

public override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?)