@@ -128,25 +128,26 @@ public class CAPCameraPlugin : CAPPlugin, UIImagePickerControllerDelegate, UINav
128
128
129
129
AVCaptureDevice . requestAccess ( for: . video) { granted in
130
130
if granted {
131
- let presentationStyle = call. getString ( " presentationStyle " )
132
- if presentationStyle != nil && presentationStyle == " popover " {
133
- self . configurePicker ( )
134
- } else {
135
- self . imagePicker!. modalPresentationStyle = . fullScreen
136
- }
131
+ DispatchQueue . main. async {
132
+ let presentationStyle = call. getString ( " presentationStyle " )
133
+ if presentationStyle != nil && presentationStyle == " popover " {
134
+ self . configurePicker ( )
135
+ } else {
136
+ self . imagePicker!. modalPresentationStyle = . fullScreen
137
+ }
137
138
138
- self . imagePicker!. sourceType = . camera
139
+ self . imagePicker!. sourceType = . camera
139
140
140
- if self . settings. direction. rawValue == " REAR " {
141
- if UIImagePickerController . isCameraDeviceAvailable ( . rear) {
142
- self . imagePicker!. cameraDevice = . rear
143
- }
144
- } else if self . settings. direction. rawValue == " FRONT " {
145
- if UIImagePickerController . isCameraDeviceAvailable ( . front) {
146
- self . imagePicker!. cameraDevice = . front
141
+ if self . settings. direction. rawValue == " REAR " {
142
+ if UIImagePickerController . isCameraDeviceAvailable ( . rear) {
143
+ self . imagePicker!. cameraDevice = . rear
144
+ }
145
+ } else if self . settings. direction. rawValue == " FRONT " {
146
+ if UIImagePickerController . isCameraDeviceAvailable ( . front) {
147
+ self . imagePicker!. cameraDevice = . front
148
+ }
147
149
}
148
- }
149
- DispatchQueue . main. async {
150
+
150
151
self . bridge. viewController. present ( self . imagePicker!, animated: true , completion: nil )
151
152
}
152
153
} else {
0 commit comments