Generates a Quick Response code (two-dimensional barcode) from input data. Parameters *inputMessage* The data to be encoded as a QR code. AnNSData object whose display name is Message.
*inputCorrectionLevel* A single letter specifying the error correction format. AnNSString object whose display name is CorrectionLevel. Default value:M
Discussion Generates an output image representing the input data according to the ISO/IEC 18004:2006 standard. The width and height of each module (square dot) of the code in the output image is one point. To create a QR code from a string or URL, convert it to an[NSData](https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/index.html#//apple_ref/occ/cl/NSData)object using the[NSISOLatin1StringEncoding](https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/index.html#//apple_ref/c/econst/NSISOLatin1StringEncoding)string encoding. The*inputCorrectionLevel* parameter controls the amount of additional data encoded in the output image to provide error correction. Higher levels of error correction result in larger output images but allow larger areas of the code to be damaged or obscured without. There are four possible correction modes (with corresponding error resilience levels): L : 7% M : 15% Q : 25% H : 30%
Member Of CICategoryBuiltIn ,CICategoryStillImage ,CICategoryGenerator Sample Output **Figure 91**The result of using the CIQRCodeGenerator filter 
修改二维码的颜色,这一段是在网上找的,把生成的二维码图片传入,再传入想要的颜色即可 图片要传没有加过 logo 的
(1)二维码上加logo图的时候,图片很模糊,这是由于UIGraphicsBeginImageContextWithOptions里的 scale 造成的,由于 iPhone 的屏幕都是retina屏幕,都是2倍,3倍像素,这里的 scale 要根据屏幕来设置 即[[UIScreen mainScreen] scale]这样图片就会很清晰 (2)setRectOfInterest:设置扫描信息的识别区域,左上角为(0,0),右下角为(1,1),不设的话全屏都可以识别。设置过之后可以缩小信息扫描面积加快识别速度,原来扫描的是整个屏幕的大小,这时候只扫描一块区域,以此加快识别速度。但是这个属性并不好设置,整了半天也没太搞明白,到底x,y,width,height,怎么是对应的,而且是比例不是直接的数字,我是一点一点试的扫描区域,看不到情况,只能调一下,扫一扫试试 最后也没整明白,哪位大神知道,求解答 附上官方解释: The value of this property is a CGRect that determines the receiver’s rectangle of interest for each frame of video. The rectangle’s origin is top left and is relative to the coordinate space of the device providing the metadata. Specifying a rectOfInterest may improve detection performance for certain types of metadata. The default value of this property is the value CGRectMake(0, 0, 1, 1). Metadata objects whose bounds do not intersect with the rectOfInterest will not be returned.