Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to get view controllers from navigation controller in swift

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 764
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: