I\'m new to Swift, how can I convert a String to CGFloat?
I tried:
var fl: CGFloat = str as CGFloat var fl: CGFloat = (CGFloat)str var fl: CGFloat = CGFl
This works:
let str = "3.141592654" let fl = CGFloat((str as NSString).floatValue)