i am creating an app for Know the quantity of liquid I have and I need to storage a number whose in a label, with this label who are connected to a steeper.
I try to UserDefaults.standard.set(mintLabel, forKey: "podsM") but Xcode say that Cannot invoke 'set' with an argument list of type '(UILabel?, forKey: Int)
@IBOutlet weak var mintLabel: UILabel!
@IBOutlet weak var cremeLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
print(UserDefaults.standard.dictionaryRepresentation())
}
@IBAction func mintStepper(_ sender: UIStepper) {
mintLabel.text = String(Int(sender.value))
UserDefaults.standard.set(mintLabel, forKey: "podsM")
}