TLDR - Goal: Build a simple compass app
I'm brand new at coding and I'm challenging myself to try and learn something new. I've studied up on the main components of coding and followed a few simple tutorials. I've also been learning a lot on here.
However, I'm still having a hard time understanding how to retrieve the magnetometer data. I've read the Apple documentation in Obj-C and Swift (with Swift being new, compass tutorials are almost exclusively done in Obj-C), but they are still confusing, to someone who is as new as I am, when trying to convert that over to swift.
I've looked up similar questions and even tried to run the code from them and I usually get at least 1 error saying something is expected or missing or not defined. Preventing me from even testing it... Which has led me down a long road of trying to understand Xcode's error syntax.
I know I have to test on my device, otherwise I won't see any data. I also know I have to import CoreMotion, then use CMMotionManager as sort of a 'gateway' to retrieving the data, and then define the update intervals. But I'm unclear on how to go about structuring that part of code that actually does the retrieving of the data.
In short I just want to have the barebones simplest route to retrieving the data and have it print while I move my phone. Dumbed down explanations of the process are welcome. I promise I won't be offended, in fact I'd be delighted.
Anyone in a teaching mood?