Hello, I am using GameKit for the first time, since the new AccessPoint was announced on WWDC 2020, but cant figure out how to hide the AP outside of main menu. I am getting this exception when calling .isActive = false -> Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1ae03f6a4)
How am I supposed to hide it? Thanks!
XCode Version 12.0 beta 5 (12A8189h)
How am I supposed to hide it? Thanks!
XCode Version 12.0 beta 5 (12A8189h)
Code Block struct ContentView: View { let localPlayer = GKLocalPlayer.local func authenticateUser() { localPlayer.authenticateHandler = { vc, error in guard error == nil else { print(error?.localizedDescription ?? "") return } GKAccessPoint.shared.location = .topLeading GKAccessPoint.shared.showHighlights = false GKAccessPoint.shared.isActive = localPlayer.isAuthenticated print(localPlayer.isAuthenticated) } } var body: some View { NavigationView { NavigationLink(destination: Text("asdd")) { Text("Play Game") .onDisappear { print("onDisappear") print("isVisible: \(GKAccessPoint.shared.isVisible)") GKAccessPoint.shared.isActive = false /* THIS CRASHES THE APP */ } } } .navigationViewStyle(StackNavigationViewStyle()) .onAppear { print("onAppear") authenticateUser() } } }