Last active
September 10, 2018 00:08
-
-
Save dkotama/8efb77ba2f94316b2f751df5c729e960 to your computer and use it in GitHub Desktop.
Swift Show Multiple Choices Modal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in case i want to copy paste thing | |
let alertCtrl = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) | |
let galleryBtn = UIAlertAction(title: NSLocalizedString("select_image", comment: ""), style: .destructive, handler: { (action) -> Void in | |
self.openGallery() | |
}) | |
let deletePhotoBtn = UIAlertAction(title: NSLocalizedString("delete_image", comment: ""), style: .destructive, handler: { (action) -> Void in | |
self.editProfilePresenter?.pushUpdateValue(.image_id, values: self.imageId) | |
self.editProfilePresenter?.pushUpdateProfile() | |
}) | |
let cancelBtn = UIAlertAction(title: NSLocalizedString("cancel", comment: ""), style: .cancel, handler: { (action) -> Void in | |
print("CANCEL") | |
}) | |
alertCtrl.addAction(galleryBtn) | |
alertCtrl.addAction(deletePhotoBtn) | |
alertCtrl.addAction(cancelBtn) | |
self.present(alertCtrl, animated: true, completion: nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment