Skip to content

Commit 1c66cba

Browse files
committed
fix(barcode-scanner): fix the cameraView is not removed after scanning in iOS
1 parent f81e800 commit 1c66cba

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"barcode-scanner": patch
3+
"barcode-scanner-js": patch
4+
---
5+
6+
Fix the `cameraView` is not removed after scanning in iOS.

plugins/barcode-scanner/ios/Sources/BarcodeScannerPlugin.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate {
170170
if self.captureSession != nil {
171171
self.captureSession!.stopRunning()
172172
self.cameraView.removePreviewLayer()
173+
self.cameraView.removeFromSuperview()
173174
self.captureVideoPreviewLayer = nil
174175
self.metaOutput = nil
175176
self.captureSession = nil

0 commit comments

Comments
 (0)