Skip to content

Commit 9370858

Browse files
committed
Update some codes syntax to swift3 which causes errors
1 parent 8d0ccce commit 9370858

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ios/RNInCallManager/RNInCallManager.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class RNInCallManager: NSObject, AVAudioPlayerDelegate {
5656
var cameraPermission: String!
5757
var media: String = "audio"
5858

59-
private lazy var device: AVCaptureDevice? = { AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeVideo) }()
59+
private lazy var device: AVCaptureDevice? = { AVCaptureDevice.defaultDevice(withMediaType: AVMediaTypeVideo) }()
6060

6161
// --- AVAudioSessionCategoryOptionAllowBluetooth:
6262
// --- Valid only if the audio session category is AVAudioSessionCategoryPlayAndRecord or AVAudioSessionCategoryRecord.
@@ -254,13 +254,13 @@ class RNInCallManager: NSObject, AVAudioPlayerDelegate {
254254

255255
@objc func setFlashOn(enable: Bool, brightness: NSNumber) -> Void {
256256
guard let device = device else { return }
257-
if device.hasTorch && device.position == AVCaptureDevicePosition.Back {
257+
if device.hasTorch && device.position == .back {
258258
do {
259259
try device.lockForConfiguration()
260260
if enable {
261261
try device.setTorchModeOnWithLevel(brightness.floatValue)
262262
} else {
263-
device.torchMode = .Off
263+
device.torchMode = .off
264264
}
265265
NSLog("RNInCallManager.setForceSpeakerphoneOn(): enable: \(enable)")
266266
device.unlockForConfiguration()

0 commit comments

Comments
 (0)