diff --git a/Examples/Showcase/Showcase.xcodeproj/project.pbxproj b/Examples/Showcase/Showcase.xcodeproj/project.pbxproj index 2b7edd2c..29bd8f6d 100644 --- a/Examples/Showcase/Showcase.xcodeproj/project.pbxproj +++ b/Examples/Showcase/Showcase.xcodeproj/project.pbxproj @@ -209,6 +209,8 @@ SUPPORTS_MACCATALYST = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_STRICT_CONCURRENCY = complete; + SWIFT_VERSION = 6.0; TVOS_DEPLOYMENT_TARGET = 13.0; XROS_DEPLOYMENT_TARGET = 1.0; }; @@ -268,6 +270,8 @@ SUPPORTS_MACCATALYST = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_STRICT_CONCURRENCY = complete; + SWIFT_VERSION = 6.0; TVOS_DEPLOYMENT_TARGET = 13.0; VALIDATE_PRODUCT = YES; XROS_DEPLOYMENT_TARGET = 1.0; diff --git a/Package.swift b/Package.swift index c19540ef..83e453c3 100644 --- a/Package.swift +++ b/Package.swift @@ -19,5 +19,9 @@ let package = Package( name: "SwiftUIIntrospect", path: "Sources" ), + ], + swiftLanguageVersions: [ + .v5, + .version("6.0"), ] ) diff --git a/Sources/Introspect.swift b/Sources/Introspect.swift index ba94ed5f..0db1263d 100644 --- a/Sources/Introspect.swift +++ b/Sources/Introspect.swift @@ -4,7 +4,7 @@ import SwiftUI /// The scope of introspection i.e. where introspect should look to find /// the desired target view relative to the applied `.introspect(...)` /// modifier. -public struct IntrospectionScope: OptionSet { +public struct IntrospectionScope: OptionSet, Sendable { /// Look within the `receiver` of the `.introspect(...)` modifier. public static let receiver = Self(rawValue: 1 << 0) /// Look for an `ancestor` relative to the `.introspect(...)` modifier. @@ -96,6 +96,7 @@ struct IntrospectModifier { +public struct IntrospectionSelector: Sendable { @_spi(Advanced) public static var `default`: Self { .from(Target.self, selector: { $0 }) } @_spi(Advanced) - public static func from(_ entryType: Entry.Type, selector: @escaping (Entry) -> Target?) -> Self { + public static func from(_ entryType: Entry.Type, selector: @MainActor @Sendable @escaping (Entry) -> Target?) -> Self { .init( receiverSelector: { controller in controller.as(Entry.Base.self)?.receiver(ofType: Entry.self).flatMap(selector) @@ -16,32 +16,32 @@ public struct IntrospectionSelector { ) } - private var receiverSelector: (IntrospectionPlatformViewController) -> Target? - private var ancestorSelector: (IntrospectionPlatformViewController) -> Target? + private var receiverSelector: @MainActor @Sendable (IntrospectionPlatformViewController) -> Target? + private var ancestorSelector: @MainActor @Sendable (IntrospectionPlatformViewController) -> Target? private init( - receiverSelector: @escaping (IntrospectionPlatformViewController) -> Target?, - ancestorSelector: @escaping (IntrospectionPlatformViewController) -> Target? + receiverSelector: @MainActor @Sendable @escaping (IntrospectionPlatformViewController) -> Target?, + ancestorSelector: @MainActor @Sendable @escaping (IntrospectionPlatformViewController) -> Target? ) { self.receiverSelector = receiverSelector self.ancestorSelector = ancestorSelector } @_spi(Advanced) - public func withReceiverSelector(_ selector: @escaping (PlatformViewController) -> Target?) -> Self { + public func withReceiverSelector(_ selector: @MainActor @Sendable @escaping (PlatformViewController) -> Target?) -> Self { var copy = self copy.receiverSelector = selector return copy } @_spi(Advanced) - public func withAncestorSelector(_ selector: @escaping (PlatformViewController) -> Target?) -> Self { + public func withAncestorSelector(_ selector: @MainActor @Sendable @escaping (PlatformViewController) -> Target?) -> Self { var copy = self copy.ancestorSelector = selector return copy } - func callAsFunction(_ controller: IntrospectionPlatformViewController, _ scope: IntrospectionScope) -> Target? { + @MainActor func callAsFunction(_ controller: IntrospectionPlatformViewController, _ scope: IntrospectionScope) -> Target? { if scope.contains(.receiver), let target = receiverSelector(controller) diff --git a/Sources/IntrospectionView.swift b/Sources/IntrospectionView.swift index 55c96356..2f24832a 100644 --- a/Sources/IntrospectionView.swift +++ b/Sources/IntrospectionView.swift @@ -4,7 +4,7 @@ import SwiftUI typealias IntrospectionViewID = UUID fileprivate enum IntrospectionStore { - static var shared: [IntrospectionViewID: Pair] = [:] + @MainActor static var shared: [IntrospectionViewID: Pair] = [:] struct Pair { weak var controller: IntrospectionPlatformViewController? @@ -13,7 +13,7 @@ fileprivate enum IntrospectionStore { } extension PlatformEntity { - var introspectionAnchorEntity: Base? { + @MainActor var introspectionAnchorEntity: Base? { if let introspectionController = self as? IntrospectionPlatformViewController { return IntrospectionStore.shared[introspectionController.id]?.anchor~ } diff --git a/Sources/PlatformVersion.swift b/Sources/PlatformVersion.swift index 2600bc7f..49e50a7f 100644 --- a/Sources/PlatformVersion.swift +++ b/Sources/PlatformVersion.swift @@ -2,13 +2,13 @@ import Foundation @_spi(Internals) -public enum PlatformVersionCondition { +public enum PlatformVersionCondition: Sendable { case past case current case future } -public protocol PlatformVersion { +public protocol PlatformVersion: Sendable { @_spi(Internals) var condition: PlatformVersionCondition? { get } } diff --git a/Sources/PlatformView.swift b/Sources/PlatformView.swift index 045b47d6..11bc6f30 100644 --- a/Sources/PlatformView.swift +++ b/Sources/PlatformView.swift @@ -19,6 +19,7 @@ typealias _PlatformViewControllerRepresentable = UIViewControllerRepresentable typealias _PlatformViewControllerRepresentable = NSViewControllerRepresentable #endif +@MainActor protocol PlatformViewControllerRepresentable: _PlatformViewControllerRepresentable { #if canImport(UIKit) typealias ViewController = UIViewControllerType diff --git a/Sources/PlatformViewVersion.swift b/Sources/PlatformViewVersion.swift index 310b4d31..4249887a 100644 --- a/Sources/PlatformViewVersion.swift +++ b/Sources/PlatformViewVersion.swift @@ -61,7 +61,7 @@ public typealias macOSViewVersion = PlatformViewVersion -public enum PlatformViewVersion { +public enum PlatformViewVersion: Sendable { @_spi(Internals) case available(Version, IntrospectionSelector?) @_spi(Internals) case unavailable @@ -72,7 +72,7 @@ public enum PlatformViewVersion Self { let filePath = file.withUTF8Buffer { String(decoding: $0, as: UTF8.self) } let fileName = URL(fileURLWithPath: filePath).lastPathComponent - runtimeWarn( + print( """ If you're seeing this, someone forgot to mark \(fileName):\(line) as unavailable. diff --git a/Sources/RuntimeWarnings.swift b/Sources/RuntimeWarnings.swift deleted file mode 100644 index bee24769..00000000 --- a/Sources/RuntimeWarnings.swift +++ /dev/null @@ -1,83 +0,0 @@ -// MIT License -// -// Copyright (c) 2020 Point-Free, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import Foundation - -@_transparent -@usableFromInline -@inline(__always) -func runtimeWarn( - _ message: @autoclosure () -> String, - category: String? = "SwiftUIIntrospect" -) { - #if DEBUG - let message = message() - let category = category ?? "Runtime Warning" - #if canImport(os) - os_log( - .fault, - dso: dso, - log: OSLog(subsystem: "com.apple.runtime-issues", category: category), - "%@", - message - ) - #else - fputs("\(formatter.string(from: Date())) [\(category)] \(message)\n", stderr) - #endif - #endif -} - -#if DEBUG - #if canImport(os) - import os - - // NB: Xcode runtime warnings offer a much better experience than traditional assertions and - // breakpoints, but Apple provides no means of creating custom runtime warnings ourselves. - // To work around this, we hook into SwiftUI's runtime issue delivery mechanism, instead. - // - // Feedback filed: https://gist.github.com/stephencelis/a8d06383ed6ccde3e5ef5d1b3ad52bbc - @usableFromInline - let dso = { () -> UnsafeMutableRawPointer in - let count = _dyld_image_count() - for i in 0.. { public static let v18 = Self(for: .v18, selector: selector) private static var selector: IntrospectionSelector { - .from(UIViewController.self, selector: \.presentationController) + .from(UIViewController.self, selector: { $0.presentationController }) } } @@ -94,7 +94,7 @@ extension tvOSViewVersion { public static let v18 = Self(for: .v18, selector: selector) private static var selector: IntrospectionSelector { - .from(UIViewController.self, selector: \.presentationController) + .from(UIViewController.self, selector: { $0.presentationController }) } } @@ -103,7 +103,7 @@ extension visionOSViewVersion { public static let v2 = Self(for: .v2, selector: selector) private static var selector: IntrospectionSelector { - .from(UIViewController.self, selector: \.presentationController) + .from(UIViewController.self, selector: { $0.presentationController }) } } #endif diff --git a/Sources/ViewTypes/NavigationSplitView.swift b/Sources/ViewTypes/NavigationSplitView.swift index d972c21b..8290472d 100644 --- a/Sources/ViewTypes/NavigationSplitView.swift +++ b/Sources/ViewTypes/NavigationSplitView.swift @@ -90,7 +90,7 @@ extension iOSViewVersion { public static let v18 = Self(for: .v18, selector: selector) private static var selector: IntrospectionSelector { - .default.withAncestorSelector(\.splitViewController) + .default.withAncestorSelector({ $0.splitViewController }) } } @@ -107,7 +107,7 @@ extension tvOSViewVersion { public static let v18 = Self(for: .v18, selector: selector) private static var selector: IntrospectionSelector { - .default.withAncestorSelector(\.navigationController) + .default.withAncestorSelector { $0.navigationController } } } @@ -116,7 +116,7 @@ extension visionOSViewVersion { public static let v2 = Self(for: .v2, selector: selector) private static var selector: IntrospectionSelector { - .default.withAncestorSelector(\.splitViewController) + .default.withAncestorSelector { $0.splitViewController } } } #elseif canImport(AppKit) diff --git a/Sources/ViewTypes/NavigationStack.swift b/Sources/ViewTypes/NavigationStack.swift index 382ffd2c..26ee12bf 100644 --- a/Sources/ViewTypes/NavigationStack.swift +++ b/Sources/ViewTypes/NavigationStack.swift @@ -71,7 +71,7 @@ extension iOSViewVersion { public static let v18 = Self(for: .v18, selector: selector) private static var selector: IntrospectionSelector { - .default.withAncestorSelector(\.navigationController) + .default.withAncestorSelector { $0.navigationController } } } @@ -88,7 +88,7 @@ extension tvOSViewVersion { public static let v18 = Self(for: .v18, selector: selector) private static var selector: IntrospectionSelector { - .default.withAncestorSelector(\.navigationController) + .default.withAncestorSelector { $0.navigationController } } } @@ -97,7 +97,7 @@ extension visionOSViewVersion { public static let v2 = Self(for: .v2, selector: selector) private static var selector: IntrospectionSelector { - .default.withAncestorSelector(\.navigationController) + .default.withAncestorSelector { $0.navigationController } } } #endif diff --git a/Sources/ViewTypes/NavigationViewWithColumnsStyle.swift b/Sources/ViewTypes/NavigationViewWithColumnsStyle.swift index be7aaaf4..d700cf9e 100644 --- a/Sources/ViewTypes/NavigationViewWithColumnsStyle.swift +++ b/Sources/ViewTypes/NavigationViewWithColumnsStyle.swift @@ -86,7 +86,7 @@ extension iOSViewVersion { - .default.withAncestorSelector(\.splitViewController) + .default.withAncestorSelector { $0.splitViewController } } } @@ -99,7 +99,7 @@ extension tvOSViewVersion { - .default.withAncestorSelector(\.navigationController) + .default.withAncestorSelector { $0.navigationController } } } @@ -108,7 +108,7 @@ extension visionOSViewVersion { - .default.withAncestorSelector(\.splitViewController) + .default.withAncestorSelector { $0.splitViewController } } } #elseif canImport(AppKit) diff --git a/Sources/ViewTypes/NavigationViewWithStackStyle.swift b/Sources/ViewTypes/NavigationViewWithStackStyle.swift index baf3dff4..993ff226 100644 --- a/Sources/ViewTypes/NavigationViewWithStackStyle.swift +++ b/Sources/ViewTypes/NavigationViewWithStackStyle.swift @@ -74,7 +74,7 @@ extension iOSViewVersion { - .default.withAncestorSelector(\.navigationController) + .default.withAncestorSelector { $0.navigationController } } } @@ -87,7 +87,7 @@ extension tvOSViewVersion { - .default.withAncestorSelector(\.navigationController) + .default.withAncestorSelector { $0.navigationController } } } @@ -96,7 +96,7 @@ extension visionOSViewVersion { - .default.withAncestorSelector(\.navigationController) + .default.withAncestorSelector { $0.navigationController } } } #endif diff --git a/Sources/ViewTypes/Popover.swift b/Sources/ViewTypes/Popover.swift index 39f30bda..2f28ab4c 100644 --- a/Sources/ViewTypes/Popover.swift +++ b/Sources/ViewTypes/Popover.swift @@ -65,7 +65,7 @@ extension iOSViewVersion { public static let v18 = Self(for: .v18, selector: selector) private static var selector: IntrospectionSelector { - .from(UIViewController.self, selector: \.popoverPresentationController) + .from(UIViewController.self, selector: { $0.popoverPresentationController }) } } @@ -74,7 +74,7 @@ extension visionOSViewVersion { public static let v2 = Self(for: .v2, selector: selector) private static var selector: IntrospectionSelector { - .from(UIViewController.self, selector: \.popoverPresentationController) + .from(UIViewController.self, selector: { $0.popoverPresentationController }) } } #endif diff --git a/Sources/ViewTypes/Sheet.swift b/Sources/ViewTypes/Sheet.swift index b3e6a859..cb7619bc 100644 --- a/Sources/ViewTypes/Sheet.swift +++ b/Sources/ViewTypes/Sheet.swift @@ -79,7 +79,7 @@ extension iOSViewVersion { public static let v18 = Self(for: .v18, selector: selector) private static var selector: IntrospectionSelector { - .from(UIViewController.self, selector: \.presentationController) + .from(UIViewController.self, selector: { $0.presentationController }) } } @@ -96,7 +96,7 @@ extension iOSViewVersion { public static let v18 = Self(for: .v18, selector: selector) private static var selector: IntrospectionSelector { - .from(UIViewController.self, selector: \.sheetPresentationController) + .from(UIViewController.self, selector: { $0.sheetPresentationController }) } } @@ -106,7 +106,7 @@ extension visionOSViewVersion { public static let v2 = Self(for: .v2, selector: selector) private static var selector: IntrospectionSelector { - .from(UIViewController.self, selector: \.sheetPresentationController) + .from(UIViewController.self, selector: { $0.sheetPresentationController }) } } #endif @@ -120,7 +120,7 @@ extension tvOSViewVersion { public static let v18 = Self(for: .v18, selector: selector) private static var selector: IntrospectionSelector { - .from(UIViewController.self, selector: \.presentationController) + .from(UIViewController.self, selector: { $0.presentationController }) } } #endif diff --git a/Sources/ViewTypes/TabView.swift b/Sources/ViewTypes/TabView.swift index 850482f7..4f15bf66 100644 --- a/Sources/ViewTypes/TabView.swift +++ b/Sources/ViewTypes/TabView.swift @@ -71,7 +71,7 @@ extension iOSViewVersion { public static let v18 = Self(for: .v18, selector: selector) private static var selector: IntrospectionSelector { - .default.withAncestorSelector(\.tabBarController) + .default.withAncestorSelector { $0.tabBarController } } } @@ -84,7 +84,7 @@ extension tvOSViewVersion { public static let v18 = Self(for: .v18, selector: selector) private static var selector: IntrospectionSelector { - .default.withAncestorSelector(\.tabBarController) + .default.withAncestorSelector { $0.tabBarController } } } #elseif canImport(AppKit) diff --git a/Sources/ViewTypes/Window.swift b/Sources/ViewTypes/Window.swift index e1203c81..b0d4291f 100644 --- a/Sources/ViewTypes/Window.swift +++ b/Sources/ViewTypes/Window.swift @@ -70,7 +70,7 @@ extension iOSViewVersion { public static let v18 = Self(for: .v18, selector: selector) private static var selector: IntrospectionSelector { - .from(UIView.self, selector: \.window) + .from(UIView.self, selector: { $0.window }) } } @@ -83,7 +83,7 @@ extension tvOSViewVersion { public static let v18 = Self(for: .v18, selector: selector) private static var selector: IntrospectionSelector { - .from(UIView.self, selector: \.window) + .from(UIView.self, selector: { $0.window }) } } @@ -92,7 +92,7 @@ extension visionOSViewVersion { public static let v2 = Self(for: .v2, selector: selector) private static var selector: IntrospectionSelector { - .from(UIView.self, selector: \.window) + .from(UIView.self, selector: { $0.window }) } } #elseif canImport(AppKit) @@ -105,7 +105,7 @@ extension macOSViewVersion { public static let v15 = Self(for: .v15, selector: selector) private static var selector: IntrospectionSelector { - .from(NSView.self, selector: \.window) + .from(NSView.self, selector: { $0.window }) } } #endif diff --git a/Tests/Tests.xcodeproj/project.pbxproj b/Tests/Tests.xcodeproj/project.pbxproj index 98b3f7fa..f2180e8f 100644 --- a/Tests/Tests.xcodeproj/project.pbxproj +++ b/Tests/Tests.xcodeproj/project.pbxproj @@ -1561,6 +1561,8 @@ MACOSX_DEPLOYMENT_TARGET = 11.0; ONLY_ACTIVE_ARCH = YES; SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvos appletvsimulator"; + SWIFT_STRICT_CONCURRENCY = complete; + SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,3,2,6"; TVOS_DEPLOYMENT_TARGET = 13.0; XROS_DEPLOYMENT_TARGET = 1.0; @@ -1602,6 +1604,8 @@ IPHONEOS_DEPLOYMENT_TARGET = 13.0; MACOSX_DEPLOYMENT_TARGET = 11.0; SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvos appletvsimulator"; + SWIFT_STRICT_CONCURRENCY = complete; + SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,3,2,6"; TVOS_DEPLOYMENT_TARGET = 13.0; XROS_DEPLOYMENT_TARGET = 1.0; diff --git a/Tests/Tests/TestUtils.swift b/Tests/Tests/TestUtils.swift index 716f4ef5..2cc8329a 100644 --- a/Tests/Tests/TestUtils.swift +++ b/Tests/Tests/TestUtils.swift @@ -2,6 +2,7 @@ import SwiftUI import XCTest #if canImport(UIKit) +@MainActor enum TestUtils { #if targetEnvironment(macCatalyst) || os(visionOS) static let window = UIWindow(frame: CGRect(x: 0, y: 0, width: 480, height: 300)) @@ -24,6 +25,7 @@ enum TestUtils { } } #elseif canImport(AppKit) +@MainActor enum TestUtils { private static let window = NSWindow( contentRect: NSRect(x: 0, y: 0, width: 480, height: 300), @@ -40,6 +42,7 @@ enum TestUtils { } #endif +@MainActor func XCTAssertViewIntrospection( of type: Entity.Type, @ViewBuilder view: (Spies) -> some View, diff --git a/Tests/Tests/ViewTypes/ButtonTests.swift b/Tests/Tests/ViewTypes/ButtonTests.swift index d07dcd96..28dcd444 100644 --- a/Tests/Tests/ViewTypes/ButtonTests.swift +++ b/Tests/Tests/ViewTypes/ButtonTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class ButtonTests: XCTestCase { #if canImport(AppKit) typealias PlatformButton = NSButton diff --git a/Tests/Tests/ViewTypes/ColorPickerTests.swift b/Tests/Tests/ViewTypes/ColorPickerTests.swift index 25375eb6..f61bd4b9 100644 --- a/Tests/Tests/ViewTypes/ColorPickerTests.swift +++ b/Tests/Tests/ViewTypes/ColorPickerTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 14, macOS 11, *) +@MainActor final class ColorPickerTests: XCTestCase { #if canImport(UIKit) typealias PlatformColor = UIColor diff --git a/Tests/Tests/ViewTypes/DatePickerTests.swift b/Tests/Tests/ViewTypes/DatePickerTests.swift index f105cd72..1cdaf623 100644 --- a/Tests/Tests/ViewTypes/DatePickerTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class DatePickerTests: XCTestCase { #if canImport(UIKit) typealias PlatformDatePicker = UIDatePicker diff --git a/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift index 6ac88b55..3698f84b 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 14, macOS 10.15.4, *) +@MainActor final class DatePickerWithCompactStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformDatePickerWithCompactStyle = UIDatePicker diff --git a/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift index 630ceb47..e33f9b04 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class DatePickerWithFieldStyleTests: XCTestCase { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformDatePickerWithFieldStyle = NSDatePicker diff --git a/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift index c4a4fbc3..8aa62db4 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 14, *) +@MainActor final class DatePickerWithGraphicalStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformDatePickerWithGraphicalStyle = UIDatePicker diff --git a/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift index b2005561..9b2a506d 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class DatePickerWithStepperFieldStyleTests: XCTestCase { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformDatePickerWithStepperFieldStyle = NSDatePicker diff --git a/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift index 1f9df82a..ac1256f2 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class DatePickerWithWheelStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformDatePickerWithWheelStyle = UIDatePicker diff --git a/Tests/Tests/ViewTypes/FormTests.swift b/Tests/Tests/ViewTypes/FormTests.swift index b6b5d852..c6125c8b 100644 --- a/Tests/Tests/ViewTypes/FormTests.swift +++ b/Tests/Tests/ViewTypes/FormTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class FormTests: XCTestCase { #if canImport(UIKit) typealias PlatformForm = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift b/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift index 90df9208..d6fdef3b 100644 --- a/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift @@ -3,6 +3,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 16, tvOS 16, macOS 13, *) +@MainActor final class FormWithGroupedStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformFormWithGroupedStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/FullScreenCoverTests.swift b/Tests/Tests/ViewTypes/FullScreenCoverTests.swift index d5a2e675..66944199 100644 --- a/Tests/Tests/ViewTypes/FullScreenCoverTests.swift +++ b/Tests/Tests/ViewTypes/FullScreenCoverTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 14, tvOS 14, *) +@MainActor final class FullScreenCoverTests: XCTestCase { func testPresentationAsFullScreenCover() throws { guard #available(iOS 14, tvOS 14, *) else { diff --git a/Tests/Tests/ViewTypes/ListCellTests.swift b/Tests/Tests/ViewTypes/ListCellTests.swift index d6882abf..2d4b65a9 100644 --- a/Tests/Tests/ViewTypes/ListCellTests.swift +++ b/Tests/Tests/ViewTypes/ListCellTests.swift @@ -2,6 +2,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class ListCellTests: XCTestCase { #if canImport(UIKit) typealias PlatformListCell = UIView // covers both UITableViewCell and UICollectionViewCell diff --git a/Tests/Tests/ViewTypes/ListTests.swift b/Tests/Tests/ViewTypes/ListTests.swift index 1b8da8f0..fe722b93 100644 --- a/Tests/Tests/ViewTypes/ListTests.swift +++ b/Tests/Tests/ViewTypes/ListTests.swift @@ -2,6 +2,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class ListTests: XCTestCase { #if canImport(UIKit) typealias PlatformList = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift index 357937c3..98ddfb17 100644 --- a/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(macOS 12, *) +@MainActor final class ListWithBorderedStyleTests: XCTestCase { #if canImport(AppKit) typealias PlatformListWithBorderedStyle = NSTableView diff --git a/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift index 16793db8..5949ee45 100644 --- a/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class ListWithGroupedStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformListWithGroupedStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift index 23a539fa..12f6cd8f 100644 --- a/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 14, *) +@MainActor final class ListWithInsetGroupedStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformListWithInsetGroupedStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift b/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift index 86e1746a..db88d126 100644 --- a/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 14, macOS 11, *) +@MainActor final class ListWithInsetStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformListWithInsetStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift b/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift index 115a5a34..1ad621f3 100644 --- a/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift @@ -2,6 +2,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class ListWithPlainStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformListWithPlainStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift b/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift index c45d456f..43de00ef 100644 --- a/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 14, macOS 10.15, *) +@MainActor final class ListWithSidebarStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformListWithSidebarStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/MapTests.swift b/Tests/Tests/ViewTypes/MapTests.swift index 2199b4cd..27032671 100644 --- a/Tests/Tests/ViewTypes/MapTests.swift +++ b/Tests/Tests/ViewTypes/MapTests.swift @@ -5,6 +5,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 14, tvOS 14, macOS 11, *) +@MainActor final class MapTests: XCTestCase { typealias PlatformMap = MKMapView diff --git a/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift b/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift index ac619ab0..391ebe9d 100644 --- a/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift +++ b/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift @@ -3,6 +3,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 16, tvOS 16, macOS 13, *) +@MainActor final class NavigationSplitViewTests: XCTestCase { #if canImport(UIKit) && (os(iOS) || os(visionOS)) typealias PlatformNavigationSplitView = UISplitViewController diff --git a/Tests/Tests/ViewTypes/NavigationStackTests.swift b/Tests/Tests/ViewTypes/NavigationStackTests.swift index 579a6a0b..9ed4ac0c 100644 --- a/Tests/Tests/ViewTypes/NavigationStackTests.swift +++ b/Tests/Tests/ViewTypes/NavigationStackTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 16, tvOS 16, *) +@MainActor final class NavigationStackTests: XCTestCase { #if canImport(UIKit) typealias PlatformNavigationStack = UINavigationController diff --git a/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift b/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift index a54edd7e..4a1ae555 100644 --- a/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift +++ b/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift @@ -2,6 +2,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class NavigationViewWithColumnsStyleTests: XCTestCase { #if canImport(UIKit) && (os(iOS) || os(visionOS)) typealias PlatformNavigationViewWithColumnsStyle = UISplitViewController diff --git a/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift b/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift index 36e2849b..95ad9133 100644 --- a/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift +++ b/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class NavigationViewWithStackStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformNavigationViewWithStackStyle = UINavigationController diff --git a/Tests/Tests/ViewTypes/PageControlTests.swift b/Tests/Tests/ViewTypes/PageControlTests.swift index 3ef343e4..2b6aed8b 100644 --- a/Tests/Tests/ViewTypes/PageControlTests.swift +++ b/Tests/Tests/ViewTypes/PageControlTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 14, tvOS 14, *) +@MainActor final class PageControlTests: XCTestCase { #if canImport(UIKit) typealias PlatformPageControl = UIPageControl diff --git a/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift b/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift index c0c62962..a7867271 100644 --- a/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift +++ b/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class PickerWithMenuStyleTests: XCTestCase { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformPickerWithMenuStyle = NSPopUpButton diff --git a/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift b/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift index 54123e4e..109c27d3 100644 --- a/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift +++ b/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift @@ -2,6 +2,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class PickerWithSegmentedStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformPickerWithSegmentedStyle = UISegmentedControl diff --git a/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift b/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift index 8c05558e..10be27b9 100644 --- a/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift +++ b/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class PickerWithWheelStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformPickerWithWheelStyle = UIPickerView diff --git a/Tests/Tests/ViewTypes/PopoverTests.swift b/Tests/Tests/ViewTypes/PopoverTests.swift index 7bc52dce..9b31e073 100644 --- a/Tests/Tests/ViewTypes/PopoverTests.swift +++ b/Tests/Tests/ViewTypes/PopoverTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class PopoverTests: XCTestCase { func testPopover() throws { XCTAssertViewIntrospection(of: UIPopoverPresentationController.self) { spies in diff --git a/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift b/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift index 4234c913..b39448a4 100644 --- a/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift +++ b/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift @@ -2,6 +2,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class ProgressViewWithCircularStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformProgressViewWithCircularStyle = UIActivityIndicatorView diff --git a/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift b/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift index 9dac3147..d6b889c2 100644 --- a/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift +++ b/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift @@ -2,6 +2,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class ProgressViewWithLinearStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformProgressViewWithLinearStyle = UIProgressView diff --git a/Tests/Tests/ViewTypes/ScrollViewTests.swift b/Tests/Tests/ViewTypes/ScrollViewTests.swift index e5befb54..caa9c6dc 100644 --- a/Tests/Tests/ViewTypes/ScrollViewTests.swift +++ b/Tests/Tests/ViewTypes/ScrollViewTests.swift @@ -2,6 +2,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class ScrollViewTests: XCTestCase { #if canImport(UIKit) typealias PlatformScrollView = UIScrollView diff --git a/Tests/Tests/ViewTypes/SearchFieldTests.swift b/Tests/Tests/ViewTypes/SearchFieldTests.swift index bd69fae0..ce197d77 100644 --- a/Tests/Tests/ViewTypes/SearchFieldTests.swift +++ b/Tests/Tests/ViewTypes/SearchFieldTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 15, tvOS 15, *) +@MainActor final class SearchFieldTests: XCTestCase { #if canImport(UIKit) typealias PlatformSearchField = UISearchBar diff --git a/Tests/Tests/ViewTypes/SecureFieldTests.swift b/Tests/Tests/ViewTypes/SecureFieldTests.swift index 042c47de..bc2174d6 100644 --- a/Tests/Tests/ViewTypes/SecureFieldTests.swift +++ b/Tests/Tests/ViewTypes/SecureFieldTests.swift @@ -2,6 +2,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class SecureFieldTests: XCTestCase { #if canImport(UIKit) typealias PlatformSecureField = UITextField diff --git a/Tests/Tests/ViewTypes/SheetTests.swift b/Tests/Tests/ViewTypes/SheetTests.swift index cda888a7..6607f96d 100644 --- a/Tests/Tests/ViewTypes/SheetTests.swift +++ b/Tests/Tests/ViewTypes/SheetTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class SheetTests: XCTestCase { #if os(iOS) func testSheet() throws { diff --git a/Tests/Tests/ViewTypes/SliderTests.swift b/Tests/Tests/ViewTypes/SliderTests.swift index db3200bb..cb2c6e9e 100644 --- a/Tests/Tests/ViewTypes/SliderTests.swift +++ b/Tests/Tests/ViewTypes/SliderTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class SliderTests: XCTestCase { #if canImport(UIKit) typealias PlatformSlider = UISlider diff --git a/Tests/Tests/ViewTypes/StepperTests.swift b/Tests/Tests/ViewTypes/StepperTests.swift index e130f1de..bf36df46 100644 --- a/Tests/Tests/ViewTypes/StepperTests.swift +++ b/Tests/Tests/ViewTypes/StepperTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class StepperTests: XCTestCase { #if canImport(UIKit) typealias PlatformStepper = UIStepper diff --git a/Tests/Tests/ViewTypes/TabViewTests.swift b/Tests/Tests/ViewTypes/TabViewTests.swift index 50b558e2..45b8db7f 100644 --- a/Tests/Tests/ViewTypes/TabViewTests.swift +++ b/Tests/Tests/ViewTypes/TabViewTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class TabViewTests: XCTestCase { #if canImport(UIKit) typealias PlatformTabView = UITabBarController diff --git a/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift b/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift index d7bd8791..3506ce46 100644 --- a/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift +++ b/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 14, tvOS 14, *) +@MainActor final class TabViewWithPageStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformTabViewWithPageStyle = UICollectionView diff --git a/Tests/Tests/ViewTypes/TableTests.swift b/Tests/Tests/ViewTypes/TableTests.swift index b30967c8..2c13fe18 100644 --- a/Tests/Tests/ViewTypes/TableTests.swift +++ b/Tests/Tests/ViewTypes/TableTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 16, macOS 12, *) +@MainActor final class TableTests: XCTestCase { #if canImport(UIKit) typealias PlatformTable = UICollectionView diff --git a/Tests/Tests/ViewTypes/TextEditorTests.swift b/Tests/Tests/ViewTypes/TextEditorTests.swift index 6eca638d..17469009 100644 --- a/Tests/Tests/ViewTypes/TextEditorTests.swift +++ b/Tests/Tests/ViewTypes/TextEditorTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 14, macOS 11, *) +@MainActor final class TextEditorTests: XCTestCase { #if canImport(UIKit) typealias PlatformTextEditor = UITextView diff --git a/Tests/Tests/ViewTypes/TextFieldTests.swift b/Tests/Tests/ViewTypes/TextFieldTests.swift index 0e65c99a..fde6895e 100644 --- a/Tests/Tests/ViewTypes/TextFieldTests.swift +++ b/Tests/Tests/ViewTypes/TextFieldTests.swift @@ -2,6 +2,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class TextFieldTests: XCTestCase { #if canImport(UIKit) typealias PlatformTextField = UITextField diff --git a/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift b/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift index f0bad5f5..b124e832 100644 --- a/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift +++ b/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift @@ -3,6 +3,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 16, tvOS 16, macOS 13, *) +@MainActor final class TextFieldWithVerticalAxisTests: XCTestCase { #if canImport(UIKit) && (os(iOS) || os(visionOS)) typealias PlatformTextField = UITextView diff --git a/Tests/Tests/ViewTypes/ToggleTests.swift b/Tests/Tests/ViewTypes/ToggleTests.swift index fae82b4e..765d6ebb 100644 --- a/Tests/Tests/ViewTypes/ToggleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class ToggleTests: XCTestCase { #if canImport(UIKit) typealias PlatformToggle = UISwitch diff --git a/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift b/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift index b91d7857..257a5ba4 100644 --- a/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift @@ -4,6 +4,7 @@ import SwiftUIIntrospect import XCTest @available(macOS 12, *) +@MainActor final class ToggleWithButtonStyleTests: XCTestCase { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformToggleWithButtonStyle = NSButton diff --git a/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift b/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift index 0497518d..499f2c07 100644 --- a/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class ToggleWithCheckboxStyleTests: XCTestCase { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformToggleWithCheckboxStyle = NSButton diff --git a/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift b/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift index 8df51c45..6a3b7758 100644 --- a/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class ToggleWithSwitchStyleTests: XCTestCase { #if canImport(UIKit) typealias PlatformToggleWithSwitchStyle = UISwitch diff --git a/Tests/Tests/ViewTypes/VideoPlayerTests.swift b/Tests/Tests/ViewTypes/VideoPlayerTests.swift index 9658001e..c7019722 100644 --- a/Tests/Tests/ViewTypes/VideoPlayerTests.swift +++ b/Tests/Tests/ViewTypes/VideoPlayerTests.swift @@ -5,6 +5,7 @@ import SwiftUIIntrospect import XCTest @available(iOS 14, tvOS 14, macOS 11, *) +@MainActor final class VideoPlayerTests: XCTestCase { #if canImport(UIKit) typealias PlatformVideoPlayer = AVPlayerViewController diff --git a/Tests/Tests/ViewTypes/ViewControllerTests.swift b/Tests/Tests/ViewTypes/ViewControllerTests.swift index a0a7993b..0f4d6d31 100644 --- a/Tests/Tests/ViewTypes/ViewControllerTests.swift +++ b/Tests/Tests/ViewTypes/ViewControllerTests.swift @@ -3,6 +3,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class ViewControllerTests: XCTestCase { func testViewController() { XCTAssertViewIntrospection(of: PlatformViewController.self) { spies in diff --git a/Tests/Tests/ViewTypes/ViewTests.swift b/Tests/Tests/ViewTypes/ViewTests.swift index 1dcf065e..b7457940 100644 --- a/Tests/Tests/ViewTypes/ViewTests.swift +++ b/Tests/Tests/ViewTypes/ViewTests.swift @@ -2,6 +2,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class ViewTests: XCTestCase { func testView() { XCTAssertViewIntrospection(of: PlatformView.self) { spies in diff --git a/Tests/Tests/ViewTypes/WindowTests.swift b/Tests/Tests/ViewTypes/WindowTests.swift index a6f43ab1..cf474426 100644 --- a/Tests/Tests/ViewTypes/WindowTests.swift +++ b/Tests/Tests/ViewTypes/WindowTests.swift @@ -2,6 +2,7 @@ import SwiftUI import SwiftUIIntrospect import XCTest +@MainActor final class WindowTests: XCTestCase { #if canImport(UIKit) typealias PlatformWindow = UIWindow diff --git a/Tests/UITestsHostApp/StatusBarStyle/RootView.swift b/Tests/UITestsHostApp/StatusBarStyle/RootView.swift index 478b1ec9..ed410cf8 100644 --- a/Tests/UITestsHostApp/StatusBarStyle/RootView.swift +++ b/Tests/UITestsHostApp/StatusBarStyle/RootView.swift @@ -16,6 +16,7 @@ struct RootView: View { } } + @MainActor // for below Swift 6.0 private func navigateToDetail() { let controller = HostingController(rootView: DetailView()) controller.statusBarStyle = .lightContent @@ -44,6 +45,7 @@ struct DetailView: View { dismiss.wrappedValue.dismiss() } + @MainActor // for below Swift 6.0 private func navigateToDetail() { let controller = HostingController(rootView: DetailView()) controller.statusBarStyle = .lightContent