Ранее для iOS8 мы использовали UIActionSheet для отображения предупреждения, и теперь нам нужно использовать UIAlertController.
Когда мы использовали UIActionSheet, мы могли легко справляться с ситуациями, когда пользователь щелкал за пределами всплывающего окна (что означает, что он хочет отменить операцию), сравнивая clickedButtonAtIndex с cancelButtonIndex - если пользователь действительно нажал вне всплывающего окна, мы получили отмените кнопку кнопки в этой функции.
Как мы можем справиться с этими ситуациями с помощью нового UIAlertController? Я попытался использовать блок "завершения", но у него нет никакого контекста. Есть ли простой способ справиться с этим? (кроме "сохранения" состояний действий в некоторой общей переменной).