rubymotion-community / BubbleWrap

Cocoa wrappers and helpers for RubyMotion (Ruby for iOS and OS X) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull requests
Other
1.18k stars 208 forks source link

Photo library orientation #394

Closed pollingj closed 10 years ago

pollingj commented 10 years ago

I've just switched my code in my iPad app to use the Photo library picker, rather than just using the Camera. The app is a landscape only app and I'm getting the following crash now

Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES

Is there something I need to be doing within BubbleWrap to fix this?

clayallsopp commented 10 years ago

Did you searching for this error? It's because the photo picker only works in portrait mode (see http://stackoverflow.com/questions/18998607/ios-7-landscape-only-app-cant-access-photo-library)

You could also try:

BW::Camera.photo_library.popover_from(a_view_in_your_app). picture(...) do |...|
end

this will use a UIPopoverController to present the picker, instead of a full-screen modal view. Not sure if this will fix your error.

pollingj commented 10 years ago

@clayallsopp thanks for this. Yeah, I knew the issue, but I wasn't entirely certain what I needed to do within BubbleWrap to get around the issue. (Sorry it was a bit of a beginners question)