Re: Definitive guide to custom modal presentation?
site_archiver@lists.apple.com Delivered-To: cocoa-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version; bh=TZAw7ps0/ZMg32Ki94qxY/uWIJ7CtUfr5lPwSuhXDGc=; b=eDH7DjFmEbPX1UZlQVeNoH5bs11e1I8/E1Kw487glwr/0RaUB5+RmgTrG6Y6+1mY1S wECcQmCLGhiR7QJpMvN6Wq+qUeMd/HpFaL6DOO/FdZFhYClzQIOft9VOpNKjJWY5qiGk b91muSOGke0RjXAhMo5xV9GcwJqOKEiVA59/x1vID+Zw5Mp6l+hoUB8sOPNKIrWt82/l z8kdzJd3QrcGyfB0Tg1UANBZHdj9B9o+s8QX7ASK6z5m4V4MQgau/XQabmPeV3aSkQQq eCDKmGnkFDRi9RUuqx+Z4I2HIZQUgigFIwRnThvWWImTxAagSJeewVdvvQRYHZxqDU3K sFJg== If you’re implementing a custom animation transition for your presentation, just follow this guide: https://developer.apple.com/library/archive/featuredarticles/ViewControllerP... 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 <rmann@latencyzero.com>, 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 rmann@latencyzero.com
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@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/armand.jesse%40gmail.com
This email sent to armand.jesse@gmail.com
Cocoa-dev mailing list (Cocoa-dev@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/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jesse Armand