Q: How can I implement a pull down to dismiss a modal view in SwiftUI? I'm displaying a modal image picker and would like the ability to dismiss the view (by pulling down like with UIKit) without clicking the cancel button in the corner.
My Image Picker is shown with this.
.sheet(isPresented: $isShowPhotoLibrary) {
    ImagePicker(sourceType: .photoLibrary)
}

And is instantiated like so...
struct ImagePicker: UIViewControllerRepresentable {
    
    var sourceType: UIImagePickerController.SourceType = .photoLibrary
    
    func makeUIViewController(context: UIViewControllerRepresentableContext<ImagePicker>) -> UIImagePickerController {
        
        // Return an instance of UIImagePickerController
        let imagePicker = UIImagePickerController()
        imagePicker.allowsEditing = false
        imagePicker.sourceType = sourceType
        
        return imagePicker
    }
    
    func updateUIViewController(_ uiViewController: UIImagePickerController, context: UIViewControllerRepresentableContext<ImagePicker>) {
        
    }
}


A: UIImagePickerController overlaps entire sheet's area and does not allow to handle drag, so, as a workaround, a possible approach could be to add some kind of notch (concept is recognizable so the usability will be clear)
Here is a demo (you can construct style/background according to your app design)
VStack(spacing: 0) {
    RoundedRectangle(cornerRadius: 2)
        .frame(width: 60, height: 4).foregroundColor(.gray)
        .padding(.vertical, 4)
    ImagePicker(sourceType: .photoLibrary)
}

