Closed balabon7 closed 1 year ago
Hello,
It's a detail and you have the eye!
If we want to change this behavior, we need to make the following changes in PBPopupPopupPresentationController.swift (commented // Issue #23 in code below):
Can you test? And if it's okay I'll update the framework.
override func presentationTransitionDidEnd(_ completed: Bool)
{
// Issue #23
if self.popupPresentationStyle == .fullScreen {
self.setupCornerRadiusForPopupContentViewAnimated(false, open: false)
}
//
self.popupBarForPresentation?.removeFromSuperview()
self.popupBarForPresentation = nil
self.imageViewForPresentation?.removeFromSuperview()
self.imageViewForPresentation = nil
if !completed {
self.cleanup()
}
else {
self.blackView?.alpha = 1.0
NotificationCenter.default.addObserver(self, selector: #selector(didEnterBackground(_:)), name: UIApplication.didEnterBackgroundNotification, object: nil)
}
}
override func dismissalTransitionWillBegin()
{
guard let coordinator = self.presentedViewController.transitionCoordinator,
let containerView = self.containerView
else {
return
}
self.popupBarForPresentation = self.setupPopupBarForPresentation()
if let popupBarForPresentation = self.popupBarForPresentation {
self.popupContentView.contentView.addSubview(popupBarForPresentation)
popupBarForPresentation.alpha = 0.0
}
self.imageViewForPresentation = self.setupImageViewForPresentation()
if let imageViewForPresentation = self.imageViewForPresentation {
self.popupContentView.contentView.addSubview(imageViewForPresentation)
self.configureImageViewInStartPosition()
}
if let backingView = self.backingView {
backingView.removeFromSuperview()
}
self.backingView = nil
self.setupBackingView()
self.animateBackingViewToDeck(true, animated: false)
self.popupContentView.popupCloseButton?.setButtonStateTransitioning()
// Issue #23
self.setupCornerRadiusForPopupContentViewAnimated(false, open: true)
//
self.popupController.popupStatusBarStyle = self.popupController.containerPreferredStatusBarStyle
coordinator.animate { context in
self.animateBackingViewToDeck(false, animated: true)
if !context.isInteractive {
self.animateImageViewInFinalPosition()
self.popupBarForPresentation?.alpha = 1.0
self.popupContentView.popupCloseButton?.alpha = 0.0
}
self.setupCornerRadiusForPopupContentViewAnimated(true, open: false)
self.presentingVC.setNeedsStatusBarAppearanceUpdate()
containerView.layoutIfNeeded()
} completion: { _ in
self.popupContentView.popupImageView?.isHidden = false
self.popupContentView.popupImageModule?.isHidden = false
}
}
override func dismissalTransitionDidEnd(_ completed: Bool)
{
self.popupBarForPresentation?.removeFromSuperview()
self.popupBarForPresentation = nil
self.imageViewForPresentation?.removeFromSuperview()
self.imageViewForPresentation = nil
// Issue #23
if self.popupPresentationStyle == .fullScreen {
self.setupCornerRadiusForPopupContentViewAnimated(false, open: false)
}
//
if completed {
self.cleanup()
}
else {
self.blackView?.alpha = 1.0
}
}
Now everything works perfectly☺️ No more dark corners. I checked, please update this framework.
Hello Patrick.
When PBPopupPresentationController in the open state (status == .open ) has a defaultCornerRadius = 55.0
If I start opening the Control Center in iOS (with a drag gesture from top to bottom), I will see these black corners in blur
As far as I understand, rounding is configured in extension PBPopupPresentationController (PBPopupController library)
Could you please help me to make this behavior:
When status == .open then cornerRadius = 0.0, but as soon as the user starts the "swipe-to-dismiss" gesture then cornerRadius = 55.0
(and then work with rounding will be implemented as it is now)
It seems to me that we can set up this in this place:
What do you think how best to do it?