Member-only story

Flavors of SwiftUI Picker on macOS

All available SwiftUI Picker styles for macOS apps in one place.

Gabriel Theodoropoulos
6 min readJan 26, 2022
Photo by Karolina Grabowska from Pexels

Picker view is what we would be calling a multi-tool, or the Swiss knife of programming when creating user interfaces with SwiftUI. And that’s because the same view can get various appearances, depending on the style that we assign to it and how we want it to appear.

It’s important to know in advance that picker view is quite dependent on the target platform that is about to be rendered. There are different picker variations for iOS, macOS and watchOS systems. In this post I’m focusing on the picker view on macOS, where I’m gathering together in one place the various available styles currently exist.

Note: If you are interested in reading about the SwiftUI picker in iOS, then check out this post.

Initializing a picker

In the following snippet you can see the initialization of a picker view, without applying any style yet:

--

--

Gabriel Theodoropoulos
Gabriel Theodoropoulos

Written by Gabriel Theodoropoulos

An iOS & macOS app maker writing code in Swift. Author of countless programming tutorials. Content creator. https://serialcoder.dev

No responses yet