are you trying to make something that uses Apple wallet? if so, I would start at about 15 minutes into this - https://developer.apple.com/wwdc18/720 session. if you are trying to do something within your app, you can’t do NFC passes without Apple Wallet, but you can make a QR code. here is a example function that generates a QR code from a string: func generateQRCode(from string: String) -> UIImage? { ttlet data = string.data(using: String.Encoding.ascii) ttif let filter = CIFilter(name: CIQRCodeGenerator) { ttttfilter.setValue(data, forKey: inputMessage) ttttlet transform = CGAffineTransform(scaleX: 3, y: 3) ttttif let output = filter.outputImage?.transformed(by: transform) { ttttttreturn UIImage(ciImage: output) tttt} tt} ttreturn nil } after you have that function, you use it like this: let image = generateQRCode(from: i am going to be so helpful to st0321!) that generates a QR code with the text i am going to be so helpful to st0321! and gives it to you as a UIImage.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: