iPhone SwiftUI layouts

Explore interactive SwiftUI previews across every available iPhone screenshot variant.

Picker

Custom Value Label Picker

Creates a picker that generates its label from a localized string key and accepts a custom current value label.

@State var selection = "1"
let pickerOptions = ["1", "2", "3"]

var body: some View {
    List {
        Picker("Foo", selection: $selection) {
            ForEach(pickerOptions, id: \.self) { option in
                Text(option)
            }
        } currentValueLabel: {
            Text("Current: \(selection)")
        }
    }
}
iOS 18.0+ iPadOS 18.0+ macOS 15.0+ watchOS 11.0+ tvOS 18.0+ visionOS 2.0+

Every available iPhone screenshot for Custom Value Label Picker.

2 views