I want to send json array to another view controller and display it in different labels in another view controller ??
var sendData = [String: AnyObject]()
sendData = datas
print("Send Data : \(sendData)")
DispatchQueue.main.async {
self.performSegue(withIdentifier: "checkLoginViewController", sender: sendData)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let destinationVC = segue.destination as? signUpViewController {
if let sendmyArray = sender as? [String]{
destinationVC.myarray = sendmyArray
}
}
signUpViewController.swift:
var myarray = [String]()
var myemail = ""
var myname = ""
override func viewDidLoad() {
super.viewDidLoad()
MynameLabel.text = myname
nameTextfield.text = myemail
myarray = [myemail,myname]
print(myarray)
print(myemail)
print(myname)
}
i am able to fetch the array but the i am not able to send the array to another view controller and the i have to display it in different label
myarray = [myemail,myname]