Okay, I changed things up a little for testing.
Progress:
// BrowserViewController.m
#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
@interface IABrowser : UIViewController {
UIWindow *window;
}
@property (nonatomic, strong) WKWebView *webView;
@end
@implementation IABrowser
- (void)viewDidLoad {
[super viewDidLoad];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
window = [[ UIApplication sharedApplication] keyWindow];
#pragma clang diagnostic pop
self.webView = [[WKWebView alloc] initWithFrame:self.view.bounds];
[ [ [ window subviews ] objectAtIndex: 0 ] addSubview: self.webView];
// [self.view addSubview:self.webView];
NSLog(@"viewDidLoad");
}
- (void)loadURL:(NSString *)urlString {
NSURL *url = [NSURL URLWithString:urlString];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:request];
NSLog(@"loadURL");
}
@end
When I click the button in the UI that should spawn this webView I get the log message that says 'loadURL' but nothing actually appears on screen. I know I'm missing something simple but I truly don't know what it is.
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: