Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save RaajeevChandran/f32f641547ffda289d5a0767a635ab5e to your computer and use it in GitHub Desktop.

Select an option

Save RaajeevChandran/f32f641547ffda289d5a0767a635ab5e to your computer and use it in GitHub Desktop.
class BottomSheetTransitioningDelegate: NSObject {
let transition: BottomSheetTransition
override init() {
self.transition = BottomSheetTransition()
}
}
extension BottomSheetTransitioningDelegate: UIViewControllerTransitioningDelegate {
func animationController(
forPresented presented: UIViewController,
presenting: UIViewController,
source: UIViewController
) -> UIViewControllerAnimatedTransitioning? {
transition.presenting = true
transition.wantsInteractiveStart = false
return transition
}
func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
transition.presenting = false
return transition
}
func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
transition.presenting = false
return transition
}
func presentationController(
forPresented presented: UIViewController,
presenting: UIViewController?,
source: UIViewController
) -> UIPresentationController? {
BottomSheetPresentationController(presentedViewController: presented,
presenting: presenting)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment