質問編集履歴
1
エラーメッセージの表示
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,7 +32,7 @@
|
|
32
32
|
|
33
33
|
captureSession.sessionPreset = AVCaptureSession.Preset.photo
|
34
34
|
|
35
|
-
|
35
|
+
① if let availabelDevices = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInWideAngleCamera], mediaType: AVMediaType.video, position: .back).devices {
|
36
36
|
|
37
37
|
captureDevice = availabelDevices.first
|
38
38
|
|
@@ -58,7 +58,7 @@
|
|
58
58
|
|
59
59
|
}
|
60
60
|
|
61
|
-
|
61
|
+
② if let previewLayer = AVCaptureVideoPreviewLayer(session: captureSession) {
|
62
62
|
|
63
63
|
self.previewLayer = previewLayer
|
64
64
|
|
@@ -98,10 +98,22 @@
|
|
98
98
|
|
99
99
|
}
|
100
100
|
|
101
|
-
![エラー内容 説明](3a78624548fa29720dbd2a1e244acf28.png)](df3f0880523907d14a40f3a839d1fa32.png)
|
102
101
|
|
103
|
-
```
|
104
102
|
|
105
103
|
二箇所エラーが表示されます。
|
106
104
|
|
107
105
|
修正方法を教えて戴けませんか ?
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
① if let availabelDevices - - - 箇所で
|
110
|
+
|
111
|
+
Initializer for conditional binding must have Optional type, not '[AVCaptureDevice]'
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
② if let previewLayer - - - 箇所で
|
116
|
+
|
117
|
+
Initializer for conditional binding must have Optional type, not 'AVCaptureVideoPreviewLayer'
|
118
|
+
|
119
|
+
というエラーになります。
|