Skip to content

Commit 51c9ed2

Browse files
committed
feat(ios): remove simulator camera restriction
Remove the compile-time check that throws `notAvailableOnSimulator` error on iOS simulators. This enables camera functionality with tools like RocketSim that provide virtual camera support in the iOS Simulator. Also removes the now-unused `DeviceError.notAvailableOnSimulator` case.
1 parent 0d7b939 commit 51c9ed2

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

package/ios/Core/CameraError.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ enum DeviceError {
7676
case microphoneUnavailable
7777
case lowLightBoostNotSupported
7878
case focusNotSupported
79-
case notAvailableOnSimulator
8079
case pixelFormatNotSupported(targetFormats: [FourCharCode], availableFormats: [FourCharCode])
8180

8281
var code: String {
@@ -95,8 +94,6 @@ enum DeviceError {
9594
return "low-light-boost-not-supported"
9695
case .focusNotSupported:
9796
return "focus-not-supported"
98-
case .notAvailableOnSimulator:
99-
return "camera-not-available-on-simulator"
10097
case .pixelFormatNotSupported:
10198
return "pixel-format-not-supported"
10299
}
@@ -118,8 +115,6 @@ enum DeviceError {
118115
return "The currently selected camera device does not support focusing!"
119116
case .microphoneUnavailable:
120117
return "The microphone was unavailable."
121-
case .notAvailableOnSimulator:
122-
return "The Camera is not available on the iOS Simulator!"
123118
case let .pixelFormatNotSupported(targetFormats: targetFormats, availableFormats: availableFormats):
124119
let tried = targetFormats.map { $0.toString() }
125120
let found = availableFormats.map { $0.toString() }

package/ios/Core/CameraSession+Configuration.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ extension CameraSession {
2424
}
2525
videoDeviceInput = nil
2626

27-
#if targetEnvironment(simulator)
28-
// iOS Simulators don't have Cameras
29-
throw CameraError.device(.notAvailableOnSimulator)
30-
#endif
31-
3227
guard let cameraId = configuration.cameraId else {
3328
throw CameraError.device(.noDevice)
3429
}

0 commit comments

Comments
 (0)