Skip to content

Instantly share code, notes, and snippets.

@XBeg9
Created December 12, 2012 17:35
Show Gist options
  • Save XBeg9/4269854 to your computer and use it in GitHub Desktop.
Save XBeg9/4269854 to your computer and use it in GitHub Desktop.
Replace rootViewController via custom Segue
#import <UIKit/UIKit.h>
@interface FullyReplaceSegue : UIStoryboardSegue
@end
#import "FullyReplaceSegue.h"
@implementation FullyReplaceSegue
- (void)perform
{
UIViewController *dest = (UIViewController *) self.destinationViewController;
UIWindow *window = [UIApplication sharedApplication].keyWindow;
window.rootViewController = dest;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment