Closed schmidan closed 5 years ago
Coming up with the same issue. Downloaded sample to vet the use of the picker.
Looking at the source code the behavior is coming from "ImagePickerUploadController.swift" at line 49.
func start() {
if shouldUseCustomPicker {
viewController.present(customPicker, animated: true, completion: nil)
} else {
viewController.present(nativePicker, animated: true, completion: nil)
}
}
And the shouldUseCustomPicker
computed property at line 59.
var shouldUseCustomPicker: Bool {
let multipleSelectionAllowed = config.maximumSelectionAllowed != 1
let editingEnabled = config.showEditorBeforeUpload
return multipleSelectionAllowed || editingEnabled
}
The customPicker
from the start()
function then uses the PhotoPickerController
on line 80 of the same file. Which just opens up an image picker screen.
var customPicker: UINavigationController {
let picker = PhotoPickerController(maximumSelection: config.maximumSelectionAllowed)
picker.delegate = self
let navigation = picker.navigation
navigation.modalPresentationStyle = config.modalPresentationStyle
return navigation
}
So setting config.maximumSelectionAllowed
to anything other than 1 OR setting config.showEditorBeforeupload = true
will prevent image/video capture.
This seems like it was intended. It's pretty misleading though and should probably be changed.
Fixed in commit eea617e.
since we re-enabled multi file upload via:
config.maximumSelectionAllowed = Config.kMaximumSelectionNoLimit
we had reports from users stating that they could not use the camera as a local source anymore.
you can reproduce this by adding the line
config.maximumSelectionAllowed = 2
to the DemoApp and try to take a Photo with the CameraSkimming thru the code i have this question: does it mean that by using either a
maximumSelection higher than 1
or usingshowEditorBeforeUpload = true
we prevent the user from using the Camera as source?