I use UIStepper in a tapleviewcell but I don't know how to save stepper value in my CoreData?
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell: StepperTableViewCell = tableView.dequeueReusableCell(withIdentifier: "cell") as! StepperTableViewCell
//stepper is your UIStepper reference from StepperTableViewCell
cell.stepper.tag = indexPath.row
cell.stepper.addTarget(self, action: #selector(stepperAction(sender:)), for: .valueChanged)
return cell
}
func stepperAction(sender: UIStepper) {
print("Stepper \(sender.tag) clicked. Its value \(sender.value)")
}