ios – How do I instantiate Storyboard ViewController?


I’ve objc code (SUOTAViewController) that I’m together with in my Swift mission. I even have a storyboard related to that ViewController with the storyboardID “suotaViewController”.

When I attempt to instantiate it like this:

func navigateToUpdateViewController(imageURL: URL) {
        let storyboard = UIStoryboard(identify: "Fundamental", bundle: nil)
        let vc = storyboard.instantiateViewController(withIdentifier: "suotaViewController") as! SUOTAViewController
        vc.imageURL = imageURL
        self.navigationController?.pushViewController(vc, animated: true)

I get an error “Couldn’t solid worth of kind ‘UIViewController’ to ‘SUOTAViewController’

Why is that this occurring?

Right here is my SUOTAViewController if it helps:


#import "SUOTAViewController.h"

@interface SUOTAViewController ()


@implementation SUOTAViewController

@synthesize blockSize;

- (void)viewDidLoad {
    [super viewDidLoad];
    self.textView.textual content = @"";
    storage = [ParameterStorage getInstance];
    supervisor = storage.supervisor;
    storage.file_url = self.imageURL;
    [self.progressView setProgress:0];
    [self.progressTextLabel setText:[NSString stringWithFormat:@"%d%%", 0]];
    // Allow notifications on the standing attribute
    [manager setNotifications:GenericServiceManager.SPOTA_SERVICE_CBUUID characteristicUUID:GenericServiceManager.SPOTA_SERV_STATUS_CBUUID enable:YES];
} ...


Leave a Reply