here is my code at the appdelegate:
func showMainView()
{
self.window = UIWindow(frame: UIScreen.main.bounds)
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let secondViewController = storyBoard.instantiateViewController(withIdentifier: "PRODUCT_TABBAR_VC_ID")
let nav = UINavigationController()
nav.pushViewController(secondViewController, animated: true)
self.window!.rootViewController = nav
self.window!.makeKeyAndVisible()
}
simulator output:
basicaly i want when user press back button then came back main page . i mean initial page .
i am trying with this one but it not working at least one answer for me Navigate Back to previous view controller
Note : @matt said it is imposible. so could you tell me please what should i do . i am new to iOS
Update:
when user select Man that time tabviewcontroller two page only showing list of product about Man. so if user want to see Woman then user back to main page to select Woman then he will see Woman tabviewcontroller two page.