Skip to content

Commit ee99554

Browse files
committed
Merge branch 'main' into feature/swift-6
2 parents deb8fb4 + 9068014 commit ee99554

File tree

70 files changed

+101
-113
lines changed

Some content is hidden

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

70 files changed

+101
-113
lines changed

Examples/Showcase/Showcase.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@
209209
SUPPORTS_MACCATALYST = YES;
210210
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
211211
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
212+
SWIFT_STRICT_CONCURRENCY = complete;
213+
SWIFT_VERSION = 6.0;
212214
TVOS_DEPLOYMENT_TARGET = 13.0;
213215
XROS_DEPLOYMENT_TARGET = 1.0;
214216
};
@@ -268,6 +270,8 @@
268270
SUPPORTS_MACCATALYST = YES;
269271
SWIFT_COMPILATION_MODE = wholemodule;
270272
SWIFT_OPTIMIZATION_LEVEL = "-O";
273+
SWIFT_STRICT_CONCURRENCY = complete;
274+
SWIFT_VERSION = 6.0;
271275
TVOS_DEPLOYMENT_TARGET = 13.0;
272276
VALIDATE_PRODUCT = YES;
273277
XROS_DEPLOYMENT_TARGET = 1.0;

Package.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,9 @@ let package = Package(
1919
name: "SwiftUIIntrospect",
2020
path: "Sources"
2121
),
22+
],
23+
swiftLanguageVersions: [
24+
.v5,
25+
.version("6.0"),
2226
]
2327
)

Sources/Introspect.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ struct IntrospectModifier<SwiftUIViewType: IntrospectableViewType, PlatformSpeci
9898
}
9999
}
100100

101+
@MainActor
101102
public protocol PlatformEntity: AnyObject {
102103
associatedtype Base: PlatformEntity
103104

Sources/IntrospectionSelector.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#if !os(watchOS)
22
@_spi(Advanced)
3+
34
@MainActor
45
public struct IntrospectionSelector<Target: PlatformEntity> {
56
@_spi(Advanced)
@@ -31,14 +32,14 @@ public struct IntrospectionSelector<Target: PlatformEntity> {
3132
}
3233

3334
@_spi(Advanced)
34-
public func withReceiverSelector(_ selector: @escaping (PlatformViewController) -> Target?) -> Self {
35+
public func withReceiverSelector(_ selector: @MainActor @Sendable @escaping (PlatformViewController) -> Target?) -> Self {
3536
var copy = self
3637
copy.receiverSelector = selector
3738
return copy
3839
}
3940

4041
@_spi(Advanced)
41-
public func withAncestorSelector(_ selector: @escaping (PlatformViewController) -> Target?) -> Self {
42+
public func withAncestorSelector(_ selector: @MainActor @Sendable @escaping (PlatformViewController) -> Target?) -> Self {
4243
var copy = self
4344
copy.ancestorSelector = selector
4445
return copy

Sources/PlatformView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ typealias _PlatformViewControllerRepresentable = UIViewControllerRepresentable
1919
typealias _PlatformViewControllerRepresentable = NSViewControllerRepresentable
2020
#endif
2121

22+
@MainActor
2223
protocol PlatformViewControllerRepresentable: _PlatformViewControllerRepresentable {
2324
#if canImport(UIKit)
2425
typealias ViewController = UIViewControllerType

Sources/PlatformViewVersion.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public typealias macOSViewVersion<SwiftUIViewType: IntrospectableViewType, Platf
6262
public typealias visionOSViewVersion<SwiftUIViewType: IntrospectableViewType, PlatformSpecificEntity: PlatformEntity> =
6363
PlatformViewVersion<visionOSVersion, SwiftUIViewType, PlatformSpecificEntity>
6464

65-
public enum PlatformViewVersion<Version: PlatformVersion, SwiftUIViewType: IntrospectableViewType, PlatformSpecificEntity: PlatformEntity> {
65+
public enum PlatformViewVersion<Version: PlatformVersion, SwiftUIViewType: IntrospectableViewType, PlatformSpecificEntity: PlatformEntity>: Sendable {
6666
@_spi(Internals) case available(Version, IntrospectionSelector<PlatformSpecificEntity>?)
6767
@_spi(Internals) case unavailable
6868

@@ -73,7 +73,7 @@ public enum PlatformViewVersion<Version: PlatformVersion, SwiftUIViewType: Intro
7373
@_spi(Advanced) public static func unavailable(file: StaticString = #file, line: UInt = #line) -> Self {
7474
let filePath = file.withUTF8Buffer { String(decoding: $0, as: UTF8.self) }
7575
let fileName = URL(fileURLWithPath: filePath).lastPathComponent
76-
runtimeWarn(
76+
print(
7777
"""
7878
If you're seeing this, someone forgot to mark \(fileName):\(line) as unavailable.
7979

Sources/RuntimeWarnings.swift

Lines changed: 0 additions & 83 deletions
This file was deleted.

Sources/ViewTypes/FullScreenCover.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ extension iOSViewVersion<FullScreenCoverType, UIPresentationController> {
8080
@MainActor public static let v18 = Self(for: .v18, selector: selector)
8181

8282
@MainActor private static var selector: IntrospectionSelector<UIPresentationController> {
83-
.from(UIViewController.self, selector: \.presentationController)
83+
.from(UIViewController.self, selector: { $0.presentationController })
8484
}
8585
}
8686

@@ -94,7 +94,7 @@ extension tvOSViewVersion<FullScreenCoverType, UIPresentationController> {
9494
@MainActor public static let v18 = Self(for: .v18, selector: selector)
9595

9696
@MainActor private static var selector: IntrospectionSelector<UIPresentationController> {
97-
.from(UIViewController.self, selector: \.presentationController)
97+
.from(UIViewController.self, selector: { $0.presentationController })
9898
}
9999
}
100100

@@ -103,7 +103,7 @@ extension visionOSViewVersion<FullScreenCoverType, UIPresentationController> {
103103
@MainActor public static let v2 = Self(for: .v2, selector: selector)
104104

105105
@MainActor private static var selector: IntrospectionSelector<UIPresentationController> {
106-
.from(UIViewController.self, selector: \.presentationController)
106+
.from(UIViewController.self, selector: { $0.presentationController })
107107
}
108108
}
109109
#endif

Sources/ViewTypes/NavigationSplitView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ extension iOSViewVersion<NavigationSplitViewType, UISplitViewController> {
9090
@MainActor public static let v18 = Self(for: .v18, selector: selector)
9191

9292
@MainActor private static var selector: IntrospectionSelector<UISplitViewController> {
93-
.default.withAncestorSelector(\.splitViewController)
93+
.default.withAncestorSelector { $0.splitViewController }
9494
}
9595
}
9696

@@ -107,7 +107,7 @@ extension tvOSViewVersion<NavigationSplitViewType, UINavigationController> {
107107
@MainActor public static let v18 = Self(for: .v18, selector: selector)
108108

109109
@MainActor private static var selector: IntrospectionSelector<UINavigationController> {
110-
.default.withAncestorSelector(\.navigationController)
110+
.default.withAncestorSelector { $0.navigationController }
111111
}
112112
}
113113

@@ -116,7 +116,7 @@ extension visionOSViewVersion<NavigationSplitViewType, UISplitViewController> {
116116
@MainActor public static let v2 = Self(for: .v2, selector: selector)
117117

118118
@MainActor private static var selector: IntrospectionSelector<UISplitViewController> {
119-
.default.withAncestorSelector(\.splitViewController)
119+
.default.withAncestorSelector { $0.splitViewController }
120120
}
121121
}
122122
#elseif canImport(AppKit)

Sources/ViewTypes/NavigationStack.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ extension iOSViewVersion<NavigationStackType, UINavigationController> {
7171
@MainActor public static let v18 = Self(for: .v18, selector: selector)
7272

7373
@MainActor private static var selector: IntrospectionSelector<UINavigationController> {
74-
.default.withAncestorSelector(\.navigationController)
74+
.default.withAncestorSelector { $0.navigationController }
7575
}
7676
}
7777

@@ -88,7 +88,7 @@ extension tvOSViewVersion<NavigationStackType, UINavigationController> {
8888
@MainActor public static let v18 = Self(for: .v18, selector: selector)
8989

9090
@MainActor private static var selector: IntrospectionSelector<UINavigationController> {
91-
.default.withAncestorSelector(\.navigationController)
91+
.default.withAncestorSelector { $0.navigationController }
9292
}
9393
}
9494

@@ -97,7 +97,7 @@ extension visionOSViewVersion<NavigationStackType, UINavigationController> {
9797
@MainActor public static let v2 = Self(for: .v2, selector: selector)
9898

9999
@MainActor private static var selector: IntrospectionSelector<UINavigationController> {
100-
.default.withAncestorSelector(\.navigationController)
100+
.default.withAncestorSelector { $0.navigationController }
101101
}
102102
}
103103
#endif

0 commit comments

Comments
 (0)