UIWebView体系结构(七)WebView

在《iOS WebCore的wak目录》中证实了iOS的WebKit是想尽可能复用Mac上的代码,所以WebView在iOS和Mac上差不多。

Mac WebView的参考文档:

https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/WebKit/Classes/WebView_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40003822

当然,官方文档不会描述WebView在iOS上的作用,因为用class-dump导出头文件的关系,所以有些成为了私有API的函数还是值得说说,例如设置UA。


[cpp]  view plain copy
  1. + (BOOL)canShowMIMEType:(NSString *)MIMEType  
能否显示某种MIMEType的数据。iOS可以做截获判断。

[cpp]  view plain copy
  1. + (void)_setTileCacheLayerPoolCapacity:(unsigned int)arg1;  
设置块区绘制的layer缓存数量。关于TileCache暂可参考《 UIWebView结构体系(二)UIWebTiledView和WAKWindow 》,把这个数值设大可在一定程度加速页面渲染,但也会因此占用更多内存。

[cpp]  view plain copy
  1. + (void)_setHTTPPipeliningEnabled:(BOOL)arg1;  
开关  HTTP管线化

[cpp]  view plain copy
  1. + (void)_removeUserStyleSheetsFromGroup:(id)arg1 world:(id)arg2;  
  2. + (void)_removeUserScriptsFromGroup:(id)arg1 world:(id)arg2;  
  3. + (void)_removeUserStyleSheetFromGroup:(id)arg1 world:(id)arg2 url:(id)arg3;  
  4. + (void)_removeUserScriptFromGroup:(id)arg1 world:(id)arg2 url:(id)arg3;  
  5. + (void)_addUserStyleSheetToGroup:(id)arg1 world:(id)arg2 source:(id)arg3 url:(id)arg4 whitelist:(id)arg5 blacklist:(id)arg6 injectedFrames:(int)arg7;  
  6. + (void)_addUserStyleSheetToGroup:(id)arg1 world:(id)arg2 source:(id)arg3 url:(id)arg4 whitelist:(id)arg5 blacklist:(id)arg6;  
  7. + (void)_addUserScriptToGroup:(id)arg1 world:(id)arg2 source:(id)arg3 url:(id)arg4 whitelist:(id)arg5 blacklist:(id)arg6 injectionTime:(int)arg7 injectedFrames:(int)arg8;  
  8. + (void)_addUserScriptToGroup:(id)arg1 world:(id)arg2 source:(id)arg3 url:(id)arg4 whitelist:(id)arg5 blacklist:(id)arg6 injectionTime:(int)arg7;  
没用过,从名字看是为特定的资源添加StyleSheet和Script

[cpp]  view plain copy
  1. + (void)_setMaximumImageSizeBeforeSubsampling:(unsigned int)arg1;  
设置图片资源预取样的最大size

[cpp]  view plain copy
  1. + (BOOL)_canHandleRequest:(NSURLRequest*)arg1;  
  2. + (BOOL)_canHandleRequest:(NSURLRequest*)arg1 forMainFrame:(BOOL)arg2;  
能否处理这个Request
[cpp]  view plain copy
  1. + (void)_disableRemoteInspector;  
  2. + (void)_enableRemoteInspector;  
开关远程调试功能

[cpp]  view plain copy
  1. + (BOOL)_allowCookies;  
  2. + (void)_setAllowCookies:(BOOL)arg1;  

[cpp]  view plain copy
  1. - (void)_setCookieEnabled:(BOOL)arg1;  
  2. - (BOOL)_cookieEnabled;  
是否启用Cookies

[cpp]  view plain copy
  1. + (BOOL)_acceleratedImageDecoding;  
  2. + (void)_setAcceleratedImageDecoding:(BOOL)arg1;  
开关加速图片解码

[cpp]  view plain copy
  1. + (void)_setCacheModel:(unsigned int)arg1;  
设置Cache
[cpp]  view plain copy
  1. + (void)_setPDFViewClass:(Class)arg1;  
  2. + (Class)_getPDFViewClass;  
  3. + (void)_setPDFRepresentationClass:(Class)arg1;  
  4. + (Class)_getPDFRepresentationClass;  
设置显示PDF的类

[cpp]  view plain copy
  1. - (double)estimatedProgress;  
获取估算的加载进度

[cpp]  view plain copy
  1. - (id)elementAtPoint:(struct CGPoint)arg1;  
  2. - (id)_elementAtWindowPoint:(struct CGPoint)arg1;  
获取在指定坐标的元素

[cpp]  view plain copy
  1. - (id)customUserAgent;  
  2. - (void)setCustomUserAgent:(id)arg1;  
设置自定义的UA

[cpp]  view plain copy
  1. - (void)_setWebGLEnabled:(BOOL)arg1;  
  2. - (BOOL)_webGLEnabled;  
开关WebGL功能

[cpp]  view plain copy
  1. - (void)setUsesPageCache:(BOOL)arg1;  
  2. - (BOOL)usesPageCache;  
开关缓存Page

[cpp]  view plain copy
  1. - (id)_touchEventRegions;  
获取在监听touch事件的区域

[cpp]  view plain copy
  1. - (id)_formDelegateForSelector:(SEL)arg1;  
  2. - (id)_formDelegateForwarder;  
  3. - (id)_formDelegate;  
  4. - (void)_setFormDelegate:(id)arg1;  

表单处理的委托。可实现自动填充功能

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值