1.首先导入第三方库#import "QRCodeGenerator.h"
2.NSString *strEWM = @"http://www.baidu.com";//网址
UIImageView *imageViewEwm = [[UIImageView alloc]initWithFrame:CGRectMake(20, 300, 70, 70)];//用来显示二维码图片
UIImage *img = [QRCodeGenerator qrImageForString:strEWM imageSize:1000];//制作二位码
imageViewEwm.image = img;//关联二维码
[self.view addSubview:imageViewEwm];//显示在当前视图上