Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can directly handle keyboard events every-time a user presses a key :</p> <p>In case of <strong>UITextField</strong> </p> <pre><code>- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { // Do something here... } </code></pre> <p>In Case of <strong>UITextView</strong> :</p> <pre><code>- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { // Do something here... } </code></pre> <p>So every-time one of these method is called for each key you press using keyboard.</p> <p>You can use NSNotificationCenter also. You only need do add any of these in ViewDidLoad method.</p> <pre><code>NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; </code></pre> <p><strong>UITextField :</strong> </p> <pre><code>[notificationCenter addObserver:self selector:@selector(textFieldText:) name:UITextFieldTextDidChangeNotification object:yourtextfield]; </code></pre> <p>Then you can put your code in method <code>textFieldText:</code>:</p> <pre><code>- (void)textFieldText:(id)notification { // Do something here... } </code></pre> <p><strong>UITextView</strong></p> <pre><code>[notificationCenter addObserver:self selector:@selector(textViewText:) name:UITextViewTextDidChangeNotification object:yourtextView]; </code></pre> <p>Then you can put your code in method <code>textViewText:</code>:</p> <pre><code>- (void)textViewText:(id)notification { // Do something here... } </code></pre> <p>Hope it helps .</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload