Akshat Aggarwal
Akshat Aggarwal

Reputation: 1

Use of undeclared type 'UIViewController'

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

enter image description here

Upvotes: 0

Views: 2314

Answers (2)

Miah G.
Miah G.

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

Tesan3089
Tesan3089

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

Related Questions