INNER CODE UNIT · Swift

onCancel

carp-dk/flutter-plugins · ios-applications/pedometer-detector/pedometer-detector/ViewController.swift:44

    func onCancel() {
        if (running) {
            pedometer.stopUpdates()
            running = false
        }
    }
}

class StepCounter {
    private let pedometer = CMPedometer()
    private var running = false
    private let available = CMPedometer.isStepCountingAvailable()
    
    func onListen() {
        if (!CMPedometer.isStepCountingAvailable()) {
            print("Step count is not available")
        }
        else if (!running) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…