Skip to content

Instantly share code, notes, and snippets.

@luiseduardohdbackup
Forked from stephsharp/iOS5EmbedSegue.h
Last active August 29, 2015 14:08
Show Gist options
  • Save luiseduardohdbackup/353d58de575e041baaef to your computer and use it in GitHub Desktop.
Save luiseduardohdbackup/353d58de575e041baaef to your computer and use it in GitHub Desktop.
//
// iOS5EmbedSegue.h
// Created by Stephanie Sharp on 2/05/13.
//
#import <UIKit/UIKit.h>
@interface iOS5EmbedSegue : UIStoryboardSegue
@property (nonatomic, strong) UIView * containerView;
@end
//
// iOS5EmbedSegue.m
// Created by Stephanie Sharp on 2/05/13.
//
// Helpful links:
// http://stackoverflow.com/questions/14432310/embed-segue-ios-5
// http://www.quentamia.com/blog/embed-segue-in-ios-5/
#import "iOS5EmbedSegue.h"
@implementation iOS5EmbedSegue
@synthesize containerView;
- (void)perform
{
if (!self.containerView)
self.containerView = [self.sourceViewController view];
[self.sourceViewController addChildViewController:self.destinationViewController];
[self.containerView addSubview:[self.destinationViewController view]];
[self.destinationViewController didMoveToParentViewController:self.sourceViewController];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment