     
     func barButtonItemOnToolBarDidTouch(sender: UIBarButtonItem) {
         guard let validButtonTitle = sender.title else { return }
-        if sender.title == "⌨" {
-            self.textView.endEditing(true)
-        }
-        else {
-            self.textView.insertText(validButtonTitle)
-        }
+        if case "➡️️" = validButtonTitle { self.moveCursor(.right) }
+        else if case "⬅️️" = validButtonTitle { self.moveCursor(.left) }
+        else if case "⌨" = validButtonTitle { self.textView.endEditing(true) }
+        else { self.textView.insertText(validButtonTitle) }
+    }
+    
+    fileprivate func moveCursor(_ cursor: Cursor) {
+        guard let selectedTextRange = self.textView.selectedTextRange, let newCursorPosition = textView.position(from: selectedTextRange.start, offset: cursor.direction) else { return }
+        textView.selectedTextRange = textView.textRange(from: newCursorPosition, to: newCursorPosition)
     }
     
     fileprivate func setupKeyboardToolBarWithBarButtonItems() {

        return alertView
    }()
    
    enum MarkdownSymbols: String {
        case hash, asterisk, underscore, greaterThan, dash, grave, done
        
        var character: String {
            switch self {
            case .hash: return "#"
            case .asterisk: return "*"
            case .underscore: return "_"

            case .dash: return "-"
            case .grave: return "`"
            case .done: return "⌨"
            case .moveRight: return "➡️️"
            }
        }
        
        static let items = [ moveLeft, hash, asterisk, underscore, greaterThan, dash, grave, done, moveRight]
    }
    
    // MARK: - IBOutlet Properties
