BBSSubjectContentViewController.swift 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // BBSSubjectContentViewController.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 2016/11/17.
  6. // Copyright © 2016年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. protocol SubjectContentEditBackDelegate {
  10. func backEditContent(contentHtml:String)
  11. }
  12. class BBSSubjectContentViewController: ZSSRichTextEditor {
  13. var myContentHTML:String?
  14. var backDelegate:SubjectContentEditBackDelegate?
  15. override func viewDidLoad() {
  16. super.viewDidLoad()
  17. if let content = myContentHTML {
  18. self.setHTML(content)
  19. }
  20. }
  21. override func didReceiveMemoryWarning() {
  22. super.didReceiveMemoryWarning()
  23. // Dispose of any resources that can be recreated.
  24. }
  25. @IBAction func closeEditWindow(_ sender: UIBarButtonItem) {
  26. self.dismiss(animated: true, completion: nil)
  27. }
  28. @IBAction func backEditContentSuper(_ sender: UIBarButtonItem) {
  29. if self.backDelegate != nil {
  30. self.getHTML { (c, err) in
  31. if let html = c as? NSString {
  32. self.backDelegate?.backEditContent(contentHtml: String(html))
  33. }
  34. }
  35. // self.backDelegate?.backEditContent(contentHtml: self.getHTML())
  36. }
  37. self.performSegue(withIdentifier: "backContentSegue", sender: nil)
  38. }
  39. }