title: Conditional cast from 'String' to 'String' always succeeds- Swift
body: <p>I'm getting these errors: Error: Conditional cast from 'String' to 'String' always succeeds and Error: Cannot assign to value: 'anchorOffset' is a 'let'</p>
  <pre><code> let text = getTextPart()
  
      if let text = text as? String {// Error: Conditional cast from 'String' to 'String' always succeeds
   let lastOffset = text.lengthAsNSString()
        var updatedAnchorOffset = lastOffset
        var updatedFocusOffset = lastOffset
        if var anchorOffset = anchorOffset {
          updatedAnchorOffset = lastOffset
      }
        if var focusOffset = focusOffset {
          updatedFocusOffset = lastOffset
        } else {
          anchorOffset = 0//Error: Cannot assign to value: 'anchorOffset' is a 'let' constant
          focusOffset = 0//Error: Cannot assign to value: 'focusOffset' is a 'let' constant
        }
  }
  </code></pre>
  <p>This is my getTextPart():</p>
  <pre><code>override func getTextPart() -&gt; String {
      guard let textNode = getLatest() as? TextNode else {
        return text
      }
      return textNode.text
    }
  </code></pre>