uiviewcontroller - Instantiating a Swift ViewController in an Objective-C project -
i've imported swift uiviewcontroller
in objective-c-based project , i've followed
and
my project doesn't crash, can't view load. i'm attempting instantiate viewcontroller
, shows white blank screen:
uiviewcontroller *rootviewcontroller = [storyboard instantiateviewcontrollerwithidentifier:@"myswiftvc"];
i put breakpoint in after prior line , po rootviewcontroller
gives memory address.
i threw println
in viewdidload
of myswiftvc
, nothing comes up. lights "are on", nothing displays/executes. ideas resolution?
here's method prior line called:
- (void)checkdisclaimer { uistoryboard *storyboard = self.window.rootviewcontroller.storyboard; if ([[[nsuserdefaults standarduserdefaults]valueforkey:@"disclaimeracknowledged"]boolvalue] == no) { // set instantiate disclaimer vc uiviewcontroller *rootviewcontroller = [storyboard instantiateviewcontrollerwithidentifier:@"disclaimer"]; self.window.rootviewcontroller = rootviewcontroller; nslog(@"disclaimer not acknowledged"); } else { // line that's working memory standpoint, nothing happens uiviewcontroller *rootviewcontroller = [storyboard instantiateviewcontrollerwithidentifier:@"launchscreen"]; self.window.rootviewcontroller = rootviewcontroller; nslog(@"disclaimer acknowledged"); } [self.window makekeyandvisible]; }
Comments
Post a Comment