Previously, the following code would not yield any animation:
@IBAction func deleteButtonClicked(_ sender: Any) {
exitEditMode()
}
private func exitEditMode() {
addButton.isHidden = false
labelView.isHidden = false
touchableCircleView.isHidden = true
doneButton.isHidden = true
deleteButton.isHidden = true
textField.isHidden = true
doneButton.setImage(UIImage(systemName: "checkmark"), for: .normal)
textField.text = nil
textField.resignFirstResponder()
}
However, when running the code on an actual device with iOS 17.5, it results in an animation.
To avoid the animation, you need to wrap the call to exitEditMode() within UIView.performWithoutAnimation, as shown below:
@IBAction func deleteButtonClicked(_ sender: Any) {
UIView.performWithoutAnimation {
exitEditMode()
}
}
I am unable to reproduce this issue in the Simulator, possibly because it only supports up to iOS 17. Does anyone know why this is happening?