now) { (data, error) in if let code = error?._code, code == Int(CMErrorMotionActivityNotAuthorized.rawValue) { // ະڐՄ } if CMPedometer.isStepCountingAvailable() { switch CMPedometer.authorizationStatus() { case .notDetermined: break case .restricted: break case .denied: break case .authorized: break } }
// ϝΠϯεϨου } ↑OperationQueue.mainσʔλऔಘͷͨͼʹ UIεϨουΛϒϩοΩϯά͢Δ͜ͱʹͳΔɻɻ Because the processed events might arrive at a high rate, using the main operation queue is not recommended. https://developer.apple.com/documentation/coremotion/cmmotionmanager/1615968-startmagnetometerupdates