We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, i tried this code let navi = UINavigationController(rootViewController: ModalViewController()) navi.transitioningDelegate = self.transitionManager self.present(navi, animated: true, completion: nil)
let navi = UINavigationController(rootViewController: ModalViewController()) navi.transitioningDelegate = self.transitionManager self.present(navi, animated: true, completion: nil)
with my own custom animation: `class ScaleTransitionAnimation: TransitionManagerAnimation { private weak var panningViewController: UIViewController?
override func transition( container: UIView, fromViewController: UIViewController, toViewController: UIViewController, isDismissing: Bool, duration: TimeInterval, completion: @escaping () -> Void) { if isDismissing { closeAnimation( container: container, fromViewController: fromViewController, toViewController: toViewController, duration: duration, completion: completion) } else { openAnimation( container: container, fromViewController: fromViewController, toViewController: toViewController, duration: duration, completion: completion) } } func openAnimation ( container: UIView, fromViewController: UIViewController, toViewController: UIViewController, duration: TimeInterval, completion: @escaping () -> Void) { container.addSubview(toViewController.view) toViewController.view.top = fromViewController.view.bottom toViewController.view.addGestureRecognizer(UIPanGestureRecognizer(target: self, action: #selector(handlePan(pan:)))) panningViewController = toViewController UIView.animate( withDuration: duration, animations: { toViewController.view.top = 0 }, completion: { finished in completion() }) } func closeAnimation ( container: UIView, fromViewController: UIViewController, toViewController: UIViewController, duration: TimeInterval, completion: @escaping () -> Void) { container.addSubview(toViewController.view) container.bringSubviewToFront(fromViewController.view) UIView.animate( withDuration: duration, animations: { fromViewController.view.frame = CGRect(x: 60, y: 400, width: 120, height: 120) }, completion: { finished in completion() }) } @objc func handlePan(pan: UIPanGestureRecognizer) { let percent = pan.translation(in: pan.view!).y / pan.view!.bounds.size.height switch pan.state { case .began: interactionTransitionController = UIPercentDrivenInteractiveTransition() panningViewController?.dismiss(animated: true, completion: { self.interactionTransitionController?.finish() }) case .changed: interactionTransitionController!.update(percent) case .ended: if percent > 0.5 { interactionTransitionController!.finish() panningViewController = nil } else { interactionTransitionController!.cancel() } interactionTransitionController = nil default: return } }
}` but the transition is not correct, presenting a UIViewController is oke. Can you check that?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, i tried this code
let navi = UINavigationController(rootViewController: ModalViewController()) navi.transitioningDelegate = self.transitionManager self.present(navi, animated: true, completion: nil)
with my own custom animation:
`class ScaleTransitionAnimation: TransitionManagerAnimation {
private weak var panningViewController: UIViewController?
}`
but the transition is not correct, presenting a UIViewController is oke. Can you check that?
The text was updated successfully, but these errors were encountered: