How to create a simple QRCode / barcode scanner app in iOS swift?

Let’s see how we can create a QRCode or barcode scanner app in iOS using swift AVFoundation.

let metadataOutput = AVCaptureMetadataOutput()metadataOutput.setMetadataObjectsDelegate(self, queue: DispatchQueue.main)metadataOutput.metadataObjectTypes = [.qr, .ean8, .ean13, .pdf417]
func metadataOutput(_ output: AVCaptureMetadataOutput,didOutput metadataObjects: [AVMetadataObject],from connection: AVCaptureConnection) {
// do your work here...
}

That’s it. !

If you enjoyed reading this post, please share and give some claps so others can find it 👏👏👏👏👏 !!!!

iOS and tvOS developer, dreamer, photographer 🤨

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store