Q:

How to comeback to same view controller after logging in swift 3? 

when I click my Wishlist page in my app then it will move to my Wishlist page there it checks guest or customer if it is guest I need to display login screen upto here working fine but after logging the screen needs to dismiss and need to move to previous My Wishlist page can anyone help me how to implement this ?  

A:

First you should go with @Nitin Gohel's comment like below.  

why you are not simply present a login screen and manage dismissed with logged in data its very simple. 

Just for your knowledge. 
If you are using UINavigationController then you can go on particular screen by use popToViewController like below code. 
for viewCon in (self.navigationController?.viewControllers)! { 
    if viewCon is WishListViewController { // Here you need to change your class name instead of "WishListViewController"
        self.navigationController?.popToViewController(viewCon, animated: true)
        break
    }
}

