title: Convert String to CGFloat in Swift
body: <p>I'm new to Swift, how can I convert a String to CGFloat?</p>
  
  <p>I tried:</p>
  
  <pre><code>var fl: CGFloat = str as CGFloat
  var fl: CGFloat = (CGFloat)str
  var fl: CGFloat = CGFloat(str)
  </code></pre>
  
  <p>all didn't work</p>