CMSQLViewController.swift 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // CMSQLViewController.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 2017/3/15.
  6. // Copyright © 2017年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. import QuickLook
  10. class CMSQLViewController: QLPreviewController {
  11. override func viewWillAppear(_ animated: Bool) {
  12. let item = UIBarButtonItem(title: "关闭", style: .plain, target: self, action: #selector(qlCloseWindow))
  13. // self.navigationItem.setRightBarButton(item, animated: true)
  14. self.navigationItem.setLeftBarButton(item, animated: true)
  15. }
  16. override func viewDidLoad() {
  17. super.viewDidLoad()
  18. print("CMSQLView")
  19. // self.navigationItem.backBarButtonItem = UIBarButtonItem(title: "关闭", style: .plain, target: self, action: #selector(qlCloseWindow))
  20. // Do any additional setup after loading the view.
  21. }
  22. @objc func qlCloseWindow() -> Void {
  23. self.dismissVC(completion: nil)
  24. }
  25. // override func viewWillLayoutSubviews() {
  26. // print("viewWillLayoutSubviews")
  27. // for item in (navBar?.items)! {
  28. // print(item)
  29. // }
  30. // }
  31. override func didReceiveMemoryWarning() {
  32. super.didReceiveMemoryWarning()
  33. // Dispose of any resources that can be recreated.
  34. }
  35. }