Reputation: 1
I am using segue to transfer a file to next UIViewController. The name of the first View is RecordSoundsViewController and the name of the second view is PlaySoundsViewController. When I use segue.destinationViewController as! PlaySoundsViewController it shows an error " use of undeclared type 'PlaySoundsViewController ". I don't know how to declare the type of UIViewController. Please Help
Upvotes: 0
Views: 2314
Reputation: 149
Please try follows.
let vc = self.storyboard?.instantiateViewController(withIdentifier: "PlayVC") as! PlaySoundsViewController
vc."id to receive" = "the value to send"
self.navigationController?.pushViewController(vc, animated: true)
Upvotes: 0
Reputation: 422
Are you using multiple targets? If so select the applicable targets for your class in Target-membership from identity inspector.
Or else check the access level for the class public, private.
Upvotes: 1