is there any way to make the new PhotosPicker open the camera instead of opening the photoLibrary, I remember in the old UIImagePickerController there was this option user could choose in the picker if use camera or select from picture.
ImagePikerCircular(im: im, dataImage: $dataImage)
.overlay(alignment: .bottomTrailing) {
PhotosPicker(selection: $im.imageSelection,
matching: .images,
photoLibrary: .shared()) {
Image(systemName: "pencil.circle.fill")
.symbolRenderingMode(.multicolor)
.font(.system(size: 30))
.foregroundColor(.accentColor)
}
.buttonStyle(.borderless)
.photosPickerStyle(.presentation)
}
No, there is no way to open the camera using the PhotosPicker, you will need to create your own selection dialog and when the user taps the camera, open the old UIImagePickerController, you can create a UIViewControllerRepresentable like this:
Then, you can present the picker with a fullScreenCover:
source