Skip to content

Instantly share code, notes, and snippets.

@rnystrom
Created February 18, 2013 20:33
Show Gist options
  • Save rnystrom/4980453 to your computer and use it in GitHub Desktop.
Save rnystrom/4980453 to your computer and use it in GitHub Desktop.
Setting up RNSwipeViewController in code
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// PTMasterController is a subclass of RNSwipeViewController
PTMasterController *masterController = [[PTMasterController alloc] init];
PTSchemeController *scheme = [[PTSchemeController alloc] init];
PTUtilityController *utility = [[PTUtilityController alloc] init];
PTWritingController *writing = [[PTWritingController alloc] init];
masterController.centerViewController = writing;
masterController.rightViewController = utility;
masterController.leftViewController = scheme;
masterController.leftVisibleWidth = kGridSize + 3 * kPadding;
masterController.rightVisibleWidth = kGridSize * 2 + 3 * kPadding;
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = masterController;
self.window.backgroundColor = [UIColor underPageBackgroundColor];
[self.window makeKeyAndVisible];
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment