Last active
May 18, 2019 03:16
-
-
Save adamgraham/45b9318260cf0a40ed60e86059525bc5 to your computer and use it in GitHub Desktop.
An @IBDesignable iOS class that can be used in Interface Builder as a custom segue to dismiss a modally presented view controller.
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
@IBDesignable class DismissSegue: UIStoryboardSegue { | |
var completion: (() -> Void)? | |
override func perform() { | |
self.source.presentingViewController?.dismiss(animated: UIView.areAnimationsEnabled, completion: self.completion) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment