Despite the documentation saying The maximum frequency at which you can request updates is hardware-dependent but is usually at least 100 Hz.
it looks to me like the maximum sample rate is still 100Hz.
My approach to figure out was taking the existing sample code for CoreMotion called MotionGraphs and adapting the startUpdates
function to look like this:
func startUpdates() {
guard let motionManager = motionManager, motionManager.isGyroAvailable else { return }
sampleCount = 0
let methodStart = Date()
motionManager.gyroUpdateInterval = TimeInterval(1.0/100000.0) // Hardcoded to something verfy fast
motionManager.startGyroUpdates(to: .main) { gyroData, error in
self.sampleCount += 1
//...view update code removed
if (self.sampleCount >= 100) {
let methodFinish = Date()
let executionTime = methodFinish.timeIntervalSince(methodStart)
print("Duration of 100 Gyro samples: \(executionTime)")
self.stopUpdates()
}
}
}
I also set motionManager.deviceMotionUpdateInterval = TimeInterval(1.0/100000.0)
for good measure (in case it is a global rate).
With that code in place for both Accelerometer and Gyroscope I confirm that an iPhone 8 on iOS 11.4 still maxes out right around 100Hz for both.
Duration of 100 Accelerometer samples: 0.993090987205505
Duration of 100 Accelerometer samples: 0.995925068855286
Duration of 100 Accelerometer samples: 0.993505954742432
Duration of 100 Accelerometer samples: 0.996459007263184
Duration of 100 Accelerometer samples: 0.996203064918518
Duration of 100 Gyro samples: 0.989820957183838
Duration of 100 Gyro samples: 0.985687971115112
Duration of 100 Gyro samples: 0.989449977874756
Duration of 100 Gyro samples: 0.988754034042358