Skip to content
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

Change scanningDelegate to a weak reference #21053

Merged
merged 3 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class QRLoginCameraSession: NSObject, QRCodeScanningSession {
return AVCaptureVideoPreviewLayer(session: session)
}

var scanningDelegate: QRCodeScanningDelegate?
weak var scanningDelegate: QRCodeScanningDelegate?

func configure() {
configureCamera()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protocol QRCameraPermissionsHandler: CameraPermissionsHandler {
}

/// A delegate that handles when a code was scanned and whether its valid or not
protocol QRCodeScanningDelegate {
protocol QRCodeScanningDelegate: AnyObject {
func validLink(_ stringValue: String) -> Bool
func didScanURLString(_ urlString: String)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import UniformTypeIdentifiers


@objc open class RichTextView: UIView, UITextViewDelegate {
@objc open var dataSource: RichTextViewDataSource?
@objc open var delegate: RichTextViewDelegate?
@objc open weak var dataSource: RichTextViewDataSource?
@objc open weak var delegate: RichTextViewDelegate?


// MARK: - Initializers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private class QRCodeScanningSessionMock: QRCodeScanningSession {
var hasCamera: Bool = true
var session: AVCaptureSession? = nil
var previewLayer: CALayer? = nil
var scanningDelegate: QRCodeScanningDelegate? = nil
weak var scanningDelegate: QRCodeScanningDelegate? = nil

var isConfigured: Bool = false
func configure() {
Expand Down