IHPrivacyVCtr.swift 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // IHPrivacyVCtr.swift
  3. // Inhealth
  4. //
  5. // Created by weclouds on 2020/1/16.
  6. // Copyright © 2020 weclouds. All rights reserved.
  7. //
  8. import UIKit
  9. import WebKit
  10. class IHPrivacyVCtr: UIViewController {
  11. override func viewDidLoad() {
  12. super.viewDidLoad()
  13. self.view.backgroundColor = .white
  14. self.navigationBarTitle = "隐私协议"
  15. let backItem = UIBarButtonItem(image: UIImage(named: "quxiao-4"), style: .done, target: self, action: #selector(backAction))
  16. self.navigationItem.leftBarButtonItem = backItem
  17. let webView = WKWebView(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: self.view.frame.size.height))
  18. let path = Bundle.main.path(forResource: "PrivacyPolicy", ofType: "docx")
  19. log.debug("path - \(path)")
  20. let url = URL(fileURLWithPath: path!)
  21. webView.load(URLRequest(url: url))
  22. self.view.addSubview(webView)
  23. }
  24. @objc func backAction() {
  25. self.dismiss(animated: true, completion: nil)
  26. }
  27. }