UIPresentationController and its instance methods presentationControllerDidDismiss...:

There is actually no documentation about the methods


- presentationControllerDidAttemptToDismiss:

- presentationControllerDidDismiss:

- presentationControllerShouldDismiss:

- presentationControllerWillDismiss:


When implementing a custom UIPresentationController I assume that the derived class has to send these messages to the delegate at the appropriate times, or?

Replies

For the documentation, send a bug report.


What is your problem ? What do you get, what do you expect ?

No you don't need to implement them for a custom presentation. These are new iOS 13 delegate methods that allow customisation of non custom presentations (UIModalPresentationStyle.automatic) see https://developer.apple.com/videos/play/wwdc2019/224/

I already filed a bug report.


I have a few problems:

  1. I do not know under which conditions presentationControllerDidAttemptToDismiss: and presentationControllerShouldDismiss: are sent. So, I also do not know what to do with them. I have found presentationControllerDidAttemptToDismiss: in a demo program from Apple somewhere and did a similar implementation in my app but actually I do not know what I am doing here.
  2. When writing your own UIPresentationController I assume that I have to call these methods at appropriate times. And I would like to know when to do it (
    presentationControllerWillDismiss: and 
    presentationControllerDidDismiss: are obvious
    ).
  3. It seems to be that UIPresentationController even has its own blocks (e.g. _sendDismiss) for handling these messages. Therefore, I expect that it might not be sufficient just to send these messages but that there are some additional conditions / preparations required.

Thanks for the link.


But I think that you have misunderstood my question. I am implementing my own UIPresentationController and I have to / should send these messages from this controller, too.