Relative Content

Tag Archive for iosswiftdelegates

Only the didFetchResult deligate method is not invoked in Sensorkit

func sensorReader(_ reader: SRSensorReader, fetching fetchRequest: SRFetchRequest, didFetchResult result: SRFetchResult<AnyObject>) -> Bool { print(“sensorReader(_:fetching:didFetchResult:) method called”) guard let ambientSample = result.sample as? SRAmbientLightSample else { print(“Unexpected sample type: (type(of: result.sample))”) return true } let luxValue = ambientSample.lux.value let timestamp = Date(timeIntervalSinceReferenceDate: result.timestamp.rawValue) print(“Ambient light sample: lux value = (luxValue) lux, timestamp = (timestamp)”) // Check […]