     }
 
     fileprivate func switchToHTML() {
-        navigationItem.rightBarButtonItem?.title = NSLocalizedString("Native", comment: "Rich Edition!")
+        view.endEditing(true)
         
         htmlTextView.text = richTextView.getHTML()
         htmlTextView.becomeFirstResponder()

    }

    fileprivate func switchToRichText() {
        navigationItem.rightBarButtonItem?.title = NSLocalizedString("HTML", comment: "HTML!")

        richTextView.setHTML(htmlTextView.text)
        richTextView.becomeFirstResponder()


    fileprivate(set) var editingMode: EditMode = .richText {
        didSet {
            switch editingMode {
            case .html:
                switchToHTML()
