I'm trying to retrieve text from a UITextField that I allow the user to create at runtime. I'm using the following line of code.
let thisTextField:UITextField = self.scrollView.viewWithTag(0) as! UITextField
The compiler error states
Could not cast value of type 'UIScrollView' (0x1032faaf0) to 'UITextField' (0x103318dc0).
I've looked through stackoverflow and the above code appears to have worked with previous versions of Swift but does not appear to work with Swift 2.0.