Basically i have a WebView
on SecondViewController
and I wish for the WebView
to be visible on every view like a tab bar and fully controllable on each view.
Please note the WebView
will be on a webpage with a online slideshow so I cannot simply reload on each view
Also in the SecondViewController
I have
- (void)webViewDidFinishLoad:(UIWebView *)YouTubePlayer {
In iOS UIViewControllers are expected to manage an entire "screen" worth of content so it's not normal to try to share a single view across many view controllers. Trying to have UIViewControllers whose views only manage part of their window is problematic and will result in unexpected behavior as UIKit will not send messages like -viewWillAppear to all view controllers with visible views. Instead you would normally create a single UIViewController whose view includes that web view and whatever other views compose your tab like interface. Alternately you could have a hierarchy of many view controllers and add a single web view as a subview of all of them. You would then pull your web view delegate behavior out into some non-UIViewController controller class to manage the behavior of the web view.
I'd just set up a singleton UIWebView and add it to each view-controller-view when that view controller is about to become visible. Here's one way to do it: