pprevalon pprevalon - 1 year ago 83
Swift Question

Swift how to pass data to a UINavigation

Im trying to pass data to a

I know how to do this with a regular view controller and it work fine but when I try to do it with a UINavigationController I get an error "Value of typ 'UINavigationController' has no member 'availaible users'" I checked online for this issue everything I found had to do with using segue. I'm using code only for this project.

func nearbyUsersWithArray(){
let vc = UINavigationController(rootViewController: NearByUsersViewController())

vc.availaibleUsers = ["item to passed here"]
self.present(vc, animated: true, completion: nil)


Answer Source
let vc = NearByUsersViewController()
vc.availableUsers = ["item to passed here"]
let nvc = UINavigationController(rootViewController: vc)
self.present(nvc, animated: true, completion: nil)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download