码迷,mamicode.com
首页 > Web开发 > 详细

UIWebView的常用方法

时间:2015-02-10 10:30:40      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:

//webview导航栏类型
enum
UIWebViewNavigationType : Int { case LinkClicked case FormSubmitted case BackForward case Reload case FormResubmitted case Other }
//webview 分页类型
enum UIWebPaginationMode : Int {
    
    case Unpaginated
    case LeftToRight
    case TopToBottom
    case BottomToTop
    case RightToLeft
}
enum UIWebPaginationBreakingMode : Int {
    
    case Page
    case Column
}
class UIWebView : UIView, NSCoding, UIScrollViewDelegate, NSObjectProtocol {
    
    unowned(unsafe) var delegate: UIWebViewDelegate?
    
    @availability(iOS, introduced=5.0)
    var scrollView: UIScrollView { get }
    
    func loadRequest(request: NSURLRequest)
    func loadHTMLString(string: String!, baseURL: NSURL!)
    func loadData(data: NSData!, MIMEType: String!, textEncodingName: String!, baseURL: NSURL!)
    
    var request: NSURLRequest? { get }
    //重载
    func reload()
  //停止加载 func stopLoading() //后退 func goBack()
  //前进 func goForward() //能否后退 var canGoBack: Bool {
get }
 //能否前进 var canGoForward: Bool {
get }
 //是否在加载
var loading: Bool { get }
// 和js的交互
func stringByEvaluatingJavaScriptFromString(script: String)
-> String? var scalesPageToFit: Bool

@availability(iOS, introduced=3.0)


    var dataDetectorTypes: UIDataDetectorTypes


    


    @availability(iOS, introduced=4.0)


    var allowsInlineMediaPlayback: Bool // iPhone Safari defaults to NO. iPad Safari defaults to YES


    @availability(iOS, introduced=4.0)


    var mediaPlaybackRequiresUserAction: Bool // iPhone and iPad Safari both default to YES


    


    @availability(iOS, introduced=5.0)


    var mediaPlaybackAllowsAirPlay: Bool // iPhone and iPad Safari both default to YES


    


    @availability(iOS, introduced=6.0)


    var suppressesIncrementalRendering: Bool // iPhone and iPad Safari both default to NO


    


    @availability(iOS, introduced=6.0)


    var keyboardDisplayRequiresUserAction: Bool // default is YES


    


    @availability(iOS, introduced=7.0)


    var paginationMode: UIWebPaginationMode


    @availability(iOS, introduced=7.0)


    var paginationBreakingMode: UIWebPaginationBreakingMode


    @availability(iOS, introduced=7.0)


    var pageLength: CGFloat


    @availability(iOS, introduced=7.0)


    var gapBetweenPages: CGFloat


    @availability(iOS, introduced=7.0)


    var pageCount: Int { get }

 
protocol UIWebViewDelegate : NSObjectProtocol {
    
    optional func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool
    optional func webViewDidStartLoad(webView: UIWebView)
    optional func webViewDidFinishLoad(webView: UIWebView)
    optional func webView(webView: UIWebView, didFailLoadWithError error: NSError)
}

 

UIWebView的常用方法

标签:

原文地址:http://www.cnblogs.com/qzp2014/p/4282994.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!