有人可以告诉我如何实现视图以在swift ui中生成QR码

问题描述 投票:0回答:1

我尝试了很多事情并搜索了很多地方,但它们只通过uikit显示

swift swiftui qr-code
1个回答
0
投票

这里是有关生成QR码的教程的链接:https://www.hackingwithswift.com/example-code/media/how-to-create-a-qr-code

该函数返回一个UI图像。像这样,将用户界面图片设置为swiftUI中的图片视图。

Image(generateQRCode(from: "the url as string")!).aspectRatio(contentMode: .fit)
© www.soinside.com 2019 - 2024. All rights reserved.