===================
cd AnarLQRCodeGenerator/AnarLQRCodeGenerator
cp NSImage+QRCode.h NSImage+QRCode.m /to/your/project
Add the two files into your project
#import NSImage+QRCode.h Then you can use it to Create your own QRCode.
1)+ (NSImage *)QRCodeWithText:(NSString *)text;
2)+ (NSImage *)QRCodeWithText:(NSString *)text size:(CGFloat)size;
3)+ (NSImage *)QRCodeWithText:(NSString *)text QRCodeSize:(CGFloat)size QRCodeForeColor:(QRCodeForeColor)foreColor QRCodeBackgroundColor:(QRCodeBackgroundColor)backgroundColor;
4)+ (NSImage *)QRCodeWithText:(NSString *)text QRCodeSize:(CGFloat)size QRCodeForeColor:(QRCodeForeColor)foreColor QRCodeBackgroundColor:(QRCodeBackgroundColor)backgroundColor userIcon:(NSImage *)icon;
23/12/2016 Update
5)+ (NSString *)QRCodeContentWithQRCodeImage:(NSImage *)qrCodeImage;
2.download AnarLQRCodeGenerator.dmg
1.从git安装:git clone https://github.com/Kito0615/AnarLQRCodeGenerator.git
cd AnarLQRCodeGenerator/AnarLQRCodeGenerator (打开AnarLQRCodeGenerator文件夹)
cp NSImage+QRCode.h NSImage+QRCode.m /to/your/project(将NSImage+QRCode.h NSImage+QRCode.m两个文件拷贝到你的工程目录下并添加到你的工程中)
1).+ (NSImage *)QRCodeWithText:(NSString *)text; 直接使用文本生成二维码
2).+ (NSImage *)QRCodeWithText:(NSString *)text size:(CGFloat)size; 使用文本生成指定大小的二维码
3).+ (NSImage *)QRCodeWithText:(NSString *)text QRCodeSize:(CGFloat)size QRCodeForeColor:(QRCodeForeColor)foreColor QRCodeBackgroundColor:(QRCodeBackgroundColor)backgroundColor; 设置文本生成二维码的前景色和背景色
4).+ (NSImage *)QRCodeWithText:(NSString *)text QRCodeSize:(CGFloat)size QRCodeForeColor:(QRCodeForeColor)foreColor QRCodeBackgroundColor:(QRCodeBackgroundColor)backgroundColor userIcon:(NSImage *)icon; 设置文本生成二维码的前景色和背景色,并在中间设置头像
2016-12-23更新
5).+ (NSString *)QRCodeContentWithQRCodeImage:(NSImage *)qrCodeImage; 识别给定二维码图片内容
2.直接下载dmg文件AnarLQRCodeGenerator.dmg
2016年12月23日更新,增加识别给定二维码图片功能。