一、二维码的生成
1 #import "ViewController.h"
2 #import "QRCodeGenerator.h"
3
4 @interface ViewController ()
5
6 @property (nonatomic, strong) UIImageView *iv;
7
8 @end
9
10 @implementation ViewController
11
12 - (void)viewDidLoad {
13 [super viewDidLoad];
14
15 self.iv = [[UIImageView alloc] initWithFrame:CGRectMake((self.view.frame.size.width-300)/2.0, 100, 300, 300)];
16 [self.view addSubview:self.iv];
17 self.iv.image = [QRCodeGenerator qrImageForString:@"我是二维码字符串。。。" imageSize:self.iv.bounds.size.width];
18 }
19 @end
2 #import "QRCodeGenerator.h"
3
4 @interface ViewController ()
5
6 @property (nonatomic, strong) UIImageView *iv;
7
8 @end
9
10 @implementation ViewController
11
12 - (void)viewDidLoad {
13 [super viewDidLoad];
14
15 self.iv = [[UIImageView alloc] initWithFrame:CGRectMake((self.view.frame.size.width-300)/2.0, 100, 300, 300)];
16 [self.view addSubview:self.iv];
17 self.iv.image = [QRCodeGenerator qrImageForString:@"我是二维码字符串。。。" imageSize:self.iv.bounds.size.width];
18 }
19 @end