How to detect when UITextField become empty
<p>I would like to perform a certain action when UITextField becomes empty (user deletes everything one sign after another or uses the clear option).</p>

<p>I thought about using two methods </p>

<pre><code>- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string;
</code></pre>

<p>and </p>

<pre><code>- (BOOL)textFieldShouldClear:(UITextField *)textField;
</code></pre>

<p>from </p>

<pre><code>UITextFieldDelegate
</code></pre>

<p>I'm not sure how to detect the situation when the text field becomes empty?
I tried with:</p>

<pre><code>if ([textField.text length] == 0)
</code></pre>

<p>but it does't work as the fisrt of the above methods is called before the sign is deleted from the text field.</p>

<p>Any ideas?</p>
