Short: I don't know how to extract the CMRecordedAccelerometerData from the CMSensorDataList after getting one from the CMSensorRecorder.
Apple isn't providing any documentation, yet.
Maybe someone has a hint for me? ;)
func startMovementDetection(){
var accDataList = self.cmSensorRecorder!.accelerometerDataFrom(self.startDate, to: NSDate()) as CMSensorDataList
CMRecordedAccelerometerData() //that's the class i want to extract from CMSensorDataList
}
Okay, problem solved with this one here: NSFastEnumeration in Swift
With Swift 3.0 it changes to:
extension CMSensorDataList: Sequence {
public func makeIterator() -> NSFastEnumerationIterator {
return NSFastEnumerationIterator(self)
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…