I am trying to segue to a new viewcontroller in swift 3. I am also trying to send an array to the new viewcontroller, I am doing this programmatically as well. here is the code for my segue:
performSegue(withIdentifier: "AlbumSegue", sender:self) {
let destinationVC = segue.destination as! DestinationViewController
destinationVC.recievedArray = selectedAlbumArray
The error I get is "Extra Argument 'Sender' in Call"
So if I take out the sender part and my code becomes:
performSegue(withIdentifier: "AlbumSegue") {
let destinationVC = segue.destination as! DestinationViewController
destinationVC.recievedArray = selectedAlbumArray
}
I then get an error saying "use of unresolved Identifier 'segue'"
But I've found code examples like this:
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let destinationVC = segue.destination as! DestinationViewController
destinationVC.receivedString = stringToPass
}
}
Basically both of these problems are in TEMPLATES for doing this so I don't know why either errors are occurring because according to answers on StackOverflow these aren't errors at all.