Skip to content

Commit f2f8525

Browse files
authored
Enable upcoming Swift 7 features (#467)
1 parent 66fce14 commit f2f8525

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+163
-105
lines changed

Package.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@ let package = Package(
2121
),
2222
]
2323
)
24+
25+
for target in package.targets {
26+
target.swiftSettings = target.swiftSettings ?? []
27+
target.swiftSettings? += [
28+
.enableUpcomingFeature("ExistentialAny"),
29+
.enableUpcomingFeature("InternalImportsByDefault"),
30+
]
31+
}

Sources/Introspect.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#if !os(watchOS)
2-
import SwiftUI
2+
public import SwiftUI
33

44
/// The scope of introspection i.e. where introspect should look to find
55
/// the desired target view relative to the applied `.introspect(...)`

Sources/PlatformView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#if !os(watchOS)
2-
import SwiftUI
2+
public import SwiftUI
33

44
#if canImport(UIKit)
55
public typealias PlatformView = UIView

Sources/ViewTypes/Button.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#if !os(watchOS)
2-
import SwiftUI
3-
42
/// An abstract representation of the `Button` type in SwiftUI.
53
///
64
/// ### iOS
@@ -35,6 +33,8 @@ extension IntrospectableViewType where Self == ButtonType {
3533
}
3634

3735
#if canImport(AppKit) && !targetEnvironment(macCatalyst)
36+
public import AppKit
37+
3838
extension macOSViewVersion<ButtonType, NSButton> {
3939
public static let v10_15 = Self(for: .v10_15)
4040
public static let v11 = Self(for: .v11)

Sources/ViewTypes/ColorPicker.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#if !os(watchOS)
2-
import SwiftUI
3-
42
/// An abstract representation of the `ColorPicker` type in SwiftUI.
53
///
64
/// ### iOS
@@ -59,6 +57,8 @@ extension IntrospectableViewType where Self == ColorPickerType {
5957
}
6058

6159
#if canImport(UIKit)
60+
public import UIKit
61+
6262
@available(iOS 14, *)
6363
extension iOSViewVersion<ColorPickerType, UIColorWell> {
6464
@available(*, unavailable, message: "ColorPicker isn't available on iOS 13")
@@ -78,6 +78,8 @@ extension visionOSViewVersion<ColorPickerType, UIColorWell> {
7878
public static let v26 = Self(for: .v26)
7979
}
8080
#elseif canImport(AppKit)
81+
public import AppKit
82+
8183
@available(macOS 11, *)
8284
extension macOSViewVersion<ColorPickerType, NSColorWell> {
8385
@available(*, unavailable, message: "ColorPicker isn't available on macOS 10.15")

Sources/ViewTypes/DatePicker.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#if !os(watchOS)
2-
import SwiftUI
3-
42
/// An abstract representation of the `DatePicker` type in SwiftUI.
53
///
64
/// ### iOS
@@ -57,6 +55,8 @@ extension IntrospectableViewType where Self == DatePickerType {
5755
}
5856

5957
#if canImport(UIKit)
58+
public import UIKit
59+
6060
extension iOSViewVersion<DatePickerType, UIDatePicker> {
6161
public static let v13 = Self(for: .v13)
6262
public static let v14 = Self(for: .v14)
@@ -73,6 +73,8 @@ extension visionOSViewVersion<DatePickerType, UIDatePicker> {
7373
public static let v26 = Self(for: .v26)
7474
}
7575
#elseif canImport(AppKit)
76+
public import AppKit
77+
7678
extension macOSViewVersion<DatePickerType, NSDatePicker> {
7779
public static let v10_15 = Self(for: .v10_15)
7880
public static let v11 = Self(for: .v11)

Sources/ViewTypes/DatePickerWithCompactStyle.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#if !os(watchOS)
2-
import SwiftUI
3-
42
/// An abstract representation of the `DatePicker` type in SwiftUI, with `.compact` style.
53
///
64
/// ### iOS
@@ -66,6 +64,8 @@ extension IntrospectableViewType where Self == DatePickerWithCompactStyleType {
6664
}
6765

6866
#if canImport(UIKit)
67+
public import UIKit
68+
6969
extension iOSViewVersion<DatePickerWithCompactStyleType, UIDatePicker> {
7070
@available(*, unavailable, message: ".datePickerStyle(.compact) isn't available on iOS 13")
7171
public static let v13 = Self.unavailable()
@@ -83,6 +83,8 @@ extension visionOSViewVersion<DatePickerWithCompactStyleType, UIDatePicker> {
8383
public static let v26 = Self(for: .v26)
8484
}
8585
#elseif canImport(AppKit) && !targetEnvironment(macCatalyst)
86+
public import AppKit
87+
8688
extension macOSViewVersion<DatePickerWithCompactStyleType, NSDatePicker> {
8789
@available(*, unavailable, message: ".datePickerStyle(.compact) isn't available on macOS 10.15")
8890
public static let v10_15 = Self.unavailable()

Sources/ViewTypes/DatePickerWithFieldStyle.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#if !os(watchOS)
2-
import SwiftUI
3-
42
/// An abstract representation of the `DatePicker` type in SwiftUI, with `.field` style.
53
///
64
/// ### iOS
@@ -42,6 +40,8 @@ extension IntrospectableViewType where Self == DatePickerWithFieldStyleType {
4240
}
4341

4442
#if canImport(AppKit) && !targetEnvironment(macCatalyst)
43+
public import AppKit
44+
4545
extension macOSViewVersion<DatePickerWithFieldStyleType, NSDatePicker> {
4646
public static let v10_15 = Self(for: .v10_15)
4747
public static let v11 = Self(for: .v11)

Sources/ViewTypes/DatePickerWithGraphicalStyle.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#if !os(watchOS)
2-
import SwiftUI
3-
42
/// An abstract representation of the `DatePicker` type in SwiftUI, with `.graphical` style.
53
///
64
/// ### iOS
@@ -66,6 +64,8 @@ extension IntrospectableViewType where Self == DatePickerWithGraphicalStyleType
6664
}
6765

6866
#if canImport(UIKit)
67+
public import UIKit
68+
6969
extension iOSViewVersion<DatePickerWithGraphicalStyleType, UIDatePicker> {
7070
@available(*, unavailable, message: ".datePickerStyle(.graphical) isn't available on iOS 13")
7171
public static let v13 = Self(for: .v13)
@@ -83,6 +83,8 @@ extension visionOSViewVersion<DatePickerWithGraphicalStyleType, UIDatePicker> {
8383
public static let v26 = Self(for: .v26)
8484
}
8585
#elseif canImport(AppKit) && !targetEnvironment(macCatalyst)
86+
public import AppKit
87+
8688
extension macOSViewVersion<DatePickerWithGraphicalStyleType, NSDatePicker> {
8789
public static let v10_15 = Self(for: .v10_15)
8890
public static let v11 = Self(for: .v11)

Sources/ViewTypes/DatePickerWithStepperFieldStyle.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#if !os(watchOS)
2-
import SwiftUI
3-
42
/// An abstract representation of the `DatePicker` type in SwiftUI, with `.stepperField` style.
53
///
64
/// ### iOS
@@ -42,6 +40,8 @@ extension IntrospectableViewType where Self == DatePickerWithStepperFieldStyleTy
4240
}
4341

4442
#if canImport(AppKit) && !targetEnvironment(macCatalyst)
43+
public import AppKit
44+
4545
extension macOSViewVersion<DatePickerWithStepperFieldStyleType, NSDatePicker> {
4646
public static let v10_15 = Self(for: .v10_15)
4747
public static let v11 = Self(for: .v11)

0 commit comments

Comments
 (0)