clayallsopp/formotion — pull request #57 by macfanatic (2012-12-18 21:18:03+00:00)
Title: Intelligently pick the top most view controller to present UIImagePicker...

Currently, if you have an `:image` row inside a form that is shown modally, the `UIActionSheet` is displayed, but the `UIImagePickerController` can't do it's thing b/c it's being asked to be presented from a view controller that's not on the screen.

I was able to reproduce this with a `UITabBarController` presenting a `UINavigationController` with a `UITableViewController`...showing a plain controller modally.

The `UIImagePickerController` yells b/c the `UITabBarController` isn't shown on the screen.

`BW::Device.camera.any.picture()` accepts a view controller argument, or nil. This pull request will pass in the top most present view controller (if it exists), or nil if it doesn't, in which both cases we have the desired effect of getting the `UIImagePickerController` to present itself.