WKWebView_XF.swift 530 B

12345678910111213141516171819202122
  1. //
  2. // WKWebView_XF.swift
  3. // xingchuangke
  4. //
  5. // Created by uen on 2020/7/24.
  6. // Copyright © 2020 Virgil. All rights reserved.
  7. //
  8. import Foundation
  9. import WebKit
  10. public extension WKWebView {
  11. func loadDataForUrl(url: String) {
  12. if url == "" {
  13. return
  14. }
  15. let urlNew = CommonURL.formatURL(url)
  16. if urlNew != nil {
  17. self.load(NSURLRequest(url: NSURL(string: urlNew!)! as URL, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: 15) as URLRequest)
  18. }
  19. }
  20. }