Git Product home page Git Product logo

devedbox / axwebviewcontroller Goto Github PK

View Code? Open in Web Editor NEW
797.0 20.0 134.0 5.41 MB

AXWebViewController is a webViewController to browse web content inside applications. It’s a lightweight controller on iOS platform based on WKWebView (UIWebView would be the base Kit under iOS 8.0). It added navigation tool bar to refresh, go back, go forward and so on. It support the navigation style on WeChat. It is a simple-using and convenient web view controller using inside applications.

License: MIT License

Objective-C 93.90% Ruby 4.23% HTML 1.25% CSS 0.62%
webkit webview cocoapods

axwebviewcontroller's Introduction

AXWebViewController

BuildVersionLicensePlatform996.icu

Summary

AXWebViewController是一款基于WKWebView(WebKit)封装的view controller,高度集成,一行代码即可使用;能够满足大部分的App加载html网页的场景,AXWebViewController实现了WKUIDelegateWKNavigationDelegate两个协议,在使用过程中,若需要自定义功能,可自行Overrides相关方法予以实现;

AXWebViewController可实现微信样式的网页浏览导航控制,可在导航栏显示返回关闭两个功能按钮,这个功能主要基于AXNavigationBackItemInjection而实现,AXNavigationBackItemInjection可以拦截点击返回导航或者手势滑动返回,有兴趣的朋友可以了解了解!

sample2 sample

视频链接

Features

  • 手势滑动返回上个页面
  • 微信样式导航返回、关闭
  • 网页加载失败提示
  • 网页加载进度提示
  • 网页来源host提示
  • 支持__Peek__和__Pop__浏览网页,并且commit之后在本网页进行加载,不用跳转到Safari进行浏览,这里使用到了很多运行时的方法,因此,谨慎使用!

Requirements

AXWebViewController 对系统版本支持到iOS7.0;版本0.7.0以后仅支持Xcode9,需要使用到:

  • Foundation.framework
  • UIKit.framework

使用的时候最好使用最新版Xcode。

Adding AXWebViewController to your projet

CocoaPods

CocoaPods is the recommended way to add AXWebViewController to your project.

  1. Add a pod entry for AXWebViewController to your Podfile pod 'AXWebViewController', '~> 0.6.0'
  2. Install the pod(s) by running pod install.
  3. Include AXWebViewController wherever you need it with #import "AXWebViewController.h".

Source files

Alternatively you can directly add the source files under path */AXWebViewController/ to your project.

  1. Download the latest code version or add the repository as a git submodule to your git-tracked project.
  2. Open your project in Xcode, then drag and drop the source files onto your project (use the "Product Navigator view"). Make sure to select Copy items when asked if you extracted the code archive outside of your project.
  3. Include AXWebViewController wherever you need it with #import "AXWebViewController.h".

License

This code is distributed under the terms and conditions of the MIT license.

Usage

AXWebViewController使用和使用普通UIViewController一样简单,只需要在需要使用的地方使用URL初始化即可:

AXWebViewController *webVC = [[AXWebViewController alloc] initWithAddress:@"http://www.baidu.com"];
webVC.showsToolBar = NO;
webVC.navigationController.navigationBar.translucent = NO;
self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0.100f green:0.100f blue:0.100f alpha:0.800f];
self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.996f green:0.867f blue:0.522f alpha:1.00f];
[self.navigationController pushViewController:webVC animated:YES];

使用工具条导航

使用工具条只需在AXWebViewController初始化之后加入一句代码:

webVC.navigationType = AXWebViewControllerNavigationToolItem;
webVC.showsToolBar = YES;

注意,在设置navigationTypeAXWebViewControllerNavigationToolItem之后,须确认showsToolBarYES才能生效.

使用微信样式导航

AXWebViewController初始化之后加入一句代码:

webVC.navigationType = AXWebViewControllerNavigationBarItem;

即可生效.

Peek&Pop

Peek和Pop使用的是原生的系统功能,在使用的时候只需要将webView.allowsLinkPreview设置为YES即可使用,这里需要注意下,在实现Peek和Pop的时候,使用了Runtime的相关知识,而且使用AOP的一个框架__Aspects__进行了编程,在使用的过程中可能会出错,当然,出错的几率也是很小的(苹果不可能隔三差五的去修改自家的Private API吧= =),实现原理就不多讲了,基本上就是运行时的一些知识,代码如下:


- (void)hookWebContentCommitPreviewHandler {
    // Find the `WKContentView` in the webview.
    __weak typeof(self) wself = self;
    for (UIView *_view in _webView.scrollView.subviews) {
    if ([_view isKindOfClass:NSClassFromString(@"WKContentView")]) {
    id _previewItemController = object_getIvar(_view, class_getInstanceVariable([_view class], "_previewItemController"));
    Class _class = [_previewItemController class];
    SEL _performCustomCommitSelector = NSSelectorFromString(@"previewInteractionController:interactionProgress:forRevealAtLocation:inSourceView:containerView:");
    [_previewItemController aspect_hookSelector:_performCustomCommitSelector withOptions:AspectPositionAfter usingBlock:^() {
        UIViewController *pred = [_previewItemController valueForKeyPath:@"presentedViewController"];
        [pred aspect_hookSelector:NSSelectorFromString(@"_addRemoteView") withOptions:AspectPositionAfter usingBlock:^() {
            UIViewController *_remoteViewController = object_getIvar(pred, class_getInstanceVariable([pred class], "_remoteViewController"));
            
            [_remoteViewController aspect_hookSelector:@selector(viewDidLoad) withOptions:AspectPositionAfter usingBlock:^() {
                _remoteViewController.view.tintColor = wself.navigationController.navigationBar.tintColor;
            } error:NULL];
        } error:NULL];
        
        NSArray *ddActions = [pred valueForKeyPath:@"ddActions"];
        id openURLAction = [ddActions firstObject];
        
        [openURLAction aspect_hookSelector:NSSelectorFromString(@"perform") withOptions:AspectPositionInstead usingBlock:^ () {
            NSURL *_url = object_getIvar(openURLAction, class_getInstanceVariable([openURLAction class], "_url"));
            [wself loadURL:_url];
        } error:NULL];
        
        id _lookupItem = object_getIvar(_previewItemController, class_getInstanceVariable([_class class], "_lookupItem"));
        [_lookupItem aspect_hookSelector:NSSelectorFromString(@"commit") withOptions:AspectPositionInstead usingBlock:^() {
            NSURL *_url = object_getIvar(_lookupItem, class_getInstanceVariable([_lookupItem class], "_url"));
            [wself loadURL:_url];
        } error:NULL];
        [_lookupItem aspect_hookSelector:NSSelectorFromString(@"commitWithTransitionForPreviewViewController:inViewController:completion:") withOptions:AspectPositionInstead usingBlock:^() {
            NSURL *_url = object_getIvar(_lookupItem, class_getInstanceVariable([_lookupItem class], "_url"));
            [wself loadURL:_url];
        } error:NULL];
        /*
         UIWindow
         -UITransitionView
         --UIVisualEffectView
         ---_UIVisualEffectContentView
         ----UIView
         -----_UIPreviewActionSheetView
         */
        /*
         for (UIView * transitionView in [UIApplication sharedApplication].keyWindow.subviews) {
         if ([transitionView isMemberOfClass:NSClassFromString(@"UITransitionView")]) {
         transitionView.tintColor = wself.navigationController.navigationBar.tintColor;
         for (UIView *__view in transitionView.subviews) {
         if ([__view isMemberOfClass:NSClassFromString(@"UIVisualEffectView")]) {
         for (UIView *___view in __view.subviews) {
         if ([___view isMemberOfClass:NSClassFromString(@"_UIVisualEffectContentView")]) {
         for (UIView *____view in ___view.subviews) {
         if ([____view isMemberOfClass:NSClassFromString(@"UIView")]) {
         __weak typeof(____view) w____view = ____view;
         [____view aspect_hookSelector:@selector(addSubview:) withOptions:AspectPositionAfter usingBlock:^() {
         for (UIView *actionSheet in w____view.subviews) {
         if ([actionSheet isMemberOfClass:NSClassFromString(@"_UIPreviewActionSheetView")]) {
         break;
         }
         }
         } error:NULL];
         }
         }break;
         }
         }break;
         }
         }break;
         }
         }
         */
    } error:NULL];
    break;
    }
    }
}

致谢

RxWebViewController为我提供了思路,有些地方做了参考

iOS8.0以下使用了NJKWebViewProgress作为进度条,感谢!

更新日志

0.1.10

使用基于UIWebView的实现,进度条使用NJKWebViewProgress实现.

0.2.0

iOS8.0以上使用WKWebView实现,进度条使用UIProgressView实现. 实现了本页面Peek&Pop而不用跳转到Safari进行浏览.

0.3.0

使用AXNavigationBackItemInjection实现微信导航样式,也可以自定义返回的操作,只需要几行代码就可以搞定!

查看更多日志请移步Latest release.

axwebviewcontroller's People

Contributors

bryant1410 avatar devedbox avatar dsmo avatar lin-it-lion avatar tentenlee100 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

axwebviewcontroller's Issues

web页面请求错误时,会出现无限刷新或无限重新请求的问题

##预期效果
加载web页面,当请求发生错误时,会跳转到一个web的错误提示界面;

##实际效果
使用AxWebVC加载web,当页面返回请求错误时,不会跳转错误页面,会在当前页面无限刷新;
pod ~0.5.0开始有这个问题的,~0.4.8不会有这个问题;

網頁上有tel: 會無法撥打電話

可否在
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
加上這段


    if ([navigationAction.request.URL.scheme isEqualToString:@"tel"]) {
        decisionHandler(WKNavigationActionPolicyCancel);
        
        NSString * mutStr = [NSString stringWithFormat:@"telprompt://%@",navigationAction.request.URL.resourceSpecifier];
        if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0) {
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:mutStr] options:@{} completionHandler:^(BOOL success) {}];
        } else {
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:mutStr]];
        }
        
        return;
    }

出自於 http://www.jianshu.com/p/e65137ced997

網路慢時有些問題

AXWebViewController版本: 0.4.6
Xcode版本: 8.3.1
iOS/OSX版本: 9.3.5
依赖管理工具(cocoapods)版本: ? 1.2.1

在網路較慢的情況下,如果連到目標往只需要下載大量資料的時候,此時直接回上頁,會照成back會卡死,無法透過back的方式回到上一個頁面。

SPA上的问题

我目前也在封装webView(WKWebView)相关的东西
在封装的过程中,发现,如果web页面是使用SPA(Vue.js, React, Angluar.js等)方式来做的,那么就会造成backForwardList(返回栈)紊乱的问题,这会导致,用户在点击返回按钮来执行goBack的时候,会出现多1-2个栈
希望repo主一起研究
我目前的解决方式是:

  1. 通过KVO的方式来observe每个页面的title,并且在对应的.h开放indexTitle属性

2.如webView.title == indexTitle,这个时候让返回按钮执行popAction

3.反之,执行goBackAction

cocoapods 加载bundle文件出错,闪退

使用cocoapods 加载如下文件 为空。 pods中有该资源文件,但是加载不到。

#define kAX404NotFoundHTMLPath [[NSBundle mainBundle] pathForResource:@"AXWebViewController.bundle/html.bundle/404" ofType:@"html"]

pod use_frameworks! 的时候,toolBar 上的前进、后退按钮图片资源加载不到

- (UIBarButtonItem *)backBarButtonItem {
    if (_backBarButtonItem) return _backBarButtonItem;
    UIImage *image = [UIImage imageNamed:@"AXWebViewController.bundle/AXWebViewControllerBack"];
    if (!image) {
        image = [UIImage imageNamed:@"Frameworks/AXWebViewController.framework/AXWebViewController.bundle/AXWebViewControllerBack"];
    }
    _backBarButtonItem = [[UIBarButtonItem alloc] initWithImage:image
                                                          style:UIBarButtonItemStylePlain
                                                         target:self
                                                         action:@selector(goBackClicked:)];
    _backBarButtonItem.width = 18.0f;
    return _backBarButtonItem;
}

- (UIBarButtonItem *)forwardBarButtonItem {
    if (_forwardBarButtonItem) return _forwardBarButtonItem;
    UIImage *image = [UIImage imageNamed:@"AXWebViewController.bundle/AXWebViewControllerNext"];
    if (!image) {
        image = [UIImage imageNamed:@"Frameworks/AXWebViewController.framework/AXWebViewController.bundle/AXWebViewControllerNext"];
    }
    _forwardBarButtonItem = [[UIBarButtonItem alloc] initWithImage:image
                                                             style:UIBarButtonItemStylePlain
                                                            target:self
                                                            action:@selector(goForwardClicked:)];
    _forwardBarButtonItem.width = 18.0f;
    return _forwardBarButtonItem;
}

发现2个问题

1,navigationBar的代理方法-(BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item 不应该写在viewControoler里;
2,Cookie设置是一个问题(未能解决,请求有什么好的方法吗?)

H5页面底部条不能固定在页面底部

这个问题是由于先前写的时候布局没注意,写成了相对于bottom layout guide而造成的,现在已经更改了,请使用0.2.6以及以上的版本以解决问题!

ios7 crash

ios7 crash because your macro __IPHONE_OS_VERSION_MAX_ALLOWED always works. Then new a WKWebView in ios7 and it will be nil.

Carthage

Can this be installed via Carthage?

pod 0.6.1 更新了吗

感谢支持AXWebViewController,希望大家一起构建优秀的开源框架!你的问题对我来说很重要!

提问: 如果你有任何问题,欢迎email我:[email protected] 或者加入我的开源项目qq群:481867135

需求: 只需要填写以下前两条内容.

Bugs: 为了尽快帮助你解决问题,请描述你的问题和问题复现的步骤.

谢谢帮助我帮助你们! :-)

提交issue之前,请移除以上内容.

目标

你想达到的目标,或者说你想实现的功能的效果或者预期的结果?

预期的结果

你预期会产生的结果?

实际的结果

实际上使用产生的结果? 

比如:崩溃的控制台打印

问题复现的步骤

issue复现所需的步骤,尽量详细!

示例代码

提供一个突出问题的代码示例或测试用例. 对于量较大的代码示例,链接到外部的gists/repositories是首选. 需要保密的话通过邮件[email protected]分享,邮件主题写issue的名称. 问题严重的话可以提供完整的Xcode工程最好!

AXWebViewController和工具的版本

echo "\`\`\`
$(sw_vers)

$(xcode-select -p)
$(xcodebuild -version)

$(which pod && pod --version)
$(test -e Podfile.lock && cat Podfile.lock | sed -nE 's/^  - (Realm(Swift)? [^:]*):?/\1/p' || echo "(not in use here)")

$(which bash && bash -version | head -n1)

$(which carthage && carthage version)
$(test -e Cartfile.resolved && cat Cartfile.resolved | grep --color=no realm || echo "(not in use here)")

$(which git && git --version)
\`\`\`" | tee /dev/tty | pbcopy

复制以上内容到终端回车,就可以获取到版本信息. 获取到版本信息之后,请将以上脚本删除!

AXWebViewController版本: ?

Xcode版本: ?

iOS/OSX版本: ?

依赖管理工具(cocoapods)版本: ?

如果根控制器就是AXWebViewController所在的nav的话关闭有问题

代码如下:
AXWebViewController *webVC = [[AXWebViewController alloc] initWithAddress:@"http://www.baidu.com"];
webVC.showsToolBar = NO;
webVC.webView.allowsLinkPreview = YES;
UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:webVC];
self.window = [[UIWindow alloc] init];
self.window.backgroundColor = [UIColor whiteColor];
self.window.frame = [UIScreen mainScreen].bounds;
self.window.rootViewController = nav;
这样的话 里面的关闭 是不起作用的,望指教!!谢谢

Demo 在 Deployment Target 7.0 时编译不过.. ~

ProductName:	Mac OS X
ProductVersion:	10.12.4
BuildVersion:	16E195

/Applications/Xcode.app/Contents/Developer
Xcode 8.3.2
Build version 8E2002

/usr/local/bin/pod
1.2.0


/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin16)

/usr/local/bin/carthage
0.18.1
(not in use here)

/usr/bin/git
git version 2.11.0 (Apple Git-81)

RT, 求修复 ~

依赖库太多

cocoapods安装AXWebViewController会有5个依赖库,希望去掉这么多依赖

编译出错

我直接把源码放进工程的时候,把你里面相关用到第三方库也加进去了,编译报错,“Apple Mach-O Linker Error: Apple command failed with exit code 1”,不加你的AXWebViewController是没问题的。是编译的时候,没找到头文件吗??
Xcode 版本 8.3.1
iOS版本 10.3.1

android UIWebview WKWebView JS交互的问题

我现在遇到一个满纠结的问题
项目要求网页的js代码能兼容android wkweb uiweb
但是首先wkweb 和 uiweb 就好像不兼容
wkweb是window.webkit.messageHandlers..postMessage()
uiweb _jsContext = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"
android 可以使用jscontext 这一套 ,
请问大神我该怎么取舍了
或者目前有什么主流的解决方案

你好 pod 下来 后头文件not file found 还有用的时候 。pod 0.4.6 加进项目里 滑动返回没有动画时没有上一页的内容显示

感谢支持AXWebViewController,希望大家一起构建优秀的开源框架!你的问题对我来说很重要!

提问: 如果你有任何问题,欢迎email我:[email protected] 或者加入我的开源项目qq群:481867135

需求: 只需要填写以下前两条内容.

Bugs: 为了尽快帮助你解决问题,请描述你的问题和问题复现的步骤.

谢谢帮助我帮助你们! :-)

提交issue之前,请移除以上内容.

目标

你想达到的目标,或者说你想实现的功能的效果或者预期的结果?

预期的结果

你预期会产生的结果?

实际的结果

实际上使用产生的结果? 

比如:崩溃的控制台打印

问题复现的步骤

issue复现所需的步骤,尽量详细!

示例代码

提供一个突出问题的代码示例或测试用例. 对于量较大的代码示例,链接到外部的gists/repositories是首选. 需要保密的话通过邮件[email protected]分享,邮件主题写issue的名称. 问题严重的话可以提供完整的Xcode工程最好!

AXWebViewController和工具的版本

echo "\`\`\`
$(sw_vers)

$(xcode-select -p)
$(xcodebuild -version)

$(which pod && pod --version)
$(test -e Podfile.lock && cat Podfile.lock | sed -nE 's/^  - (Realm(Swift)? [^:]*):?/\1/p' || echo "(not in use here)")

$(which bash && bash -version | head -n1)

$(which carthage && carthage version)
$(test -e Cartfile.resolved && cat Cartfile.resolved | grep --color=no realm || echo "(not in use here)")

$(which git && git --version)
\`\`\`" | tee /dev/tty | pbcopy

复制以上内容到终端回车,就可以获取到版本信息. 获取到版本信息之后,请将以上脚本删除!

AXWebViewController版本: ?

Xcode版本: ?

iOS/OSX版本: ?

依赖管理工具(cocoapods)版本: ?

第一次加载很慢,报警告

运行出来后每次第一次加载这个控制器都非常慢。而且会报警告
objc[3809]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x122646910) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x122470210). One of the two will be used. Which one is undefined.
2017-02-16 11:18:52.732 xiaojiujinfu[3809:511272] unexpected nil window in __dispatchPreprocessedEventFromEventQueue, _windowServerHitTestWindow: (null)
2017-02-16 11:18:52.733 xiaojiujinfu[3809:511272] unexpected nil window in __dispatchPreprocessedEventFromEventQueue, _windowServerHitTestWindow: (null)

reason: 'Cannot remove an observer <AXWebViewController 0x7f9de1011c00> for the key path "estimatedProgress" from <WKWebView 0x7f9ddf811600> because it is not registered as an observer.'的报错

目标

我想集成进项目中

预期的结果

给网址就可以访问

实际的结果

运行起来就闪退了

比如:崩溃的控制台打印这个,提示这个错位
reason: 'Cannot remove an observer <AXWebViewController 0x7f9de1011c00> for the key path "estimatedProgress" from <WKWebView 0x7f9ddf811600> because it is not registered as an observer.'

使用Exception Breakpoint会定位到[_webView removeObserver:self forKeyPath:@"estimatedProgress"];这行代码

问题复现的步骤

issue复现所需的步骤,尽量详细!

直接新建了一个项目,在新建项目中的viewcontroller 的.m
文件中,下面网址去掉了

  • (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    AXWebViewController *webVC = [[AXWebViewController alloc] initWithAddress:@"网址"];
    webVC.showsToolBar = NO;
    if (AX_WEB_VIEW_CONTROLLER_iOS9_0_AVAILABLE()) {
    webVC.webView.allowsLinkPreview = YES;
    }
    [self.navigationController pushViewController:webVC animated:YES];

}

示例代码

提供一个突出问题的代码示例或测试用例. 对于量较大的代码示例,链接到外部的gists/repositories是首选. 需要保密的话通过邮件[email protected]分享,邮件主题写issue的名称. 问题严重的话可以提供完整的Xcode工程最好!

AXWebViewController和工具的版本

echo "\`\`\`
$(sw_vers)

$(xcode-select -p)
$(xcodebuild -version)

$(which pod && pod --version)
$(test -e Podfile.lock && cat Podfile.lock | sed -nE 's/^  - (Realm(Swift)? [^:]*):?/\1/p' || echo "(not in use here)")

$(which bash && bash -version | head -n1)

$(which carthage && carthage version)
$(test -e Cartfile.resolved && cat Cartfile.resolved | grep --color=no realm || echo "(not in use here)")

$(which git && git --version)
\`\`\`" | tee /dev/tty | pbcopy

复制以上内容到终端回车,就可以获取到版本信息. 获取到版本信息之后,请将以上脚本删除!

AXWebViewController版本: pod 'AXWebViewController', '~> 0.6.0'

Xcode版本: Version 9.1 (9B55)

iOS/OSX版本: iPhone 8 的模拟器

依赖管理工具(cocoapods)版本: pod --version之后显示 1.4.0.beta.2

图片放大后,view上移20pt

AXWebViewController版本: 0.6.1、0.7.0

Xcode版本: 9.1

iOS版本: 10.3.2

依赖管理工具(cocoapods)版本: 1.3.1

复现步骤:
打开一个AXWebViewController,点击网页中的图片打开一个全屏的图片浏览器或视频播放器,再返回,页面上移20pt,下滑也不再返回

1
2
3
4
5

运行demo,点击Push 报错,Present正常

2016-08-06 11:51:21.033 AXWebViewController[1958:177707] -[WKWebView setAllowsLinkPreview:]: unrecognized selector sent to instance 0x7f8c38d4b100
2016-08-06 11:51:21.036 AXWebViewController[1958:177707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[WKWebView setAllowsLinkPreview:]: unrecognized selector sent to instance 0x7f8c38d4b100'

关于监听屏幕旋转

Present出来的控制器,当加载2级或者以上次数网页后,iPhone和iPad版本左上角会出现back关闭两个按钮,原因在orientationChanged:这个方法里边。
我感觉没必要增加屏幕旋转的通知,增加了反而有点多余,不知道您当初增加这个通知是出于什么考虑呢?可否说下?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.