我尝试了很多事情并搜索了很多地方,但它们只通过uikit显示
这里是有关生成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)