As practice, I am trying to create a simple math app in which one can input two values as the bases of a right triangle and when they press a button the 3rd leg is calculated. This is the code I am using:
class pythagoreanTheoremViewController: UIViewController {
@IBOutlet weak var baseOneTextField: UITextField!
@IBOutlet weak var baseTwoTextField: UITextField!
@IBOutlet weak var answerLabel: UILabel!
var a = baseOneTextField.text.toInt()
}
However, this returns the error that pythagoreanTheoremViewController.Type does not have a member named 'baseOneTextField'. I deleted and then reconnected my outlets and I still have the same problem.
What am I doing wrong and how do I fix it?
Thanks