Skip to content
New issue

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

Fix Implicitly Unwrapped Optional Crash on SideMenuAnimationController.swift #642

Merged
merged 2 commits into from
Oct 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions Pod/Classes/SideMenuAnimationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal final class SideMenuAnimationController: NSObject, UIViewControllerAnim
private weak var containerView: UIView?
private let leftSide: Bool
private weak var originalSuperview: UIView?
private var presentationController: SideMenuPresentationController!
private var presentationController: SideMenuPresentationController?
private unowned var presentedViewController: UIViewController?
private unowned var presentingViewController: UIViewController?
weak var delegate: SideMenuAnimationControllerDelegate?
Expand Down Expand Up @@ -104,7 +104,7 @@ internal final class SideMenuAnimationController: NSObject, UIViewControllerAnim
}

func layout() {
presentationController.containerViewWillLayoutSubviews()
presentationController?.containerViewWillLayoutSubviews()
}
}

Expand All @@ -131,25 +131,25 @@ private extension SideMenuAnimationController {
// prevent any other menu gestures from firing
containerView?.isUserInteractionEnabled = false
if presenting {
presentationController.presentationTransitionWillBegin()
presentationController?.presentationTransitionWillBegin()
} else {
presentationController.dismissalTransitionWillBegin()
presentationController?.dismissalTransitionWillBegin()
}
}

func transition(presenting: Bool) {
if presenting {
presentationController.presentationTransition()
presentationController?.presentationTransition()
} else {
presentationController.dismissalTransition()
presentationController?.dismissalTransition()
}
}

func transitionDidEnd(presenting: Bool, completed: Bool) {
if presenting {
presentationController.presentationTransitionDidEnd(completed)
presentationController?.presentationTransitionDidEnd(completed)
} else {
presentationController.dismissalTransitionDidEnd(completed)
presentationController?.dismissalTransitionDidEnd(completed)
}
containerView?.isUserInteractionEnabled = true
}
Expand Down