Xcode 6 + iOS 8 SDK but deploy on iOS 7 (UIWebKit & WKWebKit)

来源:互联网 发布:yunos删除软件 编辑:程序博客网 时间:2024/05/24 06:36


http://stackoverflow.com/questions/25341238/xcode-6-ios-8-sdk-but-deploy-on-ios-7-uiwebkit-wkwebkit


First, go to your Project, click on General, scroll down to Linked Frameworks and Libraries, and add WebKit.framework as Optional. (I also did it for UIKit.framework) See screenshot:


Class wkWebViewClass = NSClassFromString(@"WKWebView");if(wkWebViewClass) {    WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init];    // ...    wkWebView = [[wkWebViewClass alloc] initWithFrame:frame configuration:config];    [self.view addSubview:wkWebView];}else {    uiWebView = [[UIWebView alloc] initWithFrame:frame];    [self.view addSubview:uiWebView];}

0 0
原创粉丝点击