New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New SPM product: UBQRScanner #13
Conversation
/// the successful scanning of a code or specific errors are received via the `QRScannerViewDelegate` methods. | ||
/// - Important: Apps using this view must provide a value for `NSCameraUsageDescription` in their `Info.plist`, | ||
/// else the app will crash as soon as the `startScanning()` method is called. | ||
public class QRScannerView: UIView { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not open?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it should be necessary to subclass this. There is no UI except for the camera view, and if we want to change something in this class, I think it's better to think about changing it in the module itself than creating a subclass.
} | ||
NotificationCenter.default.addObserver(forName: UIApplication.didBecomeActiveNotification, object: nil, queue: nil) { [weak self] _ in | ||
guard let self = self else { return } | ||
if let lastIsRunning = self.lastIsRunning, lastIsRunning == true { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good candidate for a guard structure
eaec527
to
bb9476e
Compare
This PR adds a new product
UBQRScanner
to the UBKit library. The core of this product is a classQRScannerView
, aUIView
subclass that provides functionality related to the scanning of QR codes and other supported formats. Internally, it uses anAVCaptureSession
.Successfully scanned codes (as Strings) and errors are received via the
QRScannerViewDelegate
methods.