SwiftUI Picker
Asked on 07/31/2024
1 search
SwiftUI Picker
SwiftUI provides a variety of pickers that can be used to select values from a list. Here are some relevant details from the WWDC 2024 sessions:
-
Subscription Picker API:
- The subscription picker expects two closures. The first closure returns the view representing each subscription option, and the second closure provides a view for subscribing to the selected plan.
- You can create custom SwiftUI views for the picker options and use the new subscribe button API.
- For more details, you can refer to the session What’s new in StoreKit and In-App Purchase.
-
General Picker Usage:
- Pickers are used to select one value from a list and can be customized extensively.
- SwiftUI's declarative and adaptive views, including pickers, pack a lot of functionality in just a few lines of code.
- For a broader overview of SwiftUI controls, including pickers, you can check out the session SwiftUI essentials.
-
Transaction Picker in FinanceKit:
- The transaction picker API is similar to the photo picker API and is used for selecting financial transactions.
- It is straightforward to present and use, making it ideal for apps that need selective access to financial data.
- For more information, see the session Meet FinanceKit.
Relevant Sessions
These sessions provide comprehensive insights into the new picker APIs and their usage in SwiftUI.

What’s new in AppKit
Discover the latest advances in Mac app development. Get an overview of the new features in macOS Sequoia, and how to adopt them in your app. Explore new ways to integrate your existing code with SwiftUI. Learn about the improvements made to numerous AppKit controls, like toolbars, menus, text input, and more.

SwiftUI essentials
Join us on a tour of SwiftUI, Apple’s declarative user interface framework. Learn essential concepts for building apps in SwiftUI, like views, state variables, and layout. Discover the breadth of APIs for building fully featured experiences and crafting unique custom components. Whether you’re brand new to SwiftUI or an experienced developer, you’ll learn how to take advantage of what SwiftUI has to offer when building great apps.

What’s new in StoreKit and In-App Purchase
Learn how to build and deliver even better purchase experiences using the App Store In-App Purchase system. We’ll demo new StoreKit views control styles and new APIs to improve your subscription customization, discuss new fields for transaction-level information, and explore new testability in Xcode. We’ll also review an important StoreKit deprecation.