I have a library that must present a modal view. How do I find the top most visible UIViewController to call presentViewController on? My current app has a table view controller, navigation controllers, and other modal views.
The best I could find is this, but this results in unbalanced calls to begin/end appearance transitions for <UIViewController: 0x...> followed by a EXC_BAD_ACCESS. (This was when there was another modal view controller at top.)