diff --git a/Examples/Showcase/Showcase/AppView.swift b/Examples/Showcase/Showcase/AppView.swift index 93857b46..df4251c2 100644 --- a/Examples/Showcase/Showcase/AppView.swift +++ b/Examples/Showcase/Showcase/AppView.swift @@ -7,12 +7,12 @@ struct AppView: View { #if os(iOS) || os(tvOS) || os(visionOS) .introspect( .window, - on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) + on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) ) { window in window.backgroundColor = .brown } #elseif os(macOS) - .introspect(.window, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { window in + .introspect(.window, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { window in window.backgroundColor = .lightGray } #endif @@ -46,7 +46,7 @@ struct ContentView: View { .tag(5) } #if os(iOS) || os(tvOS) - .introspect(.tabView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { tabBarController in + .introspect(.tabView, on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26)) { tabBarController in if #available(iOS 26, macOS 26, tvOS 26, *) { tabBarController.tabBar.backgroundColor = .green } else { @@ -58,7 +58,7 @@ struct ContentView: View { } } #elseif os(macOS) - .introspect(.tabView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14)) { splitView in + .introspect(.tabView, on: .macOS(.v12, .v13, .v14)) { splitView in splitView.subviews.first?.layer?.backgroundColor = NSColor.green.cgColor } #endif diff --git a/Examples/Showcase/Showcase/Controls.swift b/Examples/Showcase/Showcase/Controls.swift index e209b957..1a8ec5c1 100644 --- a/Examples/Showcase/Showcase/Controls.swift +++ b/Examples/Showcase/Showcase/Controls.swift @@ -16,12 +16,12 @@ struct ControlsShowcase: View { #if os(iOS) || os(tvOS) || os(visionOS) .introspect( .textField, - on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) + on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) ) { textField in textField.backgroundColor = .red } #elseif os(macOS) - .introspect(.textField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { textField in + .introspect(.textField, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { textField in textField.backgroundColor = .red } #endif @@ -31,12 +31,12 @@ struct ControlsShowcase: View { #if os(iOS) || os(tvOS) || os(visionOS) .introspect( .textField, - on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) + on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) ) { textField in textField.backgroundColor = .green } #elseif os(macOS) - .introspect(.textField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { textField in + .introspect(.textField, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { textField in textField.backgroundColor = .green } #endif @@ -49,12 +49,12 @@ struct ControlsShowcase: View { #if os(iOS) .introspect( .toggle, - on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26) + on: .iOS(.v15, .v16, .v17, .v18, .v26) ) { toggle in toggle.backgroundColor = .red } #elseif os(macOS) - .introspect(.toggle, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { toggle in + .introspect(.toggle, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { toggle in toggle.layer?.backgroundColor = NSColor.red.cgColor } #endif @@ -63,12 +63,12 @@ struct ControlsShowcase: View { #if os(iOS) .introspect( .toggle, - on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26) + on: .iOS(.v15, .v16, .v17, .v18, .v26) ) { toggle in toggle.backgroundColor = .green } #elseif os(macOS) - .introspect(.toggle, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { toggle in + .introspect(.toggle, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { toggle in toggle.layer?.backgroundColor = NSColor.green.cgColor } #endif @@ -77,22 +77,22 @@ struct ControlsShowcase: View { HStack { Slider(value: $sliderValue, in: 0...100) #if os(iOS) - .introspect(.slider, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { slider in + .introspect(.slider, on: .iOS(.v15, .v16, .v17, .v18, .v26)) { slider in slider.backgroundColor = .red } #elseif os(macOS) - .introspect(.slider, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { slider in + .introspect(.slider, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { slider in slider.layer?.backgroundColor = NSColor.red.cgColor } #endif Slider(value: $sliderValue, in: 0...100) #if os(iOS) - .introspect(.slider, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { slider in + .introspect(.slider, on: .iOS(.v15, .v16, .v17, .v18, .v26)) { slider in slider.backgroundColor = .green } #elseif os(macOS) - .introspect(.slider, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { slider in + .introspect(.slider, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { slider in slider.layer?.backgroundColor = NSColor.green.cgColor } #endif @@ -103,11 +103,11 @@ struct ControlsShowcase: View { Text("Stepper Red") } #if os(iOS) - .introspect(.stepper, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { stepper in + .introspect(.stepper, on: .iOS(.v15, .v16, .v17, .v18, .v26)) { stepper in stepper.backgroundColor = .red } #elseif os(macOS) - .introspect(.stepper, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { stepper in + .introspect(.stepper, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { stepper in stepper.layer?.backgroundColor = NSColor.red.cgColor } #endif @@ -116,11 +116,11 @@ struct ControlsShowcase: View { Text("Stepper Green") } #if os(iOS) - .introspect(.stepper, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { stepper in + .introspect(.stepper, on: .iOS(.v15, .v16, .v17, .v18, .v26)) { stepper in stepper.backgroundColor = .green } #elseif os(macOS) - .introspect(.stepper, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { stepper in + .introspect(.stepper, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { stepper in stepper.layer?.backgroundColor = NSColor.green.cgColor } #endif @@ -132,11 +132,11 @@ struct ControlsShowcase: View { Text("DatePicker Red") } #if os(iOS) || os(visionOS) - .introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { datePicker in + .introspect(.datePicker, on: .iOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { datePicker in datePicker.backgroundColor = .red } #elseif os(macOS) - .introspect(.datePicker, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { datePicker in + .introspect(.datePicker, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { datePicker in datePicker.layer?.backgroundColor = NSColor.red.cgColor } #endif @@ -153,12 +153,12 @@ struct ControlsShowcase: View { #if os(iOS) || os(tvOS) || os(visionOS) .introspect( .picker(style: .segmented), - on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) + on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) ) { datePicker in datePicker.backgroundColor = .red } #elseif os(macOS) - .introspect(.picker(style: .segmented), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { datePicker in + .introspect(.picker(style: .segmented), on: .macOS(.v12, .v13, .v14, .v15, .v26)) { datePicker in datePicker.layer?.backgroundColor = NSColor.red.cgColor } #endif diff --git a/Examples/Showcase/Showcase/List.swift b/Examples/Showcase/Showcase/List.swift index 68770248..40887766 100644 --- a/Examples/Showcase/Showcase/List.swift +++ b/Examples/Showcase/Showcase/List.swift @@ -43,7 +43,7 @@ struct ListShowcase: View { } } #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { tableView in + .introspect(.list, on: .iOS(.v15), .tvOS(.v15, .v16, .v17, .v18, .v26)) { tableView in tableView.backgroundView = UIView() tableView.backgroundColor = .cyan } @@ -53,7 +53,7 @@ struct ListShowcase: View { } } #elseif os(macOS) - .introspect(.list, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { tableView in + .introspect(.list, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { tableView in DispatchQueue.main.async { receiverListFound = true } @@ -71,7 +71,7 @@ struct ListShowcase: View { Text("Item 1") Text("Item 2") #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor) { tableView in + .introspect(.list, on: .iOS(.v15), .tvOS(.v15, .v16, .v17, .v18, .v26), scope: .ancestor) { tableView in tableView.backgroundView = UIView() tableView.backgroundColor = .cyan } @@ -81,7 +81,7 @@ struct ListShowcase: View { } } #elseif os(macOS) - .introspect(.list, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor) { tableView in + .introspect(.list, on: .macOS(.v12, .v13, .v14, .v15, .v26), scope: .ancestor) { tableView in DispatchQueue.main.async { ancestorListFound = true } diff --git a/Examples/Showcase/Showcase/Navigation.swift b/Examples/Showcase/Showcase/Navigation.swift index d7040d41..20dab1c3 100644 --- a/Examples/Showcase/Showcase/Navigation.swift +++ b/Examples/Showcase/Showcase/Navigation.swift @@ -5,13 +5,7 @@ struct NavigationShowcase: View { var body: some View { NavigationView { Text("Content") - .modifier { - if #available(iOS 15, tvOS 15, macOS 12, *) { - $0.searchable(text: .constant("")) - } else { - $0 - } - } + .searchable(text: .constant("")) #if os(iOS) || os(visionOS) .navigationBarTitle(Text("Customized"), displayMode: .inline) #elseif os(macOS) @@ -21,13 +15,13 @@ struct NavigationShowcase: View { #if os(iOS) || os(tvOS) || os(visionOS) .introspect( .navigationView(style: .stack), - on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) + on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) ) { navigationController in navigationController.navigationBar.backgroundColor = .cyan } .introspect( .navigationView(style: .columns), - on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) + on: .iOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) ) { splitViewController in #if os(visionOS) splitViewController.preferredDisplayMode = .oneBesideSecondary @@ -35,7 +29,7 @@ struct NavigationShowcase: View { splitViewController.preferredDisplayMode = .oneOverSecondary #endif } - .introspect(.navigationView(style: .columns), on: .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { navigationController in + .introspect(.navigationView(style: .columns), on: .tvOS(.v15, .v16, .v17, .v18, .v26)) { navigationController in navigationController.navigationBar.backgroundColor = .cyan } .introspect( diff --git a/Examples/Showcase/Showcase/Presentation.swift b/Examples/Showcase/Showcase/Presentation.swift index dac0799a..db830197 100644 --- a/Examples/Showcase/Showcase/Presentation.swift +++ b/Examples/Showcase/Showcase/Presentation.swift @@ -15,7 +15,7 @@ struct PresentationShowcase: View { #if os(iOS) || os(tvOS) .introspect( .sheet, - on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26) + on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26) ) { presentationController in presentationController.containerView?.backgroundColor = .red.withAlphaComponent(0.75) } @@ -26,20 +26,18 @@ struct PresentationShowcase: View { #endif } - if #available(iOS 14, tvOS 14, *) { - Button("Full Screen Cover", action: { isFullScreenPresented = true }) - .fullScreenCover(isPresented: $isFullScreenPresented) { - Button("Dismiss", action: { isFullScreenPresented = false }) - #if os(iOS) || os(tvOS) || os(visionOS) - .introspect( - .fullScreenCover, - on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) - ) { presentationController in - presentationController.containerView?.backgroundColor = .red.withAlphaComponent(0.75) - } - #endif - } - } + Button("Full Screen Cover", action: { isFullScreenPresented = true }) + .fullScreenCover(isPresented: $isFullScreenPresented) { + Button("Dismiss", action: { isFullScreenPresented = false }) + #if os(iOS) || os(tvOS) || os(visionOS) + .introspect( + .fullScreenCover, + on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) + ) { presentationController in + presentationController.containerView?.backgroundColor = .red.withAlphaComponent(0.75) + } + #endif + } #if os(iOS) || os(visionOS) Button("Popover", action: { isPopoverPresented = true }) @@ -48,7 +46,7 @@ struct PresentationShowcase: View { .padding() .introspect( .popover, - on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) + on: .iOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) ) { presentationController in presentationController.containerView?.backgroundColor = .red.withAlphaComponent(0.75) } diff --git a/Examples/Showcase/Showcase/ScrollView.swift b/Examples/Showcase/Showcase/ScrollView.swift index 108c5f3b..185ba955 100644 --- a/Examples/Showcase/Showcase/ScrollView.swift +++ b/Examples/Showcase/Showcase/ScrollView.swift @@ -31,14 +31,14 @@ struct ScrollViewShowcase: View { #if os(iOS) || os(tvOS) || os(visionOS) .introspect( .scrollView, - on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) + on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) ) { _ in DispatchQueue.main.async { receiverScrollViewFound = true } } #elseif os(macOS) - .introspect(.scrollView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { scrollView in + .introspect(.scrollView, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { scrollView in DispatchQueue.main.async { receiverScrollViewFound = true } @@ -55,7 +55,7 @@ struct ScrollViewShowcase: View { #if os(iOS) || os(tvOS) || os(visionOS) .introspect( .scrollView, - on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), + on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor ) { _ in DispatchQueue.main.async { @@ -63,7 +63,7 @@ struct ScrollViewShowcase: View { } } #elseif os(macOS) - .introspect(.scrollView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor) { scrollView in + .introspect(.scrollView, on: .macOS(.v12, .v13, .v14, .v15, .v26), scope: .ancestor) { scrollView in DispatchQueue.main.async { ancestorScrollViewFound = true } diff --git a/Examples/Showcase/Showcase/UIViewRepresentable.swift b/Examples/Showcase/Showcase/UIViewRepresentable.swift index c5b43255..54bff09b 100644 --- a/Examples/Showcase/Showcase/UIViewRepresentable.swift +++ b/Examples/Showcase/Showcase/UIViewRepresentable.swift @@ -11,12 +11,12 @@ struct UIViewRepresentableShowcase: View { #if os(iOS) || os(tvOS) || os(visionOS) .introspect( .view, - on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) + on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) ) { view in view.backgroundColor = UIColor(color) } #elseif os(macOS) - .introspect(.view, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { view in + .introspect(.view, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { view in view.layer?.backgroundColor = NSColor(color).cgColor } #endif @@ -26,12 +26,12 @@ struct UIViewRepresentableShowcase: View { #if os(iOS) || os(tvOS) || os(visionOS) .introspect( .view, - on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) + on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26) ) { view in view.backgroundColor = .red } #elseif os(macOS) - .introspect(.view, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { view in + .introspect(.view, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { view in view.layer?.backgroundColor = NSColor.red.cgColor } #endif