ios - storyboard.instantiateInitialViewController returns the wrong uiViewController -


i have code in swift.

the code supposed load tutorial page first comers , navigate mainstoryboard.

this if (controller inlinemainviewcontroller ){ used return true returns alwyas false

what can cause main story board not show? or load different viewcontroller?

i have check in identity hierarchy storyboard connected inlinemainviewcontroller uiviewcontroller.

what else should check?

  func chooseandluanchstoryboard(){         settings.registerdefaults()          if( !settings.groupdefaults().boolforkey(onboardingkey)) {             launchstoryboard(storyboard.onboardingtofu)         } else {             launchstoryboard(storyboard.main)         }     }    func launchstoryboard(storyboard: storyboard) {     window = uiwindow(frame: uiscreen.mainscreen().bounds)     uiapplication.sharedapplication().setstatusbarhidden(true, withanimation: .slide)     let storyboard = uistoryboard(name: storyboard.rawvalue, bundle: nil)     let controller = storyboard.instantiateinitialviewcontroller()!     if (controller inlinemainviewcontroller ){         mainviewcontroller = controller as! inlinemainviewcontroller     }     window?.rootviewcontroller = controller     window?.makekeyandvisible() } 

verify within storyboard initial vc , in fact, inlinemainviewcontroller. if vc embedded in uinavigationcontroller or uitabbarcontroller, possible initial vc 1 of classes or subclass. storyboard enum, share code? type of raw value each case string?

i add comment, account new.


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

json - Gson().fromJson(jsonResult, Myobject.class) return values in 0's -