gualtierofrigerio / GFLiveScanner

Import this package to perform live scanning of barcodes, QR codes and OCR.
MIT License
6 stars 1 forks source link

Example of using this Library with SwiftUI #1

Open ammar-alee opened 3 years ago

ammar-alee commented 3 years ago

Hello @gualtierofrigerio, I hope you are doing. You have done great work by creating this Library. Hats off. I am new to iOS development and having trouble using your library with SwifUI. I tried looking at the OCR Example which is also amazing and now I wanted to test/play with it using SwiftUI. Can you please create an example using SwiftUI. Thank you and looking forward to hearing from you soon.

Thank you.

Best Regards,

gualtierofrigerio commented 3 years ago

Hi, I added a SwiftUI example to the repo OCR Example. As you can see you have to use UIViewControllerRepresentable to deal with UIKit. The sample SwiftUI view I added only uses the image picker controller for photo/camera, I'll add maybe another example whenever I'll have time to import the OCR view controller but it will also involve UIViewControllerRepresentable so it won't be much different. At the moment there are things we can't do in SwiftUI without including a UIKit view or view controller but that may change this WWDC or in the future.

ammar-alee commented 3 years ago

Hi, I added a SwiftUI example to the repo OCR Example. As you can see you have to use UIViewControllerRepresentable to deal with UIKit. The sample SwiftUI view I added only uses the image picker controller for photo/camera, I'll add maybe another example whenever I'll have time to import the OCR view controller but it will also involve UIViewControllerRepresentable so it won't be much different. At the moment there are things we can't do in SwiftUI without including a UIKit view or view controller but that may change this WWDC or in the future.

Thank you so very much for a quick response, example, and insight/update/heads-up regarding SwiftUI. Really appreciated.