Eu gosto de aprender com exemplos, então peguei e copiei o código, mudei paras minha comidas e agora o meu projeto continua dando erro.
https://twitter.com/vero__tietando/status/914201294331613184
let name:String = nameField!.text!
if let happiness = Int(happinessField!.text!) {
let meal = Meal(name: name, happiness: happiness, items: selected)
print("eaten \(meal.name) with happiness \(meal.happiness) with \(meal.items)!")
if(delegate == nil) {
return
delegate!.add(_,Meal)
if let navigation = navigationController {
navigation.popViewController(animated: true)
}
}
}
}
}