简体   繁体   中英

Trasform ( or Wrap ) UIViewController into UINavigationController

I try to integrate this sdk ( http://whamcitylights.com/sdk/#iOS ) in a my storyboard application,

My problem is in the point 4.

NOTE: That code assumes you are using a UINavigationController . If necessary you may need to add code to create and initialize it.

Here is an example:

I have UIPageViewController with four different UIViewController and I need to change the last one with a UINavigationController

(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];

self.viewController = ... // however you create your view controller...

UINavigationController *navCon = [[UINavigationController alloc] initWithRootViewController:self.viewController];

navCon.navigationBarHidden = YES;

self.window.rootViewController = navCon;

[self.window makeKeyAndVisible];

return YES;
}

I need to do this in a storyboarded-based application

Thank you all!

用它:

[self.navigationController pushViewController:nextViewController animated:YES];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM