本文转载至 http://blog.csdn.net/cyforce/article/details/8487856

1、UIWebDocumentView

2、WebView

3、

//================================================================//

私有框架所在目录?

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/PrivateFrameworks

//================================================================//

UIWebView 的层次

①、UIScrollView is a subview of UIWebView

②、UIWebDocumentView is a subview of UIScrollView

//================================================================//

如何获取 UIWebDocumentView 与 WebView ?

UIWebView *officialWebView = [[UIWebView alloc] init];

UIWebDocumentView *webDocumentView = nil;

id webView = nil;

webDocumentView = objc_msgSend(officialWebView, @selector(_documentView));

object_getInstanceVariable(webDocumentView, "_webView", (void**)&webView);

具体有支持哪些消息可以从网络上查找,有dump出的头文件供下载。

//================================================================//

如何截获 Touch 事件?

@implementation UIView (__TapHook)

- (void)__replacedTouchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {

[self __replacedTouchesBegan:touches withEvent:event];

if( [self.superview.superview isMemberOfClass:[UICWebView class]] ) {

[(UICWebView*)self.superview.superview hookedTouchesBegan:touches withEvent:event];

}

}

@end

+ (void)installHook {

Class klass = objc_getClass( "UIWebDocumentView" );

// replace touch began event

method_exchangeImplementations(

class_getInstanceMethod(klass, @selector(touchesBegan:withEvent:)),

class_getInstanceMethod(klass, @selector(__replacedTouchesBegan:withEvent:)) );

}

ref:http://sonson-code.googlecode.com/svn/trunk/iPhone2.0/UICWebView/

//================================================================//

如何获取网页的真实加载速度?

①、注册通知:

[[NSNotificationCenter defaultCenter] addObserver:self

selector:@selector(progressEstimateChanged:)

name:WebViewProgressEstimateChangedNotification

object:coreWebView];

②、处理通知消息:

- (void)progressEstimateChanged:(NSNotification*)theNotification {

// You can get the progress as a float with

// [[theNotification object] estimatedProgress], and then you

// can set that to a UIProgressView if you'd like.

// theProgressView is just an example of what you could do.

[theProgressView setProgress:[[theNotification object] estimatedProgress]];

if ((int)[[theNotification object] estimatedProgress] == 1) {

theProgressView.hidden = TRUE;

// Hide the progress view. This is optional, but depending on where

// you put it, this may be a good idea.

// If you wanted to do this, you'd

// have to set theProgressView to visible in your

// webViewDidStartLoad delegate method,

// see Apple's UIWebView documentation.

}

}

ref:http://winxblog.com/2009/02/iphone-uiwebview-estimated-progress/

//================================================================//

调试 UIWebView

ref:http://www.idryman.org/blog/2012/06/17/debug-uiwebview-in-your-ios-app/

ref:http://atnan.com/blog/2011/11/17/enabling-remote-debugging-via-private-apis-in-mobile-safari/

//================================================================//

开启并使用 WebGL

ref:http://atnan.com/blog/2011/11/03/enabling-and-using-webgl-on-ios/

//================================================================//

关于 UIWebView 的说明的更多相关文章

  1. AFNetworking 3.0 源码解读(十一)之 UIButton/UIProgressView/UIWebView + AFNetworking

    AFNetworking的源码解读马上就结束了,这一篇应该算是倒数第二篇,下一篇会是对AFNetworking中的技术点进行总结. 前言 上一篇我们总结了 UIActivityIndicatorVie ...

  2. ios UIWebView自定义Alert风格的弹框

    之前开发过一个App,因为公司之前写好了网页版的内容和安卓版本的App,我进去后老板要求我ios直接用网页的内容,而不需要自己再搭建框架.我一听,偷笑了,这不就是一个UIWebView吗?简单! 但是 ...

  3. iOS网络3—UIWebView与WKWebView使用详解

    一.整体介绍 UIWebView自iOS2就有,WKWebView从iOS8才有,毫无疑问WKWebView将逐步取代笨重的UIWebView.通过简单的测试即可发现UIWebView占用过多内存,且 ...

  4. IOS 网络浅析-(十二 UIWebView简介)

    在这篇随笔里,我们只要知道UIWebView是什么就可以了. UIWebView 是苹果提供的用来展示网页的UI控件,它也是最占内存的控件. iOS8.0之后出现了webkit框架,WKWebView ...

  5. UIWebView获取网页点击事件

    //接收web事件 -(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request nav ...

  6. IOS UIWebView 下拉刷新功能的简单实现

    1.运行效果图 2.swift 代码的实现 import UIKit class RefreshWebViewController: UIViewController,UIScrollViewDele ...

  7. UI控件(UIWebView)

    本文主要记录UIWebView三方面内容: 1.基本的加载网页链接或文件: 2.网页js调用原生,也就是Cordova混合架构的原理: 3.原生调用js程序: 原生部分主要代码: @implement ...

  8. UIwebView 和 H5交互详情

    背景: 最近公司准备上一个只有原生登录界面 + H5网页 ,并且支持ios7.0 以上系统的混合app;这可把我难住了,原生的UI界面我可以正写反写各种style把界面搭建起来.而要这个app的难点在 ...

  9. ios UIWebView 在开发中加载文件

    UIWebView 在实际应用中加载文件的时候,有两种情况, 1. 实行在线预览 , 2. 下载到本地,再查看 如果是第一种情况: NSURL *url = [NSURL URLWithString: ...

  10. iOS UIWebView 拦截点击事件(双击缩放)

    在平时的开发中,要使用到webview,但类似微信的webview在数据没有加载完成的时候 双击屏幕,webview不会缩放,其实实现这个功能很简单 代码是用swift写的 class YYSimpl ...

随机推荐

  1. 【千纸诗书】—— PHP/MySQL二手书网站后台开发之项目设计

    前言:这个项目是毕设时候做的,我负责后台数据操作部分,已经很久了,这次回顾这部分,是为了复习PHP和MySQL的知识,正好现在在公司也负责的是后台管理系统的业务.第一篇[项目概况]附上毕业论文部分节选 ...

  2. poj_1284_原根

    一開始看题的时候第一想法就是暴力,可是无奈数据量有点大,看了题解之后才知道原来牵扯到数论上的一个叫做原根的东西,这个题的题意就是,给你一个奇素数,问题他的原根有多少.依据初等数论上所说,此时牵扯到了三 ...

  3. css - inline\inline-block\block

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. 使用Vmware虚拟机部署Swift开发环境之Mac OSX系统安装

    一.使用VMware虚拟机部署Swift开发环境所需工具: Vmware Workstation 10.0虚拟机软件VM安装Mac解锁工具Unlock苹果操作系统(Mac OS X Mavericks ...

  5. 使用CAsyncSocket总结

    最近想起CAsyncSocket这个类,记得很早以前用过,现在却想不起来怎么用了,翻了翻以前的代码又看了看msdn感觉这个类做简单的异步socket太简单了,几行代码就可以搞定,在此先做个总结. 不管 ...

  6. asp.net+mvc+easyui+sqlite 简单用户系统学习之旅(四)—— session传递登录人信息显示+用户注销

    前面的学习,已经做好了简单的登录和主页,涉及了三层软件架构,mvc,easyui的layout.tree.tab.window,sqlite,动软代码自动生成. 下面完善一下登录跳转主页后,在sout ...

  7. vue 销毁组件

    销毁组件 // get~ 销毁组件 destroyElement() { this.$destroy(true); this.$el.parentNode.removeChild(this.$el); ...

  8. Atitit.biz业务系统 面向框架  面向模式---------数据映射imp

    Atitit.biz业务系统 面向框架  面向模式---------数据映射imp 1.1. 面向变量  面向过程  面向对象 面向组件  面向框架  面向服务 面向模式1 1.2. 第2章 架构模式 ...

  9. 189. Rotate Array【easy】

    189. Rotate Array[easy] Rotate an array of n elements to the right by k steps. For example, with n = ...

  10. 141. Sqrt(x) 【easy】

    141. Sqrt(x) [easy] Implement int sqrt(int x). Compute and return the square root of x. Example sqrt ...