ios - Setting NavigationController as an initial controller -
i have 2 navigation controllers. how can set second 1 - stopwatch
initial navigation controller?
- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // override point customization after application launch. self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; self.window.backgroundcolor = [uicolor whitecolor]; self.swipebetweenvc = [swipe new]; [self setuprootviewcontrollerforwindow]; self.window.rootviewcontroller = self.swipebetweenvc; [self.window makekeyandvisible]; return yes; } - (void)setuprootviewcontrollerforwindow { uistoryboard *storyboard1 = [uistoryboard storyboardwithname:@"main" bundle: nil]; stopwatch *controller1 = (stopwatch *)[storyboard1 instantiateviewcontrollerwithidentifier:@"stopwatch"]; uinavigationcontroller *stopwatch = [[uinavigationcontroller alloc] initwithrootviewcontroller:controller1]; namescontroller *controller2 = (namescontroller *)[storyboard1 instantiateviewcontrollerwithidentifier:@"namescontroller"]; uinavigationcontroller *nameslist = [[uinavigationcontroller alloc] initwithrootviewcontroller:controller2]; self.swipebetweenvc.viewcontrollers = @[nameslist, stopwatch]; }
just put stopwatch view first
self.swipebetweenvc.viewcontrollers = @[stopwatch, nameslist];
Comments
Post a Comment