Skip to content

Commit caaf069

Browse files
committed
Fix Xcode 26 protocol-witness availability error
Xcode 26 tightened protocol-witness availability rules. When one class satisfies two presentation-context protocols of differing availability — ASWebAuthenticationPresentationContextProviding (iOS 12+) and ASAuthorizationControllerPresentationContextProviding (iOS 13+) — the shared 'presentationAnchor(for:)' witnesses can no longer be guarded with @available individually on the same type. Move each protocol conformance into its own extension with the appropriate @available attribute. The class itself stays unannotated (callers in ASWebServiceAuthentication and AppleSignInWebService are already iOS 12+/13+), and the framework's iOS 10 deployment target is preserved.
1 parent dbe7c1d commit caaf069

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

IFTTT SDK/AuthenticationSessionPresentationContextProvider.swift

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77

88
import AuthenticationServices
99

10-
/// A class that conforms to `ASWebAuthenticationPresentationContextProviding`.
11-
class AuthenticationSessionContextPresentationProvider: NSObject, ASWebAuthenticationPresentationContextProviding, ASAuthorizationControllerPresentationContextProviding {
10+
class AuthenticationSessionContextPresentationProvider: NSObject {
1211
/// The window context that the presentation of the authentication should take place in.
1312
private let presentationContext: UIWindow
14-
13+
1514
/// Creates an instance of `AuthenticationSessionContextProvider`.
1615
///
1716
/// - Parameters:
@@ -20,13 +19,17 @@ class AuthenticationSessionContextPresentationProvider: NSObject, ASWebAuthentic
2019
self.presentationContext = presentationContext
2120
super.init()
2221
}
23-
24-
@available(iOS 12.0, *)
22+
}
23+
24+
@available(iOS 12.0, *)
25+
extension AuthenticationSessionContextPresentationProvider: ASWebAuthenticationPresentationContextProviding {
2526
func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
2627
return presentationContext
2728
}
28-
29-
@available(iOS 13.0, *)
29+
}
30+
31+
@available(iOS 13.0, *)
32+
extension AuthenticationSessionContextPresentationProvider: ASAuthorizationControllerPresentationContextProviding {
3033
func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor {
3134
return presentationContext
3235
}

0 commit comments

Comments
 (0)