Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ayushgoel/efb597e821271bf346ba to your computer and use it in GitHub Desktop.
Save ayushgoel/efb597e821271bf346ba to your computer and use it in GitHub Desktop.
Perform segue only on main queue
import UIKit
extension UIViewController {
func performSegueOnMainQueue(identifier: String, sender: AnyObject?) {
NSOperationQueue.mainQueue().addOperationWithBlock() {
self.performSegueWithIdentifier(identifier, sender: sender)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment