有没有办法在iOS上生成QR码图像 [英] Is there a way to generate QR code image on iOS

查看:143
本文介绍了有没有办法在iOS上生成QR码图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有标准方法生成QR码并将其附加到iOS客户端应用程序的邮件项目(无服务器代码)?

Is there a standard way to generate a QR code and attach it to a mail item from iOS client app (no server code)?

推荐答案

从iOS 7开始,您可以使用Core Image过滤器生成QR图像。参见最后提示

Since iOS 7, you can use a Core Image filter to generate QR images. See the final tip here:

- (CIImage *)createQRForString:(NSString *)qrString {
    NSData *stringData = [qrString dataUsingEncoding: NSISOLatin1StringEncoding];

    CIFilter *qrFilter = [CIFilter filterWithName:@"CIQRCodeGenerator"];
    [qrFilter setValue:stringData forKey:@"inputMessage"];

    return qrFilter.outputImage;
}

这篇关于有没有办法在iOS上生成QR码图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆