title: UITextView Class, intrinsicContentSize issue from Objective-C to Swift
body: <p>I have always worked in <strong>Objective-C</strong>, I have been using <strong>Swift</strong> for a short time .. I had a <code>UITextView</code> class in <strong>Objective-C</strong> where I was working on the <code>intrinsicContentSize</code> method.</p>
  
  <hr>
  
  <p><strong>Objective-C</strong></p>
  
  <pre><code>-(CGSize)intrinsicContentSize {
      if ([self.text length]) return self.contentSize;
      else return CGSizeZero;
  }
  </code></pre>
  
  <p>Now I'm trying to convert my Objective-C code to Swift but I'm having problems with this function ...</p>
  
  <pre><code> override var intrinsicContentSize: CGSize {
           if text.lenght() {
                return contentSize
            } else {
                return CGSize.zero
            }
      }
  </code></pre>
  
  <p><code>text.lenght</code> appears to give me a </p>
  
  <blockquote>
    <p>Value of type error '(UITextRange) -> String? has no member 'length'</p>
  </blockquote>