uitextviewdelegate

Delete (not Backspace) doesn't fire UITextViewDelegate's shouldChangeTextInRange

与世无争的帅哥 提交于 2020-12-29 10:11:15
问题 When using an external keyboard, my UITextView fires a shouldChangeTextInRange message just fine when I press the Backspace key ("backward delete"), but if I press Delete ("forward delete") then the method is never called at all, despite the view's text changing as expected. In case it matters, I'm using Swift and the latest iOS simulator. If this is expected behavior, can someone point me to the documentation that explains it? More importantly, is there a workaround? Edit: submitted rdar:/

Delete (not Backspace) doesn't fire UITextViewDelegate's shouldChangeTextInRange

…衆ロ難τιáo~ 提交于 2020-12-29 10:09:44
问题 When using an external keyboard, my UITextView fires a shouldChangeTextInRange message just fine when I press the Backspace key ("backward delete"), but if I press Delete ("forward delete") then the method is never called at all, despite the view's text changing as expected. In case it matters, I'm using Swift and the latest iOS simulator. If this is expected behavior, can someone point me to the documentation that explains it? More importantly, is there a workaround? Edit: submitted rdar:/

Delete (not Backspace) doesn't fire UITextViewDelegate's shouldChangeTextInRange

只愿长相守 提交于 2020-12-29 10:09:28
问题 When using an external keyboard, my UITextView fires a shouldChangeTextInRange message just fine when I press the Backspace key ("backward delete"), but if I press Delete ("forward delete") then the method is never called at all, despite the view's text changing as expected. In case it matters, I'm using Swift and the latest iOS simulator. If this is expected behavior, can someone point me to the documentation that explains it? More importantly, is there a workaround? Edit: submitted rdar:/

Delete (not Backspace) doesn't fire UITextViewDelegate's shouldChangeTextInRange

雨燕双飞 提交于 2020-12-29 10:06:04
问题 When using an external keyboard, my UITextView fires a shouldChangeTextInRange message just fine when I press the Backspace key ("backward delete"), but if I press Delete ("forward delete") then the method is never called at all, despite the view's text changing as expected. In case it matters, I'm using Swift and the latest iOS simulator. If this is expected behavior, can someone point me to the documentation that explains it? More importantly, is there a workaround? Edit: submitted rdar:/

Detect linebreak in UITextView

可紊 提交于 2020-01-02 14:15:40
问题 Is there a way to detect line breaks occurred by the user or when the textview automatically changes line. I am going to change the height of the textview depending on the number of lines. Any help appreciated. 回答1: You can use the method proposed in this answer to find the occurrences of @"\n", the newline character. You can see if the string change using the textViewDidChange: protocol method (apple doc here). If you want the heigh, directly, look at this answer. I think it can help. 回答2:

Customise the quicktype suggestions in iOS Keyboard

倖福魔咒の 提交于 2019-12-30 17:26:15
问题 I want to have quicktype suggestions to have my own certain application level needed phrases as suggestions when keyboard is open in uitextview. For example if user types "All" - In quicktype suggesstion I want to show "All is well" or "All is as expected". Can I customize the quicktype suggestion text? If not, what could be other way to have this suggestions to show when keyboard is open. 回答1: Since there's no (known) way of changing the quicktype suggestions, I Subclassed UIInputView to

Dynamic UITextView mislocation behavior

回眸只為那壹抹淺笑 提交于 2019-12-22 04:16:05
问题 I am trying to have a textview similar to iPhone messages, where the textview initially has a constraint (height <= 100) and the scrollEnabled = false This is a link to the project: https://github.com/akawther/TextView The text view increases in height based on the content size as in the image on the left until it reaches the height of 100, then the scrollEnabled is set to true. It works perfectly until I click the "send" button on the lower right where the textView should become empty and go

textViewDidChange is not call when change UITextView.inputView?

懵懂的女人 提交于 2019-12-21 20:47:33
问题 I drag a UITextView and hook up delegate with File's Owner . The textViewDidChange is called only with default keyboard, but nothing happen when input text from my keyboard. How to enable delegate of UITextView when set its inputView to a custom keyboard? Here is my code ViewController.m -(void)viewDidLoad{ self.myKeyboard = [[[NSBundle mainBundle] loadNibNamed:@"MyKeyboard" owner:nil options:nil] objectAtIndex:0]; [self.myKeyboard setTextView:self.textView]; } #pragma mark TestViewDelegate -

iPhone: how can I activate a text field programmatically (and not wait for the user to touch it)

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 03:53:00
问题 I have a UIViewController that is a UITextFieldDelegate, and I would like the keyboard for its text field to appear as soon as the user navigates to this view, without having to actually touch the text field. It would also be nice to be able to "dismiss" the entire view when the keyboard is dismissed. I am loading the view from a xib file. I don't have an ivar in the code for the UITextField as yet. I would guess I need one. At this point I am just relying on the delegate to pop up the

Change the UITextView Text Direction

不想你离开。 提交于 2019-12-17 15:47:13
问题 my language is not supported by iOS by default, so unicode is not an option so i am using a embedded true type font on a UITextView it works for the most part, but my issue is like Arabic, and Hebrew my language is written from right to left. So i need to change the direction of the text (Not Text Alignment). i did some searches, they all talk about NSLocale and stuff, but can it be changed in code? if i can change it to something like Arabic/Hebrew it would work i guess, but it should be