danielsaidi / SwiftUIKit

SwiftUIKit is a Swift SDK that adds extra functionality to Swift & SwiftUI.
MIT License
1.42k stars 56 forks source link

Add identifiable conformance to UIImagePickerController.SourceType #17

Closed daniel-arden closed 1 year ago

daniel-arden commented 1 year ago

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, 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