I have two textFields and a TableView. The Tableview should initially be disabled (meaning the labels greyed out and the cells are not clickable). When both textFields have values, I want the TableView and the tableViewCells to be clickable and not greyed out.
So far, I've added targets to both of the textfields to track when the user is editing:
var isUserEditing: Bool = false
func setup() {
mealItemTextField.addTarget(self, action: #selector(userIsEditing), for: UIControl.Event.editingChanged)
priceTextField.addTarget(self, action: #selector(userIsEditing), for: UIControl.Event.editingChanged)
} …Run Code Online (Sandbox Code Playgroud)