I have an array in one view controller that I want to send to two other view controllers - i am doing it via a prepareForSegue:
var userId = ""
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let FollowersUsersViewController = segue.destination as! FollowersUsersViewController
FollowersUsersViewController.followersUserId = userId
let FollowingUsersViewController = segue.destination as! FollowingUsersViewController
FollowingUsersViewController.followingUserId = userId
}
For the other 2 view controllers I am calling the array like so:
View controller 1:
var followersUserId = String()
let followersProfileId = followersUserId
View controller 2:
var followingUserId = String()
let followingProfileId = followingUserId
It seems to work when i send it to one of the view controllers (and comment out the other) but then only one of the buttons work when i run the app. When I do it for both view controllers (as above) i get a Thread 1: signal SIGABRT error - how can it work for both?
Appreciate any help :)
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)