I have a webview and when you click a link on a webpage, I want the screen to show an image for the duration of the time that the page is laoding (it sounds weird, but it's for a good reason).
I'm new to XCode and have done a few tutorials, but it's still murky to me how to make things happen in XCode (and objective C in general).
It seems that the process should be this - in the webViewDidStartLoad method, I call a class, which is a UIImageView. In that class is the image. And in webViewDidFinishLoad, I then either remove the image, or lower it on the stack.
I just am confused as to all the things you need to do to make this happen. Here's what I have so far:
A class called loadingView which has a method in it called showLoadingScreen. In this method I have the code:
UIView *view=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
[view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"Icon-76.png"]]];
Then I go to the storyboard and insert a new UIView over the webView, and give it the class loadingView. And then I control clicked from this UIView to the ViewController.h, and dropped it in the view controller, creating the code:
@property (strong, nonatomic) IBOutlet UILabel *loadingPageView;
and imported loadingView.h.
Is this correct? If yes, then I need to put this method into webViewDidStartLoad, but I can't figure out what code to put there. It seems I to do something like:
[self.view addSubview:imageView];
But I don't know how to customize this to my code.