Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,17 @@ public final class FloatingBottomSheetPresentationController: UIPresentationCont
adjustBackgroundColors()

guard let coordinator = presentedViewController.transitionCoordinator else {
// Calls viewWillAppear and viewWillDisappear
presentingViewController.beginAppearanceTransition(false, animated: false)
dimmingView.alpha = 1.0
return
}

// Calls viewWillAppear and viewWillDisappear
presentingViewController.beginAppearanceTransition(false, animated: coordinator.isAnimated)

coordinator.animate(alongsideTransition: { [weak self] _ in
self?.dimmingView.alpha = 1.0
self?.presentedViewController.setNeedsStatusBarAppearanceUpdate()
})
}

public override func presentationTransitionDidEnd(_ completed: Bool) {
// Calls viewDidAppear and viewDidDisappear
presentingViewController.endAppearanceTransition()

if !completed {
dimmingView.removeFromSuperview()
Expand All @@ -175,15 +168,10 @@ public final class FloatingBottomSheetPresentationController: UIPresentationCont
presentable?.bottomSheetWillDismiss()

guard let coordinator = presentedViewController.transitionCoordinator else {
// Calls viewWillAppear and viewWillDisappear
presentingViewController.beginAppearanceTransition(true, animated: false)
dimmingView.alpha = 0.0
return
}

// Calls viewWillAppear and viewWillDisappear
presentingViewController.beginAppearanceTransition(true, animated: coordinator.isAnimated)

coordinator.animate { [weak self] context in
self?.dimmingView.alpha = 0.0
if !context.isAnimated {
Expand All @@ -194,8 +182,6 @@ public final class FloatingBottomSheetPresentationController: UIPresentationCont
}

public override func dismissalTransitionDidEnd(_ completed: Bool) {
// Calls viewDidAppear and viewDidDisappear
presentingViewController.endAppearanceTransition()

if completed {
presentable?.bottomSheetDidDismiss()
Expand Down