Skip to content

Instantly share code, notes, and snippets.

@dippnerd
dippnerd / SwiftUI Multi-Select Picker
Created February 8, 2021 18:55
One way to create a SwiftUI form list of items that lets you select more than one (unlike the stock picker form)
struct MultiSelectPickerView: View {
//the list of all items to read from
@State var sourceItems: [String]
//a binding to the values we want to track
@Binding var selectedItems: [String]
var body: some View {
Form {
List {

Keybase proof

I hereby claim:

  • I am dippnerd on github.
  • I am dippnerd (https://keybase.io/dippnerd) on keybase.
  • I have a public key whose fingerprint is 1559 60F6 1A1D A08D C2A8 9163 DDFF 595F 423C F3E2

To claim this, I am signing this object: