diff --git a/Package.swift b/Package.swift index f7084dbd..a31ff59d 100644 --- a/Package.swift +++ b/Package.swift @@ -21,3 +21,11 @@ let package = Package( ), ] ) + +for target in package.targets { + target.swiftSettings = target.swiftSettings ?? [] + target.swiftSettings? += [ + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("InternalImportsByDefault"), + ] +} diff --git a/Sources/Introspect.swift b/Sources/Introspect.swift index 8935b4d4..3adf8ddf 100644 --- a/Sources/Introspect.swift +++ b/Sources/Introspect.swift @@ -1,5 +1,5 @@ #if !os(watchOS) -import SwiftUI +public import SwiftUI /// The scope of introspection i.e. where introspect should look to find /// the desired target view relative to the applied `.introspect(...)` diff --git a/Sources/PlatformView.swift b/Sources/PlatformView.swift index 11bc6f30..f6f0c6bc 100644 --- a/Sources/PlatformView.swift +++ b/Sources/PlatformView.swift @@ -1,5 +1,5 @@ #if !os(watchOS) -import SwiftUI +public import SwiftUI #if canImport(UIKit) public typealias PlatformView = UIView diff --git a/Sources/ViewTypes/Button.swift b/Sources/ViewTypes/Button.swift index 1303f55e..dda84a0c 100644 --- a/Sources/ViewTypes/Button.swift +++ b/Sources/ViewTypes/Button.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `Button` type in SwiftUI. /// /// ### iOS @@ -35,6 +33,8 @@ extension IntrospectableViewType where Self == ButtonType { } #if canImport(AppKit) && !targetEnvironment(macCatalyst) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/ColorPicker.swift b/Sources/ViewTypes/ColorPicker.swift index b1c2626d..cfb3e7f0 100644 --- a/Sources/ViewTypes/ColorPicker.swift +++ b/Sources/ViewTypes/ColorPicker.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `ColorPicker` type in SwiftUI. /// /// ### iOS @@ -59,6 +57,8 @@ extension IntrospectableViewType where Self == ColorPickerType { } #if canImport(UIKit) +public import UIKit + @available(iOS 14, *) extension iOSViewVersion { @available(*, unavailable, message: "ColorPicker isn't available on iOS 13") @@ -78,6 +78,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + @available(macOS 11, *) extension macOSViewVersion { @available(*, unavailable, message: "ColorPicker isn't available on macOS 10.15") diff --git a/Sources/ViewTypes/DatePicker.swift b/Sources/ViewTypes/DatePicker.swift index f2a6580f..271f1687 100644 --- a/Sources/ViewTypes/DatePicker.swift +++ b/Sources/ViewTypes/DatePicker.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `DatePicker` type in SwiftUI. /// /// ### iOS @@ -57,6 +55,8 @@ extension IntrospectableViewType where Self == DatePickerType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) @@ -73,6 +73,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/DatePickerWithCompactStyle.swift b/Sources/ViewTypes/DatePickerWithCompactStyle.swift index 891b306f..d468c30c 100644 --- a/Sources/ViewTypes/DatePickerWithCompactStyle.swift +++ b/Sources/ViewTypes/DatePickerWithCompactStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `DatePicker` type in SwiftUI, with `.compact` style. /// /// ### iOS @@ -66,6 +64,8 @@ extension IntrospectableViewType where Self == DatePickerWithCompactStyleType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: ".datePickerStyle(.compact) isn't available on iOS 13") public static let v13 = Self.unavailable() @@ -83,6 +83,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) && !targetEnvironment(macCatalyst) +public import AppKit + extension macOSViewVersion { @available(*, unavailable, message: ".datePickerStyle(.compact) isn't available on macOS 10.15") public static let v10_15 = Self.unavailable() diff --git a/Sources/ViewTypes/DatePickerWithFieldStyle.swift b/Sources/ViewTypes/DatePickerWithFieldStyle.swift index ad465f69..7461fbba 100644 --- a/Sources/ViewTypes/DatePickerWithFieldStyle.swift +++ b/Sources/ViewTypes/DatePickerWithFieldStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `DatePicker` type in SwiftUI, with `.field` style. /// /// ### iOS @@ -42,6 +40,8 @@ extension IntrospectableViewType where Self == DatePickerWithFieldStyleType { } #if canImport(AppKit) && !targetEnvironment(macCatalyst) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/DatePickerWithGraphicalStyle.swift b/Sources/ViewTypes/DatePickerWithGraphicalStyle.swift index e21a8dbd..d9deb75b 100644 --- a/Sources/ViewTypes/DatePickerWithGraphicalStyle.swift +++ b/Sources/ViewTypes/DatePickerWithGraphicalStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `DatePicker` type in SwiftUI, with `.graphical` style. /// /// ### iOS @@ -66,6 +64,8 @@ extension IntrospectableViewType where Self == DatePickerWithGraphicalStyleType } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: ".datePickerStyle(.graphical) isn't available on iOS 13") public static let v13 = Self(for: .v13) @@ -83,6 +83,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) && !targetEnvironment(macCatalyst) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/DatePickerWithStepperFieldStyle.swift b/Sources/ViewTypes/DatePickerWithStepperFieldStyle.swift index 4712ba85..0c9cb709 100644 --- a/Sources/ViewTypes/DatePickerWithStepperFieldStyle.swift +++ b/Sources/ViewTypes/DatePickerWithStepperFieldStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `DatePicker` type in SwiftUI, with `.stepperField` style. /// /// ### iOS @@ -42,6 +40,8 @@ extension IntrospectableViewType where Self == DatePickerWithStepperFieldStyleTy } #if canImport(AppKit) && !targetEnvironment(macCatalyst) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/DatePickerWithWheelStyle.swift b/Sources/ViewTypes/DatePickerWithWheelStyle.swift index 3968ff7b..ac5746bc 100644 --- a/Sources/ViewTypes/DatePickerWithWheelStyle.swift +++ b/Sources/ViewTypes/DatePickerWithWheelStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `DatePicker` type in SwiftUI, with `.wheel` style. /// /// ### iOS @@ -54,6 +52,8 @@ extension IntrospectableViewType where Self == DatePickerWithWheelStyleType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) diff --git a/Sources/ViewTypes/Form.swift b/Sources/ViewTypes/Form.swift index 10623953..f7786e7a 100644 --- a/Sources/ViewTypes/Form.swift +++ b/Sources/ViewTypes/Form.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `Form` type in SwiftUI. /// /// ### iOS @@ -68,6 +66,8 @@ extension IntrospectableViewType where Self == FormType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) diff --git a/Sources/ViewTypes/FormWithGroupedStyle.swift b/Sources/ViewTypes/FormWithGroupedStyle.swift index 2a1e7323..2d2b1913 100644 --- a/Sources/ViewTypes/FormWithGroupedStyle.swift +++ b/Sources/ViewTypes/FormWithGroupedStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `Form` type in SwiftUI, with `.grouped` style. /// /// ### iOS @@ -85,6 +83,8 @@ extension IntrospectableViewType where Self == FormWithGroupedStyleType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: ".formStyle(.grouped) isn't available on iOS 13") public static let v13 = Self.unavailable() @@ -120,6 +120,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { @available(*, unavailable, message: ".formStyle(.grouped) isn't available on macOS 10.15") public static let v10_15 = Self.unavailable() diff --git a/Sources/ViewTypes/FullScreenCover.swift b/Sources/ViewTypes/FullScreenCover.swift index 53925c3e..5b2351df 100644 --- a/Sources/ViewTypes/FullScreenCover.swift +++ b/Sources/ViewTypes/FullScreenCover.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of `.fullScreenCover` in SwiftUI. /// /// ### iOS @@ -70,6 +68,8 @@ extension IntrospectableViewType where Self == FullScreenCoverType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: ".fullScreenCover isn't available on iOS 13") public static let v13 = Self.unavailable() diff --git a/Sources/ViewTypes/List.swift b/Sources/ViewTypes/List.swift index a3ae9f6c..1c1e6112 100644 --- a/Sources/ViewTypes/List.swift +++ b/Sources/ViewTypes/List.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `List` type in SwiftUI. /// /// ### iOS @@ -85,6 +83,8 @@ extension IntrospectableViewType where Self == ListType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) @@ -114,6 +114,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/ListCell.swift b/Sources/ViewTypes/ListCell.swift index 70c28f9d..0d8229e3 100644 --- a/Sources/ViewTypes/ListCell.swift +++ b/Sources/ViewTypes/ListCell.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of a `List` cell type in SwiftUI. /// /// ### iOS @@ -82,6 +80,8 @@ extension IntrospectableViewType where Self == ListCellType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) @@ -111,6 +111,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/ListWithBorderedStyle.swift b/Sources/ViewTypes/ListWithBorderedStyle.swift index c14eee91..d909ded6 100644 --- a/Sources/ViewTypes/ListWithBorderedStyle.swift +++ b/Sources/ViewTypes/ListWithBorderedStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `List` type in SwiftUI, with `.bordered` style. /// /// ### iOS @@ -44,6 +42,8 @@ extension IntrospectableViewType where Self == ListWithBorderedStyleType { } #if canImport(AppKit) && !targetEnvironment(macCatalyst) +public import AppKit + extension macOSViewVersion { @available(*, unavailable, message: ".listStyle(.insetGrouped) isn't available on macOS 10.15") public static let v10_15 = Self.unavailable() diff --git a/Sources/ViewTypes/ListWithGroupedStyle.swift b/Sources/ViewTypes/ListWithGroupedStyle.swift index cecb6071..1c4f7725 100644 --- a/Sources/ViewTypes/ListWithGroupedStyle.swift +++ b/Sources/ViewTypes/ListWithGroupedStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `List` type in SwiftUI, with `.grouped` style. /// /// ### iOS @@ -75,6 +73,8 @@ extension IntrospectableViewType where Self == ListWithGroupedStyleType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) diff --git a/Sources/ViewTypes/ListWithInsetGroupedStyle.swift b/Sources/ViewTypes/ListWithInsetGroupedStyle.swift index 19fe700e..3d01a512 100644 --- a/Sources/ViewTypes/ListWithInsetGroupedStyle.swift +++ b/Sources/ViewTypes/ListWithInsetGroupedStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `List` type in SwiftUI, with `.insetGrouped` style. /// /// ### iOS @@ -61,6 +59,8 @@ extension IntrospectableViewType where Self == ListWithInsetGroupedStyleType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: ".listStyle(.insetGrouped) isn't available on iOS 13") public static let v13 = Self(for: .v13) diff --git a/Sources/ViewTypes/ListWithInsetStyle.swift b/Sources/ViewTypes/ListWithInsetStyle.swift index e76bbff5..a142c34e 100644 --- a/Sources/ViewTypes/ListWithInsetStyle.swift +++ b/Sources/ViewTypes/ListWithInsetStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `List` type in SwiftUI, with `.inset` style. /// /// ### iOS @@ -75,6 +73,8 @@ extension IntrospectableViewType where Self == ListWithInsetStyleType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: ".listStyle(.inset) isn't available on iOS 13") public static let v13 = Self.unavailable() @@ -95,6 +95,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { @available(*, unavailable, message: ".listStyle(.inset) isn't available on macOS 10.15") public static let v10_15 = Self.unavailable() diff --git a/Sources/ViewTypes/ListWithSidebarStyle.swift b/Sources/ViewTypes/ListWithSidebarStyle.swift index 47973905..e5951bdd 100644 --- a/Sources/ViewTypes/ListWithSidebarStyle.swift +++ b/Sources/ViewTypes/ListWithSidebarStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `List` type in SwiftUI, with `.sidebar` style. /// /// ### iOS @@ -75,6 +73,8 @@ extension IntrospectableViewType where Self == ListWithSidebarStyleType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: ".listStyle(.sidebar) isn't available on iOS 13") public static let v13 = Self.unavailable() @@ -95,6 +95,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/Map.swift b/Sources/ViewTypes/Map.swift index c24cabb6..39f80cea 100644 --- a/Sources/ViewTypes/Map.swift +++ b/Sources/ViewTypes/Map.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `Map` type in SwiftUI. /// /// ### iOS @@ -65,7 +63,7 @@ import SwiftUI public struct MapType: IntrospectableViewType {} #if canImport(MapKit) -import MapKit +public import MapKit extension IntrospectableViewType where Self == MapType { public static var map: Self { .init() } diff --git a/Sources/ViewTypes/NavigationSplitView.swift b/Sources/ViewTypes/NavigationSplitView.swift index 26182bfe..3efe3dd5 100644 --- a/Sources/ViewTypes/NavigationSplitView.swift +++ b/Sources/ViewTypes/NavigationSplitView.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `NavigationSplitView` type in SwiftUI. /// /// ### iOS @@ -77,6 +75,8 @@ extension IntrospectableViewType where Self == NavigationSplitViewType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: "NavigationSplitView isn't available on iOS 13") public static let v13 = Self.unavailable() @@ -125,6 +125,8 @@ extension visionOSViewVersion { } } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { @available(*, unavailable, message: "NavigationSplitView isn't available on macOS 10.15") public static let v10_15 = Self.unavailable() diff --git a/Sources/ViewTypes/NavigationStack.swift b/Sources/ViewTypes/NavigationStack.swift index 846cdefb..d18eba8c 100644 --- a/Sources/ViewTypes/NavigationStack.swift +++ b/Sources/ViewTypes/NavigationStack.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `NavigationStack` type in SwiftUI. /// /// ### iOS @@ -58,6 +56,8 @@ extension IntrospectableViewType where Self == NavigationStackType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: "NavigationStack isn't available on iOS 13") public static let v13 = Self.unavailable() diff --git a/Sources/ViewTypes/NavigationViewWithColumnsStyle.swift b/Sources/ViewTypes/NavigationViewWithColumnsStyle.swift index 389e4fac..9b681573 100644 --- a/Sources/ViewTypes/NavigationViewWithColumnsStyle.swift +++ b/Sources/ViewTypes/NavigationViewWithColumnsStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `NavigationView` type in SwiftUI, with `.columns` style. /// /// ### iOS @@ -77,6 +75,8 @@ extension IntrospectableViewType where Self == NavigationViewWithColumnsStyleTyp } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13, selector: selector) public static let v14 = Self(for: .v14, selector: selector) @@ -115,6 +115,8 @@ extension visionOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/NavigationViewWithStackStyle.swift b/Sources/ViewTypes/NavigationViewWithStackStyle.swift index 970b392f..7d888aab 100644 --- a/Sources/ViewTypes/NavigationViewWithStackStyle.swift +++ b/Sources/ViewTypes/NavigationViewWithStackStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `NavigationView` type in SwiftUI, with `.stack` style. /// /// ### iOS @@ -65,6 +63,8 @@ extension IntrospectableViewType where Self == NavigationViewWithStackStyleType } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13, selector: selector) public static let v14 = Self(for: .v14, selector: selector) diff --git a/Sources/ViewTypes/PageControl.swift b/Sources/ViewTypes/PageControl.swift index 6750e4d3..2d280aa8 100644 --- a/Sources/ViewTypes/PageControl.swift +++ b/Sources/ViewTypes/PageControl.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the page control type in SwiftUI. /// /// ### iOS @@ -64,6 +62,8 @@ extension IntrospectableViewType where Self == PageControlType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: ".tabViewStyle(.page) isn't available on iOS 13") public static let v13 = Self(for: .v13) diff --git a/Sources/ViewTypes/PickerWithMenuStyle.swift b/Sources/ViewTypes/PickerWithMenuStyle.swift index 388a8c5e..96ac5b4e 100644 --- a/Sources/ViewTypes/PickerWithMenuStyle.swift +++ b/Sources/ViewTypes/PickerWithMenuStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `Picker` type in SwiftUI, with `.menu` style. /// /// ### iOS @@ -46,6 +44,8 @@ extension IntrospectableViewType where Self == PickerWithMenuStyleType { } #if canImport(AppKit) && !targetEnvironment(macCatalyst) +public import AppKit + extension macOSViewVersion { @available(*, unavailable, message: ".pickerStyle(.menu) isn't available on macOS 10.15") public static let v10_15 = Self.unavailable() diff --git a/Sources/ViewTypes/PickerWithSegmentedStyle.swift b/Sources/ViewTypes/PickerWithSegmentedStyle.swift index be513511..f567693c 100644 --- a/Sources/ViewTypes/PickerWithSegmentedStyle.swift +++ b/Sources/ViewTypes/PickerWithSegmentedStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `Picker` type in SwiftUI, with `.segmented` style. /// /// ### iOS @@ -93,6 +91,8 @@ extension IntrospectableViewType where Self == PickerWithSegmentedStyleType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) @@ -119,6 +119,8 @@ extension visionOSViewVersion public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/PickerWithWheelStyle.swift b/Sources/ViewTypes/PickerWithWheelStyle.swift index 54a99bd8..34747584 100644 --- a/Sources/ViewTypes/PickerWithWheelStyle.swift +++ b/Sources/ViewTypes/PickerWithWheelStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `Picker` type in SwiftUI, with `.wheel` style. /// /// ### iOS @@ -62,6 +60,8 @@ extension IntrospectableViewType where Self == PickerWithWheelStyleType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) diff --git a/Sources/ViewTypes/Popover.swift b/Sources/ViewTypes/Popover.swift index 1ef12137..6204476a 100644 --- a/Sources/ViewTypes/Popover.swift +++ b/Sources/ViewTypes/Popover.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of `.popover` in SwiftUI. /// /// ### iOS @@ -56,6 +54,8 @@ extension IntrospectableViewType where Self == PopoverType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13, selector: selector) public static let v14 = Self(for: .v14, selector: selector) diff --git a/Sources/ViewTypes/ProgressViewWithCircularStyle.swift b/Sources/ViewTypes/ProgressViewWithCircularStyle.swift index b7301e43..168a075a 100644 --- a/Sources/ViewTypes/ProgressViewWithCircularStyle.swift +++ b/Sources/ViewTypes/ProgressViewWithCircularStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `ProgressView` type in SwiftUI, with `.circular` style. /// /// ### iOS @@ -69,6 +67,8 @@ extension IntrospectableViewType where Self == ProgressViewWithCircularStyleType } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: ".progressViewStyle(.circular) isn't available on iOS 13") public static let v13 = Self(for: .v13) @@ -97,6 +97,8 @@ extension visionOSViewVersion { @available(*, unavailable, message: ".progressViewStyle(.circular) isn't available on macOS 10.15") public static let v10_15 = Self(for: .v10_15) diff --git a/Sources/ViewTypes/ProgressViewWithLinearStyle.swift b/Sources/ViewTypes/ProgressViewWithLinearStyle.swift index 3617a8f5..2f20bfbd 100644 --- a/Sources/ViewTypes/ProgressViewWithLinearStyle.swift +++ b/Sources/ViewTypes/ProgressViewWithLinearStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `ProgressView` type in SwiftUI, with `.linear` style. /// /// ### iOS @@ -69,6 +67,8 @@ extension IntrospectableViewType where Self == ProgressViewWithLinearStyleType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: ".progressViewStyle(.linear) isn't available on iOS 13") public static let v13 = Self(for: .v13) @@ -97,6 +97,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { @available(*, unavailable, message: ".progressViewStyle(.linear) isn't available on macOS 10.15") public static let v10_15 = Self(for: .v10_15) diff --git a/Sources/ViewTypes/ScrollView.swift b/Sources/ViewTypes/ScrollView.swift index bb8a29d4..26d2c1fb 100644 --- a/Sources/ViewTypes/ScrollView.swift +++ b/Sources/ViewTypes/ScrollView.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `ScrollView` type in SwiftUI. /// /// ### iOS @@ -69,6 +67,8 @@ extension IntrospectableViewType where Self == ScrollViewType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) @@ -95,6 +95,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/SearchField.swift b/Sources/ViewTypes/SearchField.swift index 02ba40f4..e72ea079 100644 --- a/Sources/ViewTypes/SearchField.swift +++ b/Sources/ViewTypes/SearchField.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the search field displayed via the `.searchable` modifier in SwiftUI. /// /// ### iOS @@ -70,6 +68,8 @@ extension IntrospectableViewType where Self == SearchFieldType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: ".searchable isn't available on iOS 13") public static let v13 = Self.unavailable() diff --git a/Sources/ViewTypes/SecureField.swift b/Sources/ViewTypes/SecureField.swift index 53366f35..3a41247b 100644 --- a/Sources/ViewTypes/SecureField.swift +++ b/Sources/ViewTypes/SecureField.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `SecureField` type in SwiftUI. /// /// ### iOS @@ -69,6 +67,8 @@ extension IntrospectableViewType where Self == SecureFieldType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) @@ -95,6 +95,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/Sheet.swift b/Sources/ViewTypes/Sheet.swift index f9feea88..91600433 100644 --- a/Sources/ViewTypes/Sheet.swift +++ b/Sources/ViewTypes/Sheet.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of `.sheet` in SwiftUI. /// /// ### iOS @@ -70,6 +68,8 @@ extension IntrospectableViewType where Self == SheetType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13, selector: selector) public static let v14 = Self(for: .v14, selector: selector) diff --git a/Sources/ViewTypes/Slider.swift b/Sources/ViewTypes/Slider.swift index c0b7a0e5..d4691c68 100644 --- a/Sources/ViewTypes/Slider.swift +++ b/Sources/ViewTypes/Slider.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `Slider` type in SwiftUI. /// /// ### iOS @@ -48,6 +46,8 @@ extension IntrospectableViewType where Self == SliderType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) @@ -58,6 +58,8 @@ extension iOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/Stepper.swift b/Sources/ViewTypes/Stepper.swift index 5db0fed0..163d459f 100644 --- a/Sources/ViewTypes/Stepper.swift +++ b/Sources/ViewTypes/Stepper.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `Stepper` type in SwiftUI. /// /// ### iOS @@ -48,6 +46,8 @@ extension IntrospectableViewType where Self == StepperType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) @@ -58,6 +58,8 @@ extension iOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/TabView.swift b/Sources/ViewTypes/TabView.swift index 3108905c..6e739599 100644 --- a/Sources/ViewTypes/TabView.swift +++ b/Sources/ViewTypes/TabView.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `TabView` type in SwiftUI. /// /// ### iOS @@ -62,6 +60,8 @@ extension IntrospectableViewType where Self == TabViewType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13, selector: selector) public static let v14 = Self(for: .v14, selector: selector) @@ -92,6 +92,8 @@ extension tvOSViewVersion { } } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/TabViewWithPageStyle.swift b/Sources/ViewTypes/TabViewWithPageStyle.swift index 2e8c5bcf..0fbfacdf 100644 --- a/Sources/ViewTypes/TabViewWithPageStyle.swift +++ b/Sources/ViewTypes/TabViewWithPageStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `TabView` type in SwiftUI, with `.page` style. /// /// ### iOS @@ -69,6 +67,8 @@ extension IntrospectableViewType where Self == TabViewWithPageStyleType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: ".tabViewStyle(.page) isn't available on iOS 13") public static let v13 = Self.unavailable() diff --git a/Sources/ViewTypes/Table.swift b/Sources/ViewTypes/Table.swift index a439069a..52f6b090 100644 --- a/Sources/ViewTypes/Table.swift +++ b/Sources/ViewTypes/Table.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `Table` type in SwiftUI, with any style. /// /// ### iOS @@ -110,6 +108,8 @@ extension IntrospectableViewType where Self == TableType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: "Table isn't available on iOS 13") public static let v13 = Self(for: .v13) @@ -129,6 +129,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { @available(*, unavailable, message: "Table isn't available on macOS 10.15") public static let v10_15 = Self(for: .v10_15) diff --git a/Sources/ViewTypes/TextEditor.swift b/Sources/ViewTypes/TextEditor.swift index e8d54b3d..88a0cb53 100644 --- a/Sources/ViewTypes/TextEditor.swift +++ b/Sources/ViewTypes/TextEditor.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `TextEditor` type in SwiftUI. /// /// ### iOS @@ -59,6 +57,8 @@ extension IntrospectableViewType where Self == TextEditorType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: "TextEditor isn't available on iOS 13") public static let v13 = Self.unavailable() @@ -76,6 +76,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { @available(*, unavailable, message: "TextEditor isn't available on macOS 10.15") public static let v10_15 = Self.unavailable() diff --git a/Sources/ViewTypes/TextField.swift b/Sources/ViewTypes/TextField.swift index f6635df1..090e8aea 100644 --- a/Sources/ViewTypes/TextField.swift +++ b/Sources/ViewTypes/TextField.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `TextField` type in SwiftUI. /// /// ### iOS @@ -69,6 +67,8 @@ extension IntrospectableViewType where Self == TextFieldType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) @@ -95,6 +95,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/TextFieldWithVerticalAxis.swift b/Sources/ViewTypes/TextFieldWithVerticalAxis.swift index 70cc88c7..ae765a1c 100644 --- a/Sources/ViewTypes/TextFieldWithVerticalAxis.swift +++ b/Sources/ViewTypes/TextFieldWithVerticalAxis.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `TextField` type in SwiftUI, with `.vertical` axis. /// /// ### iOS @@ -75,6 +73,8 @@ extension IntrospectableViewType where Self == TextFieldWithVerticalAxisType { // MARK: SwiftUI.TextField(..., axis: .vertical) - iOS #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { @available(*, unavailable, message: "TextField(..., axis: .vertical) isn't available on iOS 13") public static let v13 = Self.unavailable() @@ -109,6 +109,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { @available(*, unavailable, message: "TextField(..., axis: .vertical) isn't available on macOS 10.15") public static let v10_15 = Self.unavailable() diff --git a/Sources/ViewTypes/Toggle.swift b/Sources/ViewTypes/Toggle.swift index 8e5cb0fb..5875b960 100644 --- a/Sources/ViewTypes/Toggle.swift +++ b/Sources/ViewTypes/Toggle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `Toggle` type in SwiftUI. /// /// ### iOS @@ -48,6 +46,8 @@ extension IntrospectableViewType where Self == ToggleType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) @@ -58,6 +58,8 @@ extension iOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/ToggleWithButtonStyle.swift b/Sources/ViewTypes/ToggleWithButtonStyle.swift index 9c0b3f99..aa51f0c1 100644 --- a/Sources/ViewTypes/ToggleWithButtonStyle.swift +++ b/Sources/ViewTypes/ToggleWithButtonStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `Toggle` type in SwiftUI, with `.button` style. /// /// ### iOS @@ -42,6 +40,8 @@ extension IntrospectableViewType where Self == ToggleWithButtonStyleType { } #if canImport(AppKit) && !targetEnvironment(macCatalyst) +public import AppKit + extension macOSViewVersion { @available(*, unavailable, message: ".toggleStyle(.button) isn't available on macOS 10.15") public static let v10_15 = Self.unavailable() diff --git a/Sources/ViewTypes/ToggleWithCheckboxStyle.swift b/Sources/ViewTypes/ToggleWithCheckboxStyle.swift index ac17b97a..1b16d9d5 100644 --- a/Sources/ViewTypes/ToggleWithCheckboxStyle.swift +++ b/Sources/ViewTypes/ToggleWithCheckboxStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `Toggle` type in SwiftUI, with `.checkbox` style. /// /// ### iOS @@ -42,6 +40,8 @@ extension IntrospectableViewType where Self == ToggleWithCheckboxStyleType { } #if canImport(AppKit) && !targetEnvironment(macCatalyst) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/ToggleWithSwitchStyle.swift b/Sources/ViewTypes/ToggleWithSwitchStyle.swift index bab5bb91..935e327d 100644 --- a/Sources/ViewTypes/ToggleWithSwitchStyle.swift +++ b/Sources/ViewTypes/ToggleWithSwitchStyle.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `Toggle` type in SwiftUI, with `.switch` style. /// /// ### iOS @@ -54,6 +52,8 @@ extension IntrospectableViewType where Self == ToggleWithSwitchStyleType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) @@ -64,6 +64,8 @@ extension iOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/VideoPlayer.swift b/Sources/ViewTypes/VideoPlayer.swift index 8143ae35..c1a4b4d7 100644 --- a/Sources/ViewTypes/VideoPlayer.swift +++ b/Sources/ViewTypes/VideoPlayer.swift @@ -57,7 +57,7 @@ import SwiftUI public struct VideoPlayerType: IntrospectableViewType {} #if canImport(AVKit) -import AVKit +public import AVKit extension IntrospectableViewType where Self == VideoPlayerType { public static var videoPlayer: Self { .init() } diff --git a/Sources/ViewTypes/View.swift b/Sources/ViewTypes/View.swift index 8eed8665..ff3946a6 100644 --- a/Sources/ViewTypes/View.swift +++ b/Sources/ViewTypes/View.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of a generic SwiftUI view type. /// /// ### iOS @@ -73,6 +71,8 @@ extension IntrospectableViewType where Self == ViewType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) @@ -99,6 +99,8 @@ extension visionOSViewVersion { public static let v26 = Self(for: .v26) } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15) public static let v11 = Self(for: .v11) diff --git a/Sources/ViewTypes/ViewController.swift b/Sources/ViewTypes/ViewController.swift index 08c2cbed..77e20110 100644 --- a/Sources/ViewTypes/ViewController.swift +++ b/Sources/ViewTypes/ViewController.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the receiving SwiftUI view's view controller, /// or the closest ancestor view controller if missing. /// @@ -73,6 +71,8 @@ extension IntrospectableViewType where Self == ViewControllerType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13) public static let v14 = Self(for: .v14) diff --git a/Sources/ViewTypes/WebView.swift b/Sources/ViewTypes/WebView.swift index ad18914a..b2120a81 100644 --- a/Sources/ViewTypes/WebView.swift +++ b/Sources/ViewTypes/WebView.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of the `WebView` type in SwiftUI. /// /// ### iOS @@ -69,7 +67,7 @@ import SwiftUI public struct WebViewType: IntrospectableViewType {} #if canImport(WebKit) -import WebKit +public import WebKit extension IntrospectableViewType where Self == WebViewType { public static var webView: Self { .init() } diff --git a/Sources/ViewTypes/Window.swift b/Sources/ViewTypes/Window.swift index 86f58aa9..4e188cd0 100644 --- a/Sources/ViewTypes/Window.swift +++ b/Sources/ViewTypes/Window.swift @@ -1,6 +1,4 @@ #if !os(watchOS) -import SwiftUI - /// An abstract representation of a view's window in SwiftUI. /// /// ### iOS @@ -61,6 +59,8 @@ extension IntrospectableViewType where Self == WindowType { } #if canImport(UIKit) +public import UIKit + extension iOSViewVersion { public static let v13 = Self(for: .v13, selector: selector) public static let v14 = Self(for: .v14, selector: selector) @@ -99,6 +99,8 @@ extension visionOSViewVersion { } } #elseif canImport(AppKit) +public import AppKit + extension macOSViewVersion { public static let v10_15 = Self(for: .v10_15, selector: selector) public static let v11 = Self(for: .v11, selector: selector)