Trying to implement a type that conforms to ASWebAuthenticationPresentationContextProviding
. This is now causing errors with Xcode 14. With the following implementation:
final class PresentationContextProvider: NSObject, ASWebAuthenticationPresentationContextProviding {
func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
return ASPresentationAnchor()
}
}
I get this compilation error:
Call to main actor-isolated initializer 'init()' in a synchronous nonisolated context
So I can annotate the class or method with @MainActor
, but then I get this warning:
Main actor-isolated instance method 'presentationAnchor(for:)' cannot be used to satisfy nonisolated protocol requirement
Is there a way to fix this?