iPhone: Disable the “double-tap spacebar for .” shortcut?

前端 未结 8 1751
陌清茗
陌清茗 2020-11-28 15:29

By default, if you tap the spacebar twice on the iPhone or iPad, instead of getting \"  \" (two spaces), you get \". \" (a period followed by a space). Is the

8条回答
  •  独厮守ぢ
    2020-11-28 15:52

    OK, I figured it out. In your UITextView delegate, add this:

    -(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
        if([text isEqualToString:@". "])
            return NO;
    }
    

提交回复
热议问题