Re: Definitive guide to custom modal presentation?
Re: Definitive guide to custom modal presentation?
- Subject: Re: Definitive guide to custom modal presentation?
- From: Jesse Armand <email@hidden>
- Date: Thu, 15 Nov 2018 00:37:25 +0800
If you’re implementing a custom animation transition for your presentation,
just follow this guide:
https://developer.apple.com/library/archive/featuredarticles/ViewControllerPGforiPhoneOS/CustomizingtheTransitionAnimations.html
The transition context object provides the container view that is involved in
displaying the subviews during transition. Then because you seem to be looking
for interactive animation driven by gestures, you can implement
startInteractiveTransition(_:) on your custom animation controller that
conforms to UIViewControllerInteractiveTransitioning.
That animation controller can implement the
UIViewControllerTransitioningDelegate and be the transitioningDelegate.
I don’t know about setting up all of these with segues though. I’d recommend to
just programatically create the view controllers.
On 13 Nov 2018, 6:46 AM +0800, Rick Mann <email@hidden>, wrote:
> 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
> email@hidden
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> 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:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden