DKImagePickerController
DKImagePickerController copied to clipboard
Picking photos/videos from custom source like filesystem in addition to Photos (PHAssetCollection)
Would allowing users to pick photos/videos from local filesystem directory or somewhere else than just PHAssetColloection be out of scope of this project?
My project needs Photo/Video picker that allows user to pick from local directory as well as iOS Photo Library at the same time but the current design of DKImagePickerController isn't exactly interested in that kind of configuration.
To seek possibilities, I tried my own experiment in my fork, and found stepping DKGroupDataManager upwards to View Controllers, like DKAssetGroupListVC and DKAssetGroupDetailVC, and pushing DKImageManager behind DKAsset/DKAssetGroup could be an option since View Controllers interact with DKGroupDataManager more often while DKAsset interacts with DKImageManager much more.
Furthermore, this way, we can put non-PHAsset based photos/videos to DKAsset as originalAsset and fetch thumbnail/original image/AVAsset on their own while DKImageManager focuses on fetching PHAsset resources like this:
let pickerController = DKImagePickerController()
var extraGroups: [DKAssetGroup] = []
extraGroups.append(DKPathAssetGroup(source: .bundle, subpath: "DKCameraResource/Images", name: "Camera Resource"))
pickerController.extraGroups = extraGroups
destination.pickerController = pickerController
Please let me know if there is a simpler way to achieve a similar result or this design change is still worth to go. I can push a pull-request immediately if the later is the case.
Thanks, Simon