Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
afd87ef
fix(tag): limit cached indices to each sublist
Kyle-Ye Oct 29, 2026
b7eac28
feat(layout): add vertical stack orientation support
Kyle-Ye Oct 29, 2026
5c923a3
fix(list): match generic and concrete list style contexts
Kyle-Ye Oct 29, 2026
7d4ecbf
feat(view): add selectionDisabled modifier
Kyle-Ye Oct 29, 2026
c1bfce7
feat(picker): add Picker view
Kyle-Ye Oct 29, 2026
2d8dfc6
feat(picker): add PickerOption
Kyle-Ye Oct 29, 2026
c2f7c75
feat(data): add NestedDynamicProperties
Kyle-Ye Oct 29, 2026
2c68f8a
feat(picker): add PickerContent and PickerBuilder
Kyle-Ye Oct 29, 2026
6c4d3a1
feat(tag): add variadic child tag accessors
Kyle-Ye Oct 31, 2026
631291f
feat(picker): add picker style infrastructure
Kyle-Ye Oct 31, 2026
8208d46
feat(picker): implement default picker style
Kyle-Ye Nov 1, 2026
2a7973d
feat(search): add search suggestions input flag
Kyle-Ye Nov 24, 2026
d2469f0
feat(accessibility): add child behavior modifiers and radio group acc…
Kyle-Ye Nov 24, 2026
9f37c3e
build: add the tvOS 17 availability macro
Kyle-Ye Nov 25, 2026
d31b1a1
feat(picker): add menu picker style entry points and option sections
Kyle-Ye Nov 25, 2026
f542ebc
feat: add section picker style
Kyle-Ye Nov 25, 2026
9334eb2
feat: add inline picker style
Kyle-Ye Nov 25, 2026
4ce698a
chore: fix default picker style
Kyle-Ye Nov 25, 2026
07f0c4d
feat: add PaletteSelectionEffect
Kyle-Ye Nov 25, 2026
c305a58
feat(picker): implement menu picker style routing
Kyle-Ye Nov 25, 2026
d409ed6
refactor(button): share requiring(buttonStyle:) across controls
Kyle-Ye Nov 25, 2026
f8530ac
feat(picker): select macOS toolbar picker styles by placement
Kyle-Ye Nov 25, 2026
b5a1d2f
feat(picker): add list menu picker style stub
Kyle-Ye Nov 25, 2026
2c208d9
feat(picker): add documented navigation link picker style stub
Kyle-Ye Nov 25, 2026
005f9a3
feat(picker): render picker options and current value labels
Kyle-Ye Nov 25, 2026
56ced87
feat(picker): implement macOS accessory bar picker styles
Kyle-Ye Nov 28, 2026
969a9b4
feat(button): implement macOS accessory bar button styles
Kyle-Ye Nov 28, 2026
50dc9db
feat(button): implement radio option buttons
Kyle-Ye Nov 28, 2026
0d0d37e
feat(picker): implement macOS radio group picker style
Kyle-Ye Nov 28, 2026
98aa920
feat(picker): implement palette picker style
Kyle-Ye Nov 28, 2026
a40be2f
feat(button): implement platform item list button style
Kyle-Ye Nov 28, 2026
57c69c8
feat(menu): implement menu action dismiss behavior
Kyle-Ye Nov 28, 2026
55d663d
feat(menu): implement menu title modifiers
Kyle-Ye Nov 28, 2026
b8d929a
feat(menu): extract public Menu stub for pickers
Kyle-Ye Nov 28, 2026
a0bb061
feat(picker): add type-erased segmented control style
Kyle-Ye Nov 28, 2026
3477b11
feat(picker): add segmented control style environment
Kyle-Ye Nov 28, 2026
c457120
feat(picker): implement wheel picker style
Kyle-Ye Nov 28, 2026
b52743a
feat(picker): implement segmented picker style and native controls
Kyle-Ye Nov 28, 2026
5661209
fix(view): correct hidden modifier graph inputs
Kyle-Ye Nov 28, 2026
d4f6039
feat(view): implement platform item list labels
Kyle-Ye Nov 28, 2026
55cc479
build: add the tvOS 16 availability macro
Kyle-Ye Nov 28, 2026
8fc4a8d
feat(form): implement columnar labeled content style
Kyle-Ye Nov 28, 2026
d1f03fc
fix(picker): use fillEqually segment distribution on macOS
Kyle-Ye Nov 28, 2026
f1a6340
test(picker): add picker examples and UI snapshot tests
Kyle-Ye Nov 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Configurations/Shared/basic/OpenSwiftUI.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ GCC_PREPROCESSOR_DEFINITIONS_OPENSWIFTUI = OPENSWIFTUI=1

SWIFT_ACTIVE_COMPILATION_CONDITIONS_OPENSWIFTUI = OPENSWIFTUI

OPENSWIFTUI_AVAILABILITY_MACRO = "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v1_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v1_4:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v2_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_iOS_v2_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_macOS_v2_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v2_1:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v2_3:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v3_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_iOS_v3_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_macOS_v3_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v3_2:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v3_4:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v4_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_iOS_v4_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_watchOS_v4_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v4_1:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v4_4:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_1:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_2:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_4:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_5:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v6_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v7_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v8_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0"
OPENSWIFTUI_AVAILABILITY_MACRO = "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v1_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v1_4:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v2_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_iOS_v2_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_macOS_v2_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v2_1:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v2_3:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v3_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_iOS_v3_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_macOS_v3_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v3_2:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v3_4:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v4_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_iOS_v4_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_tvOS_v4_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_watchOS_v4_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v4_1:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v4_4:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_tvOS_v5_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_1:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_2:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_4:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_5:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v6_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v7_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v8_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0"
2 changes: 1 addition & 1 deletion Configurations/Shared/basic/SwiftUI.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ OPENSWIFTUI_TARGET_BUNDLE_ID = SwiftUI

SWIFT_INCLUDE_PATHS = $(inherited) $(SRCROOT)/Modules/Platform/cocoa

OPENSWIFTUI_AVAILABILITY_MACRO = "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v1_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v1_4:iOS 13.4, macOS 10.15.4, tvOS 13.4, watchOS 6.2" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v2_0:iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_iOS_v2_0:iOS 14.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_macOS_v2_0:macOS 11.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v2_1:iOS 14.2, macOS 11.0, tvOS 14.1, watchOS 7.1" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v2_3:iOS 14.5, macOS 11.3, tvOS 14.5, watchOS 7.4" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v3_0:iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_iOS_v3_0:iOS 15.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_macOS_v3_0:macOS 12.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v3_2:iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v3_4:iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v4_0:iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_iOS_v4_0:iOS 16.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_watchOS_v4_0:watchOS 9.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v4_1:iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v4_4:iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_0:iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_1:iOS 17.1, macOS 14.1, tvOS 17.1, watchOS 10.1, visionOS 1.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_2:iOS 17.2, macOS 14.2, tvOS 17.2, watchOS 10.2, visionOS 1.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_4:iOS 17.4, macOS 14.4, tvOS 17.4, watchOS 10.4, visionOS 1.1" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_5:iOS 17.5, macOS 14.5, tvOS 17.5, watchOS 10.5, visionOS 1.2" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v6_0:iOS 18.0, macOS 15.0, tvOS 18.0, watchOS 11.0, visionOS 2.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v7_0:iOS 26.0, macOS 26.0, tvOS 26.0, watchOS 26.0, visionOS 26.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v8_0:iOS 27.0, macOS 27.0, tvOS 27.0, watchOS 27.0, visionOS 27.0"
OPENSWIFTUI_AVAILABILITY_MACRO = "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v1_0:iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v1_4:iOS 13.4, macOS 10.15.4, tvOS 13.4, watchOS 6.2" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v2_0:iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_iOS_v2_0:iOS 14.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_macOS_v2_0:macOS 11.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v2_1:iOS 14.2, macOS 11.0, tvOS 14.1, watchOS 7.1" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v2_3:iOS 14.5, macOS 11.3, tvOS 14.5, watchOS 7.4" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v3_0:iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_iOS_v3_0:iOS 15.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_macOS_v3_0:macOS 12.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v3_2:iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v3_4:iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v4_0:iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_iOS_v4_0:iOS 16.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_tvOS_v4_0:tvOS 16.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_watchOS_v4_0:watchOS 9.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v4_1:iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v4_4:iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_0:iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_tvOS_v5_0:tvOS 17.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_1:iOS 17.1, macOS 14.1, tvOS 17.1, watchOS 10.1, visionOS 1.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_2:iOS 17.2, macOS 14.2, tvOS 17.2, watchOS 10.2, visionOS 1.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_4:iOS 17.4, macOS 14.4, tvOS 17.4, watchOS 10.4, visionOS 1.1" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v5_5:iOS 17.5, macOS 14.5, tvOS 17.5, watchOS 10.5, visionOS 1.2" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v6_0:iOS 18.0, macOS 15.0, tvOS 18.0, watchOS 11.0, visionOS 2.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v7_0:iOS 26.0, macOS 26.0, tvOS 26.0, watchOS 26.0, visionOS 26.0" "-Xfrontend" "-enable-experimental-feature" "-Xfrontend" "AvailabilityMacro=OpenSwiftUI_v8_0:iOS 27.0, macOS 27.0, tvOS 27.0, watchOS 27.0, visionOS 27.0"
92 changes: 92 additions & 0 deletions Example/Shared/View/PickerExample.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
//
// PickerExample.swift
// Shared

#if OPENSWIFTUI
import OpenSwiftUI
#else
import SwiftUI
#endif

struct PickerExample: View {
@State private var selection: Color

init(selection: Color = .green) {
_selection = State(initialValue: selection)
}

var body: some View {
VStack(spacing: 12) {
Picker("Favorite color", selection: $selection) {
Text("Red").tag(Color.red)
Text("Green").tag(Color.green)
Text("Blue").tag(Color.blue)
}
selection.frame(height: 16)
}
.padding()
}
}

struct ReactionPaletteExample: View {
private enum Reaction {
case thumbsUp, thumbsDown, heart
}

@State private var selection: Reaction? = .heart

var body: some View {
Picker("Reaction", selection: $selection) {
Label("Thumbs up", systemImage: "hand.thumbsup").tag(Reaction.thumbsUp)
Label("Thumbs down", systemImage: "hand.thumbsdown").tag(Reaction.thumbsDown)
Label("Love", systemImage: "heart").tag(Reaction.heart)
}
.pickerStyle(.palette)
}
}

#Preview("Automatic") {
PickerExample().pickerStyle(.automatic)
}

#Preview("Inline") {
PickerExample().pickerStyle(.inline)
}

#Preview("Menu") {
PickerExample().pickerStyle(.menu)
}

#Preview("Segmented") {
PickerExample().pickerStyle(.segmented)
}

#Preview("Palette in a menu") {
Menu("Reactions") {
ReactionPaletteExample()
}
}

#Preview("Palette outside a menu") {
ReactionPaletteExample().padding()
}

#if os(macOS)
struct RadioGroupPickerExample: View {
var body: some View {
VStack(spacing: 0) {
PickerExample()
PickerExample(selection: .blue).horizontalRadioGroupLayout()
}
.pickerStyle(.radioGroup)
}
}

#Preview("Radio group") {
RadioGroupPickerExample()
}
#elseif os(iOS) || os(visionOS)
#Preview("Wheel") {
PickerExample(selection: .blue).pickerStyle(.wheel)
}
#endif
88 changes: 88 additions & 0 deletions Example/Tests/OpenSwiftUIUITests/View/PickerUITests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
//
// PickerUITests.swift
// OpenSwiftUIUITests

import SnapshotTesting
import Testing
@testable import TestingHost

@MainActor
@Suite(.snapshots(record: .never, diffTool: diffTool))
struct PickerUITests {
enum PopUpStyle: String, CaseIterable {
case automatic, menu
}

@Test(arguments: PopUpStyle.allCases)
func popUpSelection(style: PopUpStyle) {
let example = PickerExample(selection: .blue)
@ViewBuilder var picker: some View {
switch style {
case .automatic: example.pickerStyle(.automatic)
case .menu: example.pickerStyle(.menu)
}
}

withKnownIssue("PopUpButton currently renders EmptyView.") {
openSwiftUIAssertSnapshot(
of: picker,
size: .init(width: 320, height: 100),
named: style.rawValue
)
} when: {
#if OPENSWIFTUI
true
#else
false
#endif
} matching: { issue in
issue.comments.contains { $0.rawValue.contains("does not match reference.") }
}
}

@Test
func inlineOptions() {
openSwiftUIAssertSnapshot(
of: PickerExample().pickerStyle(.inline),
size: .init(width: 320, height: 280)
)
}

@Test
func segmentedSelections() {
openSwiftUIAssertSnapshot(
of: VStack(spacing: 0) {
PickerExample(selection: .red)
PickerExample(selection: .blue)
}
.pickerStyle(.segmented),
size: .init(width: 320, height: 180)
)
}

@Test
func paletteOutsideMenu() {
openSwiftUIAssertSnapshot(
of: ReactionPaletteExample().padding(),
size: .init(width: 320, height: 100)
)
}

#if os(macOS)
@Test
func radioGroupLayouts() {
openSwiftUIAssertSnapshot(
of: RadioGroupPickerExample(),
size: .init(width: 360, height: 240)
)
}
#elseif os(iOS) || os(visionOS)
@Test
func wheelSelection() {
openSwiftUIAssertSnapshot(
of: PickerExample(selection: .blue).pickerStyle(.wheel),
size: .init(width: 320, height: 280)
)
}
#endif
}
4 changes: 2 additions & 2 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading