Hi Readers!
Please find below the code that you can use to get view controllers stack from Navigation Controller in swift.
var vc:NSMutableArray = ((navigationController?.viewControllers as! AnyObject) as! NSArray).mutableCopy() as! NSMutableArray
If you don't need the mutable copy you can skip *mutableCopy()* function and get only NSArray using below code
var vcs:NSArray = (navigationController?.viewControllers as! AnyObject) as! NSArray
0 Comment(s)