From da727897b2730ffcf1bf3d2fa1c80cea131d9067 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Sun, 25 Feb 2024 13:18:45 +0000 Subject: [PATCH] WIP WIP WIP --- README.md | 1 - Sources/ViewTypes/SignInWithAppleButton.swift | 48 +++++------------- Tests/Tests.xcodeproj/project.pbxproj | 6 --- .../SignInWithAppleButtonTests.swift | 50 ------------------- 4 files changed, 13 insertions(+), 92 deletions(-) delete mode 100644 Tests/Tests/ViewTypes/SignInWithAppleButtonTests.swift diff --git a/README.md b/README.md index a54a0ad0..56673625 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,6 @@ Introspection - [`.searchable`](https://swiftpackageindex.com/siteline/swiftui-introspect/main/documentation/swiftuiintrospect/searchfieldtype) - [`SecureField`](https://swiftpackageindex.com/siteline/swiftui-introspect/main/documentation/swiftuiintrospect/securefieldtype) - [`.sheet`](https://swiftpackageindex.com/siteline/swiftui-introspect/main/documentation/swiftuiintrospect/sheettype) -- [`SignInWithAppleButton`](https://swiftpackageindex.com/siteline/swiftui-introspect/main/documentation/swiftuiintrospect/SignInWithAppleButtonType) - [`Slider`](https://swiftpackageindex.com/siteline/swiftui-introspect/main/documentation/swiftuiintrospect/slidertype) - [`Stepper`](https://swiftpackageindex.com/siteline/swiftui-introspect/main/documentation/swiftuiintrospect/steppertype) - [`Table`](https://swiftpackageindex.com/siteline/swiftui-introspect/main/documentation/swiftuiintrospect/tabletype) diff --git a/Sources/ViewTypes/SignInWithAppleButton.swift b/Sources/ViewTypes/SignInWithAppleButton.swift index bc53d1d0..76eb35ce 100644 --- a/Sources/ViewTypes/SignInWithAppleButton.swift +++ b/Sources/ViewTypes/SignInWithAppleButton.swift @@ -72,42 +72,20 @@ import SwiftUI /// ``` public struct SignInWithAppleButtonType: IntrospectableViewType {} -#if canImport(AuthenticationServices) -import AuthenticationServices - extension IntrospectableViewType where Self == SignInWithAppleButtonType { - public static var signInWithAppleButton: Self { .init() } -} + @available( + *, + unavailable, + message: """ + Due to a mysterious bug on Apple's part that may cause a complete + app hang, the unfortunate decision has been made to remove support + for `SignInWithAppleButton` introspection. + + We apologize for this inconvenience. -extension iOSViewVersion { - @available(*, unavailable, message: "SignInWithAppleButton isn't available on iOS 13") - public static let v13 = Self.unavailable() - public static let v14 = Self(for: .v14) - public static let v15 = Self(for: .v15) - public static let v16 = Self(for: .v16) - public static let v17 = Self(for: .v17) -} - -extension tvOSViewVersion { - @available(*, unavailable, message: "SignInWithAppleButton isn't available on tvOS 13") - public static let v13 = Self.unavailable() - public static let v14 = Self(for: .v14) - public static let v15 = Self(for: .v15) - public static let v16 = Self(for: .v16) - public static let v17 = Self(for: .v17) -} - -extension macOSViewVersion { - @available(*, unavailable, message: "SignInWithAppleButton isn't available on macOS 10.15") - public static let v10_15 = Self.unavailable() - public static let v11 = Self(for: .v11) - public static let v12 = Self(for: .v12) - public static let v13 = Self(for: .v13) - public static let v14 = Self(for: .v14) -} - -extension visionOSViewVersion { - public static let v1 = Self(for: .v1) + More details can be found at https://github.com/siteline/swiftui-introspect/issues/400 + """ + ) + public static var signInWithAppleButton: Self { .init() } } #endif -#endif diff --git a/Tests/Tests.xcodeproj/project.pbxproj b/Tests/Tests.xcodeproj/project.pbxproj index 36323ca4..16c817f3 100644 --- a/Tests/Tests.xcodeproj/project.pbxproj +++ b/Tests/Tests.xcodeproj/project.pbxproj @@ -116,8 +116,6 @@ D5ADFACC2A4A22AE009494FD /* SheetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5ADFACB2A4A22AE009494FD /* SheetTests.swift */; }; D5ADFACE2A4A3482009494FD /* FullScreenCoverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5ADFACD2A4A3482009494FD /* FullScreenCoverTests.swift */; }; D5ADFAD02A4A3E54009494FD /* PopoverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5ADFACF2A4A3E54009494FD /* PopoverTests.swift */; }; - D5ADFAD22A4A41CB009494FD /* SignInWithAppleButtonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5ADFAD12A4A41CB009494FD /* SignInWithAppleButtonTests.swift */; }; - D5ADFAD32A4A4649009494FD /* SignInWithAppleButtonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5ADFAD12A4A41CB009494FD /* SignInWithAppleButtonTests.swift */; }; D5ADFAD42A4A4653009494FD /* FullScreenCoverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5ADFACD2A4A3482009494FD /* FullScreenCoverTests.swift */; }; D5ADFAD52A4A4653009494FD /* SheetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5ADFACB2A4A22AE009494FD /* SheetTests.swift */; }; D5ADFAD62A4A4653009494FD /* VideoPlayerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D503B2AB2A49BFE300027F5F /* VideoPlayerTests.swift */; }; @@ -223,7 +221,6 @@ D5ADFACB2A4A22AE009494FD /* SheetTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SheetTests.swift; sourceTree = ""; }; D5ADFACD2A4A3482009494FD /* FullScreenCoverTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FullScreenCoverTests.swift; sourceTree = ""; }; D5ADFACF2A4A3E54009494FD /* PopoverTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopoverTests.swift; sourceTree = ""; }; - D5ADFAD12A4A41CB009494FD /* SignInWithAppleButtonTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignInWithAppleButtonTests.swift; sourceTree = ""; }; D5AEC33E2A66F31F0015AC1D /* UITestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITestCase.swift; sourceTree = ""; }; D5AEC3412A66F6470015AC1D /* RootView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = ""; }; D5AEC3422A66F6470015AC1D /* HostingController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HostingController.swift; sourceTree = ""; }; @@ -399,7 +396,6 @@ D57506A12A281B9C00A628E4 /* SearchFieldTests.swift */, D57E66F92A6956EB0092F43E /* SecureFieldTests.swift */, D5ADFACB2A4A22AE009494FD /* SheetTests.swift */, - D5ADFAD12A4A41CB009494FD /* SignInWithAppleButtonTests.swift */, D58119CF2A23A62C0081F853 /* SliderTests.swift */, D58119D12A23A77C0081F853 /* StepperTests.swift */, D575069F2A27FC0400A628E4 /* TableTests.swift */, @@ -728,7 +724,6 @@ D534D4DD2A4A596200218BFB /* WindowTests.swift in Sources */, D50E2F662A2B9F6600BAFB03 /* DatePickerWithWheelStyleTests.swift in Sources */, D50E2F672A2B9F6600BAFB03 /* ListWithInsetGroupedStyleTests.swift in Sources */, - D5ADFAD32A4A4649009494FD /* SignInWithAppleButtonTests.swift in Sources */, D50E2F682A2B9F6600BAFB03 /* FormWithGroupedStyleTests.swift in Sources */, D5ADFAD52A4A4653009494FD /* SheetTests.swift in Sources */, D50E2F692A2B9F6600BAFB03 /* ListWithPlainStyleTests.swift in Sources */, @@ -839,7 +834,6 @@ D57506882A27CB9800A628E4 /* FormTests.swift in Sources */, D58119C82A22AC130081F853 /* ToggleTests.swift in Sources */, D58119D22A23A77C0081F853 /* StepperTests.swift in Sources */, - D5ADFAD22A4A41CB009494FD /* SignInWithAppleButtonTests.swift in Sources */, D58119DA2A23B7700081F853 /* ColorPickerTests.swift in Sources */, D575068E2A27D4DC00A628E4 /* ToggleWithButtonStyleTests.swift in Sources */, D5F0BE6A29C0DC4900AD95AB /* PlatformVersionTests.swift in Sources */, diff --git a/Tests/Tests/ViewTypes/SignInWithAppleButtonTests.swift b/Tests/Tests/ViewTypes/SignInWithAppleButtonTests.swift deleted file mode 100644 index 22b440cf..00000000 --- a/Tests/Tests/ViewTypes/SignInWithAppleButtonTests.swift +++ /dev/null @@ -1,50 +0,0 @@ -#if canImport(AuthenticationServices) -import AuthenticationServices -import SwiftUI -import SwiftUIIntrospect -import XCTest - -@available(iOS 14, tvOS 14, macOS 11, *) -final class SignInWithAppleButtonTests: XCTestCase { - typealias PlatformSignInWithAppleButton = ASAuthorizationAppleIDButton - - func testSignInWithAppleButton() throws { - guard #available(iOS 14, tvOS 14, macOS 11, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformSignInWithAppleButton.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - - VStack { - SignInWithAppleButton(.continue, onRequest: { _ in }, onCompletion: { _ in }) - .introspect( - .signInWithAppleButton, - on: .iOS(.v14, .v15, .v16, .v17), .tvOS(.v14, .v15, .v16, .v17), .macOS(.v11, .v12, .v13, .v14), .visionOS(.v1), - customize: spy0 - ) - - SignInWithAppleButton(.signIn, onRequest: { _ in }, onCompletion: { _ in }) - .introspect( - .signInWithAppleButton, - on: .iOS(.v14, .v15, .v16, .v17), .tvOS(.v14, .v15, .v16, .v17), .macOS(.v11, .v12, .v13, .v14), .visionOS(.v1), - customize: spy1 - ) - - SignInWithAppleButton(.signUp, onRequest: { _ in }, onCompletion: { _ in }) - .introspect( - .signInWithAppleButton, - on: .iOS(.v14, .v15, .v16, .v17), .tvOS(.v14, .v15, .v16, .v17), .macOS(.v11, .v12, .v13, .v14), .visionOS(.v1), - customize: spy2 - ) - } - } extraAssertions: { - XCTAssertNotIdentical($0[safe: 0], $0[safe: 1]) - XCTAssertNotIdentical($0[safe: 0], $0[safe: 2]) - XCTAssertNotIdentical($0[safe: 1], $0[safe: 2]) - } - } -} -#endif