Skip to content

Instantly share code, notes, and snippets.

@wjlafrance
Created May 6, 2012 07:14
Show Gist options
  • Save wjlafrance/2620730 to your computer and use it in GitHub Desktop.
Save wjlafrance/2620730 to your computer and use it in GitHub Desktop.
//
// ExternalViewController.m
//
// Created by William LaFrance.
// Public Domain
//
#import "ExternalViewController.h"
@interface ExternalViewController ()
@property (strong, nonatomic) UIWindow *externalWindow;
@end
@implementation ExternalViewController
@synthesize externalWindow = _externalWindow;
- (id)init
{
self = [super init];
if (self) {
NSAssert([UIScreen screens].count > 1, @"No external display");
self.externalWindow = [[UIWindow alloc] init];
self.externalWindow.screen = [[UIScreen screens] lastObject];
self.externalWindow.rootViewController = self;
[self.externalWindow makeKeyAndVisible];
}
return self;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment