- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
//创建过滤器
CIFilter *filter = [CIFilter filterWithName:@"CIQRCodeGenerator"];
//过滤器恢复默认
[filter setDefaults];
//给过滤器添加数据
NSString *string = @"http://www.cnblogs.com/PSSSCode/";
//将NSString格式转化成NSData格式
NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
[filter setValue:data forKeyPath:@"inputMessage"];
//获取二维码过滤器生成的二维码
CIImage *image = [filter outputImage];
//将获取到的二维码添加到imageview上
self.imageView.image =[UIImage imageWithCIImage:image];