I would like to be able to present the ImagePicker in a native way by having a binding to the source type that once I set it, the ImagePicker would show up with the assigned source type to prevent having 2 sources of truth to first display the ImagePicker for example as a fullScreenCover and then also store the UIImagePickerController.SourceType so that the cover knows what source type to pass in.
Solution
I have extended UIImagePickerController.SourceType with Identifiable conformance to be able to use the fullScreenCover with item modifier
Background
I would like to be able to present the
ImagePicker
in a native way by having a binding to the source type that once I set it, theImagePicker
would show up with the assigned source type to prevent having 2 sources of truth to first display theImagePicker
for example as afullScreenCover
and then also store theUIImagePickerController.SourceType
so that the cover knows what source type to pass in.Solution
I have extended
UIImagePickerController.SourceType
withIdentifiable
conformance to be able to use the fullScreenCover with item modifier