I was debugging my app using Instruments and found out that every time I perform self.revealViewController().pushViewController()
memory usage is increasing. I've changed this line to be self.revealViewController().setFront()
and now it looks fine, but I am kinda confused about how it works. What do both of these functions do? How should I navigate if I perform this in didSelectRowAt indexPath
method like:
case "MenuText":
let targetVC = storyboard!.instantiateViewController(withIdentifier: "AllSelectionsNC") as! UINavigationController
let destinationVC = targetVC.topViewController as! AllSelectionsTableViewController
self.revealViewController().setFront(targetVC, animated: true)
self.revealViewController().setFrontViewPosition(.left, animated: true)
self.setStatusBarStyle(.default)
Am I doing something wrong here? Most of tutorials perform segues using storyboard, but I have to perform them from code