0

Trying to display a web page in iOS, and I am having trouble implementing WKWebkit.

ViewController.h

@import WebKit;

@interface ViewController : BaseViewController

@property (retain, nonatomic) WKWebView *webView;

@end

ViewController.m

@interface ViewController ()

@property (strong, nonatomic) IBOutlet UIView *containerView;

@property (strong, nonatomic) IBOutlet NSLayoutConstraint *fieldViewBottomConstraintY;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *centerCredentialsConstraintY;


@end

@implementation ViewController
@synthesize webView;
-(void) viewDidLoad {
    [super viewDidLoad];
    webView = [[WKWebView alloc] initWithFrame:[[self view] bounds]];
    NSURL *url = [NSURL URLWithString:@"https://www.google.com"];
    NSURLRequest *urlReq = [NSURLRequest requestWithURL:url];

    [webView loadRequest:urlReq];
    [self.view addSubview:webView];
    [self setupConfiguration];
    // Do any additional setup after loading the view.
}

@end

I'm getting this error:

Class Unavailable: WKWebView before iOS 11.0 (NSCoding support was broken in previous versions)

I understand that this question is not very focused, but I'm on a tight schedule, still getting the hang of objective-c and iOS, and I haven't found a lot of implementable solutions, so I need help in solving this issue. I appreciate any help offered.

anks
  • 3
  • 3

1 Answers1

0

This is from a project that requires a minimum iOS version of iOS 12

Set your minimum iOS Deployment Target here:

enter image description here

and, check that it auto-updates here (and change it if not):

enter image description here

Set it to the minimum version you need to support.

DonMag
  • 69,424
  • 5
  • 50
  • 86