I am developing a iPhone Photos Gallery app and In my app I created one folder into gallery and that gallery folder is shown up into my app and while use click on Image its
What is the method self.displayPhoto() doing? Do you want to call it after pop? It seems weird.
self.displayPhoto()
Try adding a "return" at the line after self.navigationController?.popToRootViewControllerAnimated(true) to make sure that the execution stops there.
self.navigationController?.popToRootViewControllerAnimated(true)