Last active
February 1, 2017 17:46
-
-
Save mwrites/8d68a5009e5f591416c9c281e8de0176 to your computer and use it in GitHub Desktop.
dismiss two modal without showing first modal background
This file contains hidden or 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
extension UIViewController { | |
func dismissModal(animated: Bool = true, completion: (()->Void)? = nil) { | |
if let snapshot = UIApplication.shared.delegate?.window??.snapshotView(afterScreenUpdates: false) { | |
self.presentedViewController?.view.addSubview(snapshot) | |
} | |
self.dismiss(animated: animated, completion: completion) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment