UITextView characters remaining
<p>How can I set characters remaining on a <code>UILabel</code> for the <code>UITextView</code>?</p>

<p>I have done this for the <code>UITextField</code>, but the same code does not work..</p>

<p>This is what I have tried:</p>

<pre><code>func textView(textView: UITextView, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -&gt; Bool
 {
        if string == ""
        {
            if plainTextView.text!.characters.count == 0
            {
                charCount = 0
                countLabel.text = String(format: "%i Characters Left", maxLength - charCount)
                return false
            }
            charCount = (plainTextView.text!.characters.count - 1)
            countLabel.text = String(format: "%i Characters Left", maxLength - charCount)
            return true
        }
        else
        {
            charCount = (plainTextView.text!.characters.count + 1)
            countLabel.text = String(format: "%i Characters Left", maxLength - charCount)

            if charCount &gt;= maxLength + 1
            {
                charCount = maxLength
                countLabel.text = String(format: "%i Characters Left", maxLength - charCount)
                return false;
            }
        }
        return true
    }
</code></pre>

<p>Any suggestions?</p>