// // RulesWebViewController.m // Freestyle Judo // // Created by Vincente D'Ingianni on 10/6/13. // Copyright (c) 2013 Binary Systems, Inc. All rights reserved. // #import "RulesWebViewController.h" @implementation RulesWebViewController @synthesize webView = _webView; @synthesize HelpToolbar = _HelpToolbar; @synthesize DoneButton = _DoneButton; - (void)setValue:(id)value forUndefinedKey:(NSString *)key { if ([key isEqualToString:@"webView"]) { return; } [super setValue:value forUndefinedKey:key]; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init]; self.webView = [[WKWebView alloc] initWithFrame:self.view.bounds configuration:config]; self.webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self.view addSubview:self.webView]; } - (void) viewWillAppear: (BOOL)animated { [super viewWillAppear:animated]; NSString *path = [[NSBundle mainBundle] pathForResource:@"FREESTYLE_JUDO_HANDBOOK" ofType:@"pdf"]; NSURL *targetURL = [NSURL fileURLWithPath:path]; NSURLRequest *request = [NSURLRequest requestWithURL:targetURL]; [self.webView loadRequest:request]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (IBAction)goBack:(UIBarButtonItem *)sender { [self dismissViewControllerAnimated:YES completion:nil]; } @end