Skip to content

Commit

Permalink
Fix: now the PMAlertAction callback is called after that the alert wa…
Browse files Browse the repository at this point in the history
…s dismissed
  • Loading branch information
pmusolino committed Jan 16, 2018
1 parent d5d693c commit b2fd856
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Library/PMAlertAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ import UIKit
}

@objc func tapped(_ sender: PMAlertAction) {
self.action?()
//Action need to be fired after alert dismiss
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
self.action?()
}
}

@objc fileprivate func addSeparator(){
Expand Down
1 change: 0 additions & 1 deletion Library/PMAlertController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ import UIKit
}

alertAction.addTarget(self, action: #selector(PMAlertController.dismissAlertController(_:)), for: .touchUpInside)

}

@objc fileprivate func dismissAlertController(_ sender: PMAlertAction){
Expand Down
7 changes: 7 additions & 0 deletions PMAlertController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@
453B4ED51CDE3F0A00BFB901 = {
CreatedOnToolsVersion = 7.3;
LastSwiftMigration = 0900;
ProvisioningStyle = Manual;
};
453B4EE91CDE3F0A00BFB901 = {
CreatedOnToolsVersion = 7.3;
Expand Down Expand Up @@ -525,10 +526,13 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = PMAlertController/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.codeido.PMAlertControllerSample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
Expand All @@ -539,10 +543,13 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = PMAlertController/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.codeido.PMAlertControllerSample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
Expand Down

0 comments on commit b2fd856

Please sign in to comment.