I am using AV Foundation for a photo capture app. After the user takes a photo, I set my main layer's sublayer's contents property to equal the captured photo aka imageData:
subLayer.contents = (id)[UIImage imageWithData:imageData].CGImage;
This all works perfectly and the photo does display on the screen.
The only problem is the photo displays rotated at 90 degrees.
Any idea how I can display the photo correctly instead of being rotated?
Here is how the photo looks when the user is capturing it:
But then here is how it looks when I display it as the sublayer: