Я пытаюсь заставить работать кнопку отмены и перейти к предыдущему экрану.Я нажимаю за пределами листа действий, и событие отмены все еще происходит.
Вот мой код:
let alertController = UIAlertController(title: "searchEvent", message: nil, preferredStyle: .actionSheet)
alertController.addAction(UIAlertAction(title: "event 1", style: .default, handler: nil)
alertController.addAction(UIAlertAction(title: "event 2", style: .default, handler: nil)
alertController.addAction(UIAlertAction(title: "event 3", style: .default, handler: nil)
alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: {[weak self] (action) in
self?.dismiss(animated: true, completion: nil)
}))