Noob IOS Dev はエラーを特定できません。スレッド 1 を助けてください: EXC_BREAKPOINT (code=1,subcode=0x1003591fc)
var pedometer :CMPedometer!
var stepCount :Int = 0
@IBOutlet var labelSteps: UILabel!
@IBAction func btnStart(_ sender: Any) {
*Pedometer*
if CMPedometer.isStepCountingAvailable() {
self.pedometer.startUpdates(from: NSDate() as Date, withHandler: {
data, error in
if data != nil {
// Add to existing counts
self.stepCount += (data?.numberOfSteps as! Int)
self.labelSteps.text = "\(self.stepCount)"
}
})
}
}
@IBAction func btnStop(_ sender: Any) {
//self.labelSteps.text = "0"
//self.pedometer.stopUpdates()
print("Stop")
}
ありがとう。すぐに応答を期待しています。