So, I have added goals to my IBActions that I created, which occur when the value of the text field changes. When these actions occur, the system must check whether both text fields are integer. I set the two variables to false and they are set to true when both of them are int. In IBActions, I have instructions that say that a button will be enabled if both variables contain integers. When I run the simulator, this button does not turn on when both text fields contain an integer.
I am new to fast, so if possible, write all the code and where it should be in my code. Here is what I still have:
import UIKit class ViewController: UIViewController, UITextFieldDelegate { @IBOutlet weak var calculatorButton: UIButton! @IBOutlet weak var inspirationLabel: UILabel! @IBOutlet weak var beginningLabel: UILabel! @IBOutlet weak var calculatorContainer: UIView! @IBOutlet weak var answer1Label: UILabel! @IBOutlet weak var doneButton: UIButton! @IBOutlet weak var yourWeightTextField: UITextField! @IBOutlet weak var calorieNumberTextField: UITextField! @IBOutlet weak var menuExampleButton: UIButton! @IBOutlet weak var aboutButton: UIButton! @IBOutlet weak var calculateButton: UIButton! override func viewDidLoad() { super.viewDidLoad()
user4241521
source share