I have two buttons in my VC and currently they both are connected to their respective pdf files. There is another button, Push, that goes to the rootviewcontroller. In the RVC I have a UIWebView. How can I make it so that if I push button A, a.pdf is displayed and b.pdf for button B?
I guess, how do I make the rvc listen for this event correctly?
Snippet for UIWebView inside my RVC.m
pdfViewer=[[UIWebView alloc]initWithFrame:CGRectMake(420, 190, 340, 445)];
NSString *path = [[NSBundle mainBundle] pathForResource:@"nameofpdf" ofType:@"pdf"];
NSURL *targetURL = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
[pdfViewer setAlpha: .8];
[pdfViewer loadRequest:request];
[self.view addSubview:pdfViewer];
And button Push in my VC
-(IBAction)pushButtonPressed{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
RootViewController *RVC = [storyboard instantiateViewControllerWithIdentifier:@"Root"];
[UIApplication sharedApplication].delegate.window.RootViewController = RVC;
}
Wrap up: I first press A or B, then press Push which will bring me to the RVC which will display pdfA or pdfB.