Skip to content

Commit d1d7e2b

Browse files
committed
Renamed "requirePhotoOutput" to "requiresPhotoOutput"
1 parent 303bd5a commit d1d7e2b

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Sources/CodeScanner/CodeScanner.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public struct CodeScannerView: UIViewControllerRepresentable {
8181
public let manualSelect: Bool
8282
public let scanInterval: Double
8383
public let showViewfinder: Bool
84-
public let requirePhotoOutput: Bool
84+
public let requiresPhotoOutput: Bool
8585
public var simulatedData = ""
8686
public var shouldVibrateOnSuccess: Bool
8787
public var isTorchOn: Bool
@@ -96,7 +96,7 @@ public struct CodeScannerView: UIViewControllerRepresentable {
9696
manualSelect: Bool = false,
9797
scanInterval: Double = 2.0,
9898
showViewfinder: Bool = false,
99-
requirePhotoOutput: Bool = true,
99+
requiresPhotoOutput: Bool = true,
100100
simulatedData: String = "",
101101
shouldVibrateOnSuccess: Bool = true,
102102
isTorchOn: Bool = false,
@@ -109,7 +109,7 @@ public struct CodeScannerView: UIViewControllerRepresentable {
109109
self.scanMode = scanMode
110110
self.manualSelect = manualSelect
111111
self.showViewfinder = showViewfinder
112-
self.requirePhotoOutput = requirePhotoOutput
112+
self.requiresPhotoOutput = requiresPhotoOutput
113113
self.scanInterval = scanInterval
114114
self.simulatedData = simulatedData
115115
self.shouldVibrateOnSuccess = shouldVibrateOnSuccess
@@ -136,6 +136,14 @@ public struct CodeScannerView: UIViewControllerRepresentable {
136136

137137
}
138138

139+
extension CodeScannerView {
140+
141+
@available(*, deprecated, renamed: "requiresPhotoOutput")
142+
public var requirePhotoOutput: Bool {
143+
requiresPhotoOutput
144+
}
145+
}
146+
139147
@available(macCatalyst 14.0, *)
140148
struct CodeScannerView_Previews: PreviewProvider {
141149
static var previews: some View {

Sources/CodeScanner/ScannerViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ extension CodeScannerView.ScannerViewController: AVCaptureMetadataOutputObjectsD
476476
}
477477
}
478478

479-
if parentView.requirePhotoOutput {
479+
if parentView.requiresPhotoOutput {
480480
isCapturing = true
481481
photoOutput.capturePhoto(with: AVCapturePhotoSettings(), delegate: self)
482482
} else {

0 commit comments

Comments
 (0)