I'm trying to understand why this snippet type checks successfully but when building for tvOS
I get an Undefined symbol: _OBJC_CLASS_$_ASWebAuthenticationSession
error?
@available(iOS 12.4, *)
@available(tvOS, unavailable)
class TestClass {
private var authenticationSession: ASWebAuthenticationSession?
func test() {
self.authenticationSession = ASWebAuthenticationSession(
url: URL(string: "https://test.com")!,
callbackURLScheme: nil,
completionHandler: { _, _ in }
)
}
}
I was under the impression that the @available(tvOS, unavailable)
would take care of excluding this entire class from being built for the specific platform? I'm trying to avoid using #if os(tvOS)
if I can help it.
Thanks!
Rog