Picker control which chooses values from strings in SwiftUI

Well, I surrender.

I have a simple view which have a picker control.

struct PickerView : View {
    @Binding var chosen: String
    var values: [String] = []
    var values2() -> [(Int, String)] {
        return Array(zip(Array(self.values.indices), self.values))
    }
    var body1: some View {
        Picker(selection: $chosen, label: Text("Choose")) {
            ForEach(self.values.identified(by: \.self)) { value in
                Text(value).tag(value)
            }
        }
    }
    var body2: some View {
        Picker(selection: $chosen, label: Text("Choose")) {
            ForEach(self.values2().identified(by: \.0)) { value in
                Text(value.1).tag(value.1)
            }
        }
    }
    var body: some View {
        return self.body
    }
}

It provides picker control which uses strings to select from.

I have an outer view which provides data to this picker view.

struct HeaderView : View {
    struct Data {
        var chosen = "Ha"
        var values = ["Ha", "Ha-ha", "Ho-ho-ho"]
    }
    @State var data: Data = Data()
    var body: some View {
        List {
            Section(header: Text("Ha")) {
                PickerView(chosen: $data.chosen, values: $data.values.value)
            }
        }.listStyle(.grouped)
    }
}

But...

Cell is disabled and I can't choose new value. I think that I do something wrong with Identifiable protocol.

Haven't tested yet, but I don't think you need identified(by:). It'll transform Binding<String> to IdentifierValuePair<Binding<String>, String>.

So value will be of type IVP, which doesn't match the chosen and so the tag may be ignored.

struct PickerView : View {
    @Binding var chosen: String
    var values: [String] = []

    var body: some View {
        Picker(selection: $chosen, label: Text("Choose")) {
            ForEach(values) { value in
                Text(value).tag(value)
            }
        }
    }
}

It doesn't work either.
I have tested on iOS 13 simulator ( I don't install Catalina ).

I added #off-topic tag to the thread as right now it's not clear if SwiftUI will get it's own corner in the forums or not.