Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Rotate view with device

I was wondering how I would rotate the view on the iPhone as the user tilts the device using the gyro or accelerometer. I am unable to find a tutorial but am not sure what I should be searching for.

4 Answers

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

Hey Tom Coomer,

I've put a little video for you together to rotate a view using accelerometers.

Here's the project in the initial state and this is the finished project.

Generally when working with transformations / angles in computing you have to use radians. All you need to remember is 360 degrees is equal to 2 Pi.

Hope this helps!

Regards,
Andrew

thanks Andrew Chalkley .

That's excellent! Thank you very much!

Nice work, very helpfull

You guys rock <3

awesome