Created
May 27, 2015 10:02
-
-
Save thomassnielsen/d12477848861a4315254 to your computer and use it in GitHub Desktop.
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
import UIKit | |
extension UIViewController { | |
@IBAction func dismiss(sender: AnyObject?) { | |
if let nc = self.navigationController { | |
nc.popViewControllerAnimated(true) | |
} else { | |
self.dismissViewControllerAnimated(true, completion: nil) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment