3333#define AXWebViewControllerLocalizedString (key, comment ) \
3434NSLocalizedStringFromTableInBundle (key, @" AXWebViewController" , [NSBundle bundleWithPath: [[[NSBundle bundleForClass: [AXWebViewController class ]] resourcePath ] stringByAppendingPathComponent: @" AXWebViewController.bundle" ]], comment)
3535#endif
36- #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
36+ #if !AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
3737@interface _AXWebViewProgressView : NJKWebViewProgressView
3838// / The view controller controller.
3939@property (weak , nonatomic ) AXWebViewController *webViewController;
@@ -71,7 +71,7 @@ @interface AXWebViewController ()<NJKWebViewProgressDelegate>
7171@property (strong , nonatomic ) UILabel *backgroundLabel;
7272// / Updating timer.
7373@property (strong , nonatomic ) NSTimer *updating;
74- #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
74+ #if !AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
7575// / Progress proxy of progress.
7676@property (strong , nonatomic ) NJKWebViewProgress *progressProxy;
7777// / Progress view to show progress of requests.
@@ -145,7 +145,7 @@ - (void)initializer {
145145 // Set up default values.
146146 _showsToolBar = YES ;
147147 _showsBackgroundLabel = YES ;
148- #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
148+ #if !AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
149149 _timeoutInternal = 10.0 ;
150150 _cachePolicy = NSURLRequestReloadRevalidatingCacheData;
151151#endif
@@ -219,7 +219,7 @@ - (void)viewDidLoad {
219219 [self loadURL: [NSURL fileURLWithPath: kAX404NotFoundHTMLPath ]];
220220 }
221221
222- #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
222+ #if !AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
223223 [self progressProxy ];
224224#else
225225 [_webView addObserver: self forKeyPath: @" estimatedProgress" options: NSKeyValueObservingOptionNew context: NULL ];
@@ -240,7 +240,7 @@ - (void)viewDidLoad {
240240 // Config navigation item
241241 self.navigationItem .leftItemsSupplementBackButton = YES ;
242242
243- #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
243+ #if !AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
244244 self.view .backgroundColor = [UIColor colorWithRed: 0.180 green: 0.192 blue: 0.196 alpha: 1.00 ];
245245 self.progressView .progressBarView .backgroundColor = self.navigationController .navigationBar .tintColor ;
246246#else
@@ -556,7 +556,7 @@ - (UIBarButtonItem *)navigationCloseBarButtonItem {
556556 }
557557 return _navigationCloseBarButtonItem;
558558}
559- #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
559+ #if !AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
560560- (NJKWebViewProgress *)progressProxy {
561561 if (_progressProxy) return _progressProxy;
562562 _progressProxy = [[NJKWebViewProgress alloc ] init ];
@@ -596,7 +596,7 @@ - (UILabel *)backgroundLabel {
596596- (UILabel *)descriptionLabel {
597597 return self.backgroundLabel ;
598598}
599- #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
599+ #if !AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
600600-(UIView*)swipingBackgoundView {
601601 if (!_swipingBackgoundView) {
602602 _swipingBackgoundView = [[UIView alloc ] initWithFrame: self .view.bounds];
@@ -727,7 +727,7 @@ - (void)didStartLoad{
727727 if (_navigationType == AXWebViewControllerNavigationToolItem) {
728728 [self updateToolbarItems ];
729729 }
730- #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
730+ #if !AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
731731 _progressView.progress = 0.0 ;
732732#endif
733733 if (_delegate && [_delegate respondsToSelector: @selector (webViewControllerDidStartLoad: )]) {
@@ -780,7 +780,7 @@ - (void)didFinishLoad{
780780 [_delegate webViewControllerDidFinishLoad: self ];
781781 }
782782 _loading = NO ;
783- #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
783+ #if !AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
784784 [_progressView setProgress: 0.9 animated: YES ];
785785 dispatch_after (dispatch_time (DISPATCH_TIME_NOW, (int64_t )(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue (), ^{
786786 if (_progressView.progress != 1.0 ) {
@@ -791,7 +791,7 @@ - (void)didFinishLoad{
791791}
792792
793793- (void )didFailLoadWithError : (NSError *)error {
794- #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
794+ #if !AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
795795 if (error.code == NSURLErrorCannotFindHost) {// 404
796796 [self loadURL: [NSURL fileURLWithPath: kAX404NotFoundHTMLPath ]];
797797 } else {
@@ -915,7 +915,7 @@ - (void)doneButtonClicked:(id)sender {
915915 [self dismissViewControllerAnimated: YES completion: NULL ];
916916}
917917
918- #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
918+ #if !AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
919919-(void )swipePanGestureHandler : (UIPanGestureRecognizer*)panGesture {
920920 CGPoint translation = [panGesture translationInView: self .webView];
921921 CGPoint location = [panGesture locationInView: self .webView];
@@ -1190,7 +1190,7 @@ - (void)updateFrameOfProgressView {
11901190 _progressView.frame = barFrame;
11911191}
11921192
1193- #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
1193+ #if !AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
11941194-(void )pushCurrentSnapshotViewWithRequest : (NSURLRequest *)request {
11951195 NSURLRequest * lastRequest = (NSURLRequest *)[[self .snapshots lastObject ] objectForKey: @" request" ];
11961196
@@ -1576,7 +1576,7 @@ - (void)setAx_webViewController:(AXWebViewController *)ax_webViewController {
15761576}
15771577@end
15781578#endif
1579- #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
1579+ #if !AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
15801580@implementation _AXWebViewProgressView
15811581- (void )setProgress : (float )progress animated : (BOOL )animated {
15821582 [super setProgress: progress animated: animated];
0 commit comments