This is quite a simple yet perplexing problem. I have a UIBarButtonItem:
@IBAction func doneButtonPressed(_ sender: UIBarButtonItem) {
guard let name = nameTextField.text,
let estimatedHeight = estimatedHeightTextField.text,
let locationDescription = descripitionTextView.text,
let warnings = warningsTextView.text,
let image = jumpSpotImageView.image else {
// notify user requred fields were blank
return
}
delegate?.createJumpSpotAnnotation(name: name, estimatedHeight: estimatedHeight, locationDescription: locationDescription, warnings: warnings, image: image)
print("doneButton Pressed")
dismiss(animated: true, completion: nil)
}
The code is quite irrelevant however. No matter what I try, the code will not execute once the button is clicked. I have redone the connection between the acutal BarButtonItem in the storyboard and the code several times, deleted it all and re-pasted it, restarted Xcode, etc etc. The circle next to the IBAction is full, and I have even put a print statement in the function to make sure my code wasn't just wrong. However the print statement doesn't even show up in the debugger, telling me the code isn't executing at all. Any idea what's wrong? This is so weird.