Post

Replies

Boosts

Views

Activity

Reply to How to create QR code and NFC pass
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? { 		let data = string.data(using: String.Encoding.ascii) 		if let filter = CIFilter(name: "CIQRCodeGenerator") { 				filter.setValue(data, forKey: "inputMessage") 				let transform = CGAffineTransform(scaleX: 3, y: 3) 				if let output = filter.outputImage?.transformed(by: transform) { 						return UIImage(ciImage: output) 				} 		} 		return 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.
Jun ’20
Reply to Observe ALL UITextView text changes in realtime
func textViewDidChange(_ textView: UITextView) {     print(textView.text!)   } } just use the textViewDidChange(_ textView: UITextView) delegate method that is part of the UITextViewDelegate. this method is called after each little change. documentation - https://developer.apple.com/documentation/uikit/uitextviewdelegate/1618599-textviewdidchange
Jun ’20