##Virtual Keyboard https://developer.apple.com/documentation/coremotion/cmmagnetometerdata https://developer.apple.com/documentation/coremotion
Above are links to reading more about the CoreMotion framework within apple. With CoreMotion we can access many sensors within our apple device. We can process accelerometer, gyroscope, pedometer, and environment-related events. Taking data relative to your device, you should come up with your own algorithm to allow correct mapping onto your device screen.