Chips/Tags Input View in SwiftUI
Reading time: 3 min
This recipe shows how to implement a chips/tags input view in SwiftUI. It is a TextField
that parses its input and stores it as deletable chips. It responds to space, submit and backspace events to allow for seamless editing of chips/tags from within the text field.
Detect Backspace in SwiftUI
Reading time: 2 min
This recipe shows how to detect backspace event in SwiftUI TextField. The method can figure out both if it's a forward or in-text backspace, and doesn't rely on hacks on hidden characters.
Underline View in SwiftUI
Reading time: 1 min
This quick recipe shows how to add an underline to any View in SwiftUI. You might want to do that to simulate a certain kind of TextField
, or just to add a horizontal divider to a section of your UI.
SwiftUI Accordion View
Reading time: 2 min
This recipe shows how to implement an accordion view in SwiftUI. An accordion view is a layout that consists of a series of linked disclosure groups, only one of which can be expanded at the time.
SwiftUI Limit Text Length in TextField
Reading time: 1 min
This quick recipe shows how to limit the length of a SwiftUI TextField input.