user9536730
user9536730

Reputation: 21

How to initialize CMAttitude

Quick question. I want the user to hold the iPhone upright and reset this orientation. I do this by using

currentAttitude.multiply(byInverseOf attitude: resetAttitude)

resetAttitude is being saved as soon as the user presses the "reset Button". Now I want to save the CMAttitude so I can reset it right from the start without requesting the user to press the reset button. I'd take my iPhone, put it in the right upright position and save this CMAttitude and put it in the source so I can use it for resetting right from the start.

1.How can I save the current CMAttitude?

2.How can I init a CMAttitude object from the saved data? There is only

CMAttitude(coder: NSCoder)

available.

Upvotes: 2

Views: 233

Answers (0)

Related Questions