@IBOutlet var nameField : UITextField? @IBOutlet var happinessField: UITextField?
@IBAction func add(_ send: Any){
let name = nameField?.text
let happiness: Int? = Int((happinessField?.text!)!)
if (name == nil || happiness == nil) {
print("Erro de solicitação")
}else{
let meal = Meal(name: name!, happiness: happiness!)
print("Eaten \(meal.name) with happiness \(meal.happiness)")
}
}