ios - 通过 iOS 应用程序以编程方式从 iPhone 读取 UDID

标签 ios xcode qr-code

我想生成一个基于 iPhone UDID 号码的二维码。这可能吗?

最佳答案

是的,您可以通过以下方式获取您的 UUID:

let uuid =   UIDevice.current.identifierForVendor?.uuidString

然后用它来创建二维码

func generateQRCode(from string: String) -> UIImage? {
    let data = string.data(using: String.Encoding.ascii)

    if let filter = CIFilter(name: "Any Parameter Name") {
        filter.setValue(data, forKey: uuid)
        let transform = CGAffineTransform(scaleX: 3, y: 3)

        if let output = filter.outputImage?.transformed(by: transform) {
            return UIImage(ciImage: output)
        }
    }

    return nil
}

关于ios - 通过 iOS 应用程序以编程方式从 iPhone 读取 UDID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58407164/

相关文章:

ios - 以编程方式检测 iOS 设备是否受到监督?

xcode - 在 iphone 应用程序的 2 个不同目标的启动图像上飞溅 "Default.png"

ios - 如何根据 uitableview 行选择更改导航栏标题?

ios - "Scan now to download"iPhone App 下载二维码

ios - 是否可以将QRCode图像解码为值

ios - AWS iOS 开发工具包 TLS 支持

ios - Xcode 9.2 Assets 目录编辑器 Pane 为空

iOS 10 和 IDFA 归因归因

ios - iOS 中各种条码阅读器免费 SDK

ios - DynamicCastClassUnconditional 与 destionationViewController