From 7c2f08fd5ccbb76c2dad2b9f7dbfd3885379b93e Mon Sep 17 00:00:00 2001 From: Maksym Huk Date: Tue, 18 Apr 2017 10:17:08 +0300 Subject: [PATCH] =?UTF-8?q?Call=20cancel=20callback=20when=20the=20disable?= =?UTF-8?q?d-or-denied=20dialog=20is=20dismissed=20with=20=E2=80=9COK?= =?UTF-8?q?=E2=80=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PermissionScope/PermissionScope.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PermissionScope/PermissionScope.swift b/PermissionScope/PermissionScope.swift index bda5037..9e12508 100644 --- a/PermissionScope/PermissionScope.swift +++ b/PermissionScope/PermissionScope.swift @@ -1147,7 +1147,14 @@ typealias resultsForConfigClosure = ([PermissionResult]) -> Void preferredStyle: .alert) alert.addAction(UIAlertAction(title: "OK".localized, style: .cancel, - handler: nil)) + handler: { action in + + if let onCancel = self.onCancel { + self.getResultsForConfig({ results in + onCancel(results) + }) + } + })) alert.addAction(UIAlertAction(title: "Show me".localized, style: .default, handler: { action in