Skip to content

Commit ad8b2e5

Browse files
committed
Bug fix.
1 parent 19804d3 commit ad8b2e5

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

Pod/Classes/M2DWebViewController/M2DWebViewController.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,24 +106,22 @@ - (void)viewDidLoad
106106
[super viewDidLoad];
107107
self.title = NSLocalizedString(@"Loading...", @"");
108108

109-
#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_8_0
110-
type_ = M2DWebViewTypeUIKit;
111-
#endif
109+
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_7_1) {
110+
type_ = M2DWebViewTypeUIKit;
111+
}
112112

113113
if (type_ == M2DWebViewTypeUIKit) {
114114
webView_ = [[UIWebView alloc] initWithFrame:self.view.bounds];
115115
[(UIWebView *)webView_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
116116
((UIWebView *)webView_).delegate = self;
117117
[(UIWebView *)webView_ loadRequest:[NSURLRequest requestWithURL:url_]];
118118
}
119-
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0
120119
else if (type_ == M2DWebViewTypeWebKit || type_ == M2DWebViewTypeAutoSelect) {
121120
webView_ = [[WKWebView alloc] initWithFrame:self.view.bounds];
122121
[(WKWebView *)webView_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
123122
((WKWebView *)webView_).navigationDelegate = self;
124123
[(WKWebView *)webView_ loadRequest:[NSURLRequest requestWithURL:url_]];
125124
}
126-
#endif
127125

128126
[self.view addSubview:webView_];
129127
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];

0 commit comments

Comments
 (0)