CLLocationManager AuthorizationStatus callback?

后端 未结 6 1833
天命终不由人
天命终不由人 2021-02-01 02:38

In my app I have a tab called \"Discover\". The Discover tab will use the users current location to find \"stuff\" near them. Instead of presenting the user with a generic Autho

6条回答
  •  情话喂你
    2021-02-01 03:25

    Swift 3

    func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
        if (status == CLAuthorizationStatus.denied) {
            // The user denied authorization
        } else if (status == CLAuthorizationStatus.authorizedAlways) {
            // The user accepted authorization
        } 
    }
    

提交回复
热议问题