TimOliver / TOWebViewController

A view controller class for iOS that allows users to view web pages directly within an app.
http://www.timoliver.com.au/2014/07/27/towebviewcontroller-an-open-source-web-viewer-for-ios/
Other
1.48k stars 211 forks source link

applicationBarButtonItems #99

Closed sm2x closed 6 years ago

sm2x commented 8 years ago

Goals

webViewController is the main screen, add a custom button to call a function that opens another view controller.

Expected Results

Switch to another view controller upon clicking the button.

Actual Results

TimOliver commented 8 years ago

... what were the actual results?

sm2x commented 8 years ago

Actual Results Attempt to present <uinavigationcontroller: 0x7fba8c893600=""> on <viewcontroller: 0x7fba8bca8fd0=""> whose view is not in the window hierarchy!

I've posted my issue on your site actually. Can you provide an example on how to properly handle 'applicationBarButtonItems' please.

TimOliver commented 6 years ago

There's nothing too special about applicationBarButtonItems. It needs to be an array of UIBarButtonItem objects, which then depending on the screen size will either be inserted at the top or bottom of the screen along with the other buttons.

That error message sounds like you might be trying to present a view controller at the wrong time, but I don't think that's caused by an issue in this library.