From b0be085ca0a5474e3c27a0ba1bf1029161e28471 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Wed, 10 May 2017 17:28:31 -0400 Subject: [PATCH] When using a transition with presentation, use the .custom modal presentation style. Summary: Otherwise the presentation controller will not be used. Reviewers: O2 Material Motion, O4 Material Apple platform reviewers, #material_motion, markwei Reviewed By: O2 Material Motion, O4 Material Apple platform reviewers, #material_motion, markwei Tags: #material_motion Differential Revision: http://codereview.cc/D3201 --- src/transitions/TransitionController.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/transitions/TransitionController.swift b/src/transitions/TransitionController.swift index e575d74..cd41c1d 100644 --- a/src/transitions/TransitionController.swift +++ b/src/transitions/TransitionController.swift @@ -64,7 +64,13 @@ public final class TransitionController { Must be a subclass of MDMTransition. */ public var transition: Transition? { - set { _transitioningDelegate.transition = newValue } + set { + _transitioningDelegate.transition = newValue + + if let transition = newValue as? TransitionWithPresentation { + _transitioningDelegate.associatedViewController?.modalPresentationStyle = .custom + } + } get { return _transitioningDelegate.transition } }