What's the difference between InlinePickerStyle and WheelPickerStyle

struct PickerStyleView: View {

    @State private var num  =  0

    var body: some View {

        Form{

            Text("Number")

            Picker(String(num), selection: $num, content: {

                

                Text("5").tag(5)

                Text("10").tag(10)

                Text("15").tag(15)

                Text("20").tag(20)

            })

            .pickerStyle(InlinePickerStyle())

        }

    }

}

Using InlinePickerStyle() and WheelPickerStyle() seems to be no difference.

What does "InlinePickerStyle()" refer to? And which case is "InlinePickerStyle()" suitable for in practice? Any help will be appreciated.

Answered by robnotyou in 687771022

Here's your code, unmodified, running on a Mac.

SwiftUI works on multiple platforms, and the details of how some styles appear can be platform-dependent.
So two styles might look the same on iOS, but could behave differently on macOS.

Accepted Answer

Here's your code, unmodified, running on a Mac.

SwiftUI works on multiple platforms, and the details of how some styles appear can be platform-dependent.
So two styles might look the same on iOS, but could behave differently on macOS.

What's the difference between InlinePickerStyle and WheelPickerStyle
 
 
Q