Prakhar
Prakhar

Reputation: 19

iOS- use of undeclared type viewcontroller

I am trying to switch from one controller to another. But the error shows undeclared type.

I have import UIKit on the controller but that also didn't work.

let storyboard = UIStoryboard(name: "ParticularUserInfo", bundle: nil)
let viewController = storyboard.instantiateViewController(withIdentifier: "AssignedScorerViewController") as! AssignedScorerViewController
viewController.USERID = USERID
self.present(viewController, animated: true, completion: nil)

Upvotes: 2

Views: 143

Answers (1)

Asad Ali Choudhry
Asad Ali Choudhry

Reputation: 5271

Please verify that your Storyboard name is "ParticularUserInfo"? Probably it could be "Main". Also verify that in your storyboard for that particular ViewController identifier is set as "AssignedScorerViewController". to set Identifier, select your ViewController in storyboard and set Storyboard ID, according to my attached screenshot.

enter image description here

Upvotes: 1

Related Questions