I am using SWRevealViewController in my app. Everything is fine except one thing.
Suppose there are A,B,C 3 items in my SWRevealViewController Menu. I want to open B item programatically using swift.
UPDATE: CODE
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let sw = storyboard.instantiateViewController(withIdentifier: "Reveal") as! SWRevealViewController
let destinationController = storyboard.instantiateViewController(withIdentifier: "VehicleList") as! VehicleList
let navigationController = UINavigationController(rootViewController: destinationController)
sw.pushFrontViewController(navigationController, animated: true)
You can have access to the main screen controller using
frontViewControllerproperty of theSWRevealViewControllerlike that:You can replace the frontViewController using
setFront(_:animated:)function ofSWRevealViewControllerlike: