I had the same problem while calling the camera view
Swift syntax for the same problem:
dispatch_async(dispatch_get_main_queue(), {
//Code that presents or dismisses a view controller here
self.presentViewController(imagePicker, animated: true, completion: nil)
})