0

I've a problem to drag and drop images with the new presentation style automatic.

The images are subclass of UIImageView overriding func touchesBegan, touchesMoved and touchesEnded. I've also tried to put self.superview?.isUserInteractionEnabled = false inside touch began to disable the touch of the view.

enter image description here

If I set segue.destination.modalPresentationStyle = .fullScreen it works, but I would like to have the same behavior also with the Automatic style.

Normal behavior:

enter image description here

any idea?

Simone Pistecchia
  • 2,746
  • 3
  • 18
  • 30
  • It's a conflict. Even if you disable the ability to dismiss the "not quite fullscreen" modal, it's still a poor user experience trying to drag while the screen moves down. Making fullscreen is the only option I know of. Or you change the UI so the dragging is horizontal. – rmaddy Sep 30 '19 at 20:03
  • @rmaddy mention to disable the ability would be to set `isModalInPresentation` to `true`. However, I would agree for this to not be the best workaround. – esesmuedgars Sep 30 '19 at 20:10
  • What happens if you set a delegate and implement `presentationControllerShouldDismiss(_:)` to return `false`? – matt Sep 30 '19 at 20:53
  • Also what you are doing is not true drag and drop... You might try that. – matt Sep 30 '19 at 20:54
  • @matt presentationControllerShouldDismiss(_:) didn't work... – Simone Pistecchia Oct 08 '19 at 20:04

0 Answers0