Created
May 4, 2018 20:26
-
-
Save frosty/66e28ecfc6d1d664bc79774c9bb22dec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Example/Example/EditorDemoController.swift b/Example/Example/EditorDemoController.swift | |
index e0029787..6f9b2ca9 100644 | |
--- a/Example/Example/EditorDemoController.swift | |
+++ b/Example/Example/EditorDemoController.swift | |
@@ -464,6 +464,17 @@ extension EditorDemoController : UITextViewDelegate { | |
} | |
} | |
+ func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { | |
+ // If the user types a tab character in the title text view, | |
+ // let's move focus to the editor text view. | |
+ guard textView == titleTextView, text == "\t" else { | |
+ return true | |
+ } | |
+ | |
+ richTextView.becomeFirstResponder() | |
+ return false | |
+ } | |
+ | |
func textViewShouldBeginEditing(_ textView: UITextView) -> Bool { | |
switch textView { | |
case titleTextView: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment