Skip to content

Instantly share code, notes, and snippets.

View steffex's full-sized avatar

Stefan Jansen steffex

View GitHub Profile
@steffex
steffex / AppDelegate.m
Last active January 5, 2016 20:51
Set different initial viewcontroller in storyboard
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
if (![self deviceHasCamera]) {
// the storyboard name is the part before .storyboard
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main"
bundle:nil];
// set the rootviewController to the viewcontroller in the storyboard above.
self.window.rootViewController = [mainStoryboard instantiateViewControllerWithIdentifier:@"noCamera"];
}