Discussion:
Definitive guide to custom modal presentation?
(too old to reply)
Rick Mann
2018-11-12 22:46:22 UTC
Permalink
I'm having a really hard time finding a definitive guide to custom modal presentations in iOS.

Nothing I've found online over two days of searching seems correct.

I'm using a Storyboard and want to wire a segue from a button to my view controller. I want it to slide up partway from an edge of the screen, but stop partway across (i.e. not fill the screen). In some orientations/devices, I want it to come up from the bottom. In others, I want it to come in from the right. When presented from the bottom, it should be draggable to reveal more of the drawer (when presented from the right, it's on iPad and always fits), so it needs a interruptible animation the user can scrub through.

Apple's own videos show making a UIStoryboardSegue subclass and making that the UIViewControllerTransitioningDelegate. It's not strictly necessary to make a UIPresentationController subclass, as you can still provide the UIViewControllerAnimatedTransitioning implementations when doing this. But I can't seem to get iOS to ask my custom segue for a UIPresentationController; the method to vend that is never called.

I also can't figure out who's responsible for adding the view to the view hierarchy, is it the UIPresentationController subclass or the UIViewControllerAnimatedTransitioning implementation? Who should respond to the various pan and tap gesture recognizers I'll inevitably need to install?

I appreciate any guidance. Thanks!
--
Rick Mann
***@latencyzero.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email sent to ***@ml-in.narkive.net
Continue reading on narkive:
Loading...