Date
1 - 3 of 3
CMSensorRecorder.accelerometerDataSince(_:) missing?
Fritz Anderson
Xcode 11, targeted at 13 or 12.x (no difference to this issue).
I need to accumulate accelerometer data from Core Motion over long periods of time (I’m aware of the 12-hour / 3-day limits). The class reference includes func accelerometerDataSince(_ identifier: UInt64) -> CMSensorDataList? which would be ideal, because you can keep the batch ID for the last records you retrieved, pass it to this func, and get only and exactly the subsequent records. No calculations or races. Xcode 11 won’t complete the symbol; it raises an error when I try to use it anyway; and the derived interface for the class doesn’t include it. On top of this, the Class Reference lists the function. On top of THAT, the headword for the function is “accelerometerDataSince:” — ObjC idiom. --- The alternative, accelerometerData(from:to:), looks error-prone. You could pass distant-past (or first-run) to “from”, and then the latest-reported timestamp from the previous fetch (plus a millisecond, the two limits are _inclusive_). But the docs say there is a lag of up to 3 minutes between recording a record and its availability through the API: (… to: Date()) won’t get you all the data already captured. If I pass only the last-_reported_ date (plus a millisecond) to the from: in the next call, that should be fine. I’d expect the request for records in the 3-minute gap not to taint the “from” in the next request. But I’m not paid to be optimistic. --- Am I confined to this accelerometerData(from:to:) dance, or am I missing something? The compiler and the generated interface seem to be pretty definitive. — F
|
|
Quincey Morris
On Sep 25, 2019, at 14:49 , Fritz Anderson <anderson.fritz@...> wrote:
It’s not in the Obj-C header file either. (iOS 13.0 SDK in Xcode 11) This just looks like an error in the documentation. Perhaps this method existed for a while in the beta period for 13.0. I checked in the iOS 13.1 SDK (Xcode 11.1 beta), but it’s also not there.
|
|
Fritz Anderson
I found one reference for iOS 10:
toggle quoted messageShow quoted text
but on inspection it’s clear it’s derived from a class dump, not the documented interface. Hence accursed for distribution. Off to Feedback Assistant to ask that the API be exposed. — F
|
|