These instructions are an amalgam of steps presented by Wired’s Robbie Gonzalez, Phil of thecubicle.com, and JPerm of YouTube fame.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if TARGET_OS_IPHONE | |
#import <UIKit/UIKit.h> | |
typedef UIImage QRImage; | |
#else | |
#import <AppKit/AppKit.h> | |
typedef NSImage QRImage; | |
#endif | |
+ (QRImage*) QRCodeImageWithData: (NSData*)data size: (CGFloat)size { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add child view | |
UIViewController* controller = [self.storyboard instantiateViewControllerWithIdentifier:@"test"]; | |
[self addChildViewController:controller]; | |
controller.view.frame = CGRectMake(0, 44, 320, 320); | |
[self.view addSubview:controller.view]; | |
[controller didMoveToParentViewController:self]; | |
// remove child view | |
UIViewController *vc = [self.childViewControllers lastObject]; | |
[vc.view removeFromSuperview]; |