We’ve arrived at day 83 of the 100 Days of SwiftUI! Yesterday, we focussed on building a tab bar and sharing data across tabs. Today, we’re learning how to generate and scan a QR code. Let’s take a look!
Generating and scaling up a QR code
We’ve worked with Core Image before, so we know how powerful it is when working with images. The same framework can also be used to generate QR codes. The catch is that the image it generates is very small, so for the sake of usability, we need to scale it up as well.
Scanning QR codes with SwiftUI
Scanning a QR code – or indeed any kind of visible code such as barcodes – can be done by Apple’s AVFoundation library. This doesn’t integrate into SwiftUI quite well just yet, but Paul’s got us covered.
Wrap up
And that’s it for day 83! We’ll move on to the final part of our project tomorrow, as we’ll go back to UserDefaults
and pushing notifications to our users’ lockscreen. Stay tuned for that!
100 Days of SwiftUI – Day 83