override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if saveButton === sender {
var patientNumber = loadPatients()
let id = String(Int((patientNumber?.count)!) + 1)
let name = patientNameTextField.text ?? ""
let location = patientLocationTextField.text ?? ""
let status = "Ok"
let bluetoothAddress = peripheralKeyArray[pickedAddressRow]
// Set the meal to be passed to MealTableViewController after the unwind segue.
patient = Patient(id: id, name: name, location: location, status: status, bluetoothAddress: bluetoothAddress)
//Kill Timer before view closed
timer.invalidate()
}
}
The problem's are
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
and
if saveButton === sender {
Cannot override instance method parameter of type 'Any?' with non-optional type 'Any'
Binary operator '===' cannot be applied to operands of type 'UIBarButtonItem!' and 'Any'
I do not understand these errors even after searching about them. Would really appreciate it if someone could simplify an explanation for me. :) Thank you!