diff --git a/PBPopupController/PBPopupController/PBPopupController-Swift/PBPopupPresentationController.swift b/PBPopupController/PBPopupController/PBPopupController-Swift/PBPopupPresentationController.swift index f036cda..bebb2e0 100644 --- a/PBPopupController/PBPopupController/PBPopupController-Swift/PBPopupPresentationController.swift +++ b/PBPopupController/PBPopupController/PBPopupController-Swift/PBPopupPresentationController.swift @@ -375,7 +375,7 @@ internal class PBPopupPresentationController: UIPresentationController self.popupContentView.frame = self.popupContentViewFrameForPopupStateClosed(finish: true, isInteractive: true) } presentedView.frame = self.presentedViewFrame() - self.popupBarForPresentation?.center.x = self.popupContentView.contentView.center.x + self.popupBarForPresentation?.center.x = self.popupContentView.bounds.center.x self.animateBottomBarToHidden(false) self.animateBackingViewToDeck(false, animated: true) self.animateImageViewInFinalPosition() @@ -476,9 +476,7 @@ extension PBPopupPresentationController: UIViewControllerAnimatedTransitioning self.popupContentView.frame = self.popupContentViewFrameForPopupStateClosed(finish: false) } presentedView?.frame = self.presentedViewFrame() - - self.popupBarForPresentation?.center.x = self.popupContentView.contentView.center.x - + self.containerView?.layoutIfNeeded() self.popupContentView.isHidden = false @@ -489,8 +487,6 @@ extension PBPopupPresentationController: UIViewControllerAnimatedTransitioning self.popupContentView.frame = self.popupContentViewFrameForPopupStateOpen() presentedView?.frame = self.presentedViewFrame() - self.popupBarForPresentation?.center.x = self.popupContentView.contentView.center.x - self.animateBottomBarToHidden(true) self.animateBottomModuleInFinalPosition() @@ -514,8 +510,8 @@ extension PBPopupPresentationController: UIViewControllerAnimatedTransitioning self.popupContentView.frame = self.popupContentViewFrameForPopupStateOpen() presentedView?.frame = self.presentedViewFrame() - self.popupBarForPresentation?.center.x = self.popupContentView.contentView.center.x - + self.popupBarForPresentation?.center.x = self.popupContentView.bounds.center.x + self.containerView?.layoutIfNeeded() self.animateBottomBarToHidden(true) @@ -529,7 +525,7 @@ extension PBPopupPresentationController: UIViewControllerAnimatedTransitioning } presentedView?.frame = self.presentedViewFrame() - self.popupBarForPresentation?.center.x = self.popupContentView.contentView.center.x + self.popupBarForPresentation?.center.x = self.popupContentView.bounds.center.x if !transitionContext.isInteractive { self.animateBottomBarToHidden(false) @@ -979,7 +975,7 @@ extension PBPopupPresentationController imageRect.size.width += x } - //for debug + // TODO: For debug //let image = presentingVC.view.makeSnapshot(from: imageRect) var snapshotView = self.presentingVC.view! @@ -1062,13 +1058,13 @@ extension PBPopupPresentationController let rect = self.popupContentViewFrameForPopupStateClosed(finish: true) - //for debug + // TODO: For debug //let image = self.presentingVC.view.makeSnapshot(from: rect) let view = self.presentingVC.view.resizableSnapshotView(from: rect, afterScreenUpdates: true, withCapInsets: .zero) - + if popupBar.popupBarStyle == .prominent { - self.presentingVC.popupBar.shadowImageView.isHidden = false + popupBar.shadowImageView.isHidden = false } if isFloating, let view = view { diff --git a/PBPopupControllerSample/PBPopupControllerSample/FirstTableViewController.swift b/PBPopupControllerSample/PBPopupControllerSample/FirstTableViewController.swift index 33b4740..5d3befe 100644 --- a/PBPopupControllerSample/PBPopupControllerSample/FirstTableViewController.swift +++ b/PBPopupControllerSample/PBPopupControllerSample/FirstTableViewController.swift @@ -370,17 +370,6 @@ class FirstTableViewController: UITableViewController, PBPopupControllerDataSour } } #endif - /* - if let popupContentView = self.containerVC.popupContentView { - popupContentView.popupIgnoreDropShadowView = false - popupContentView.popupPresentationDuration = 0.4 - popupContentView.popupCanDismissOnPassthroughViews = true - //popupContentView.popupContentDraggingView = UIView(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 200)) - } - - self.containerVC.popupController.containerPreferredStatusBarStyle = .default - self.containerVC.popupController.popupPreferredStatusBarStyle = .lightContent - */ self.tableView.reloadData() } } @@ -448,8 +437,10 @@ class FirstTableViewController: UITableViewController, PBPopupControllerDataSour //containerVC.popupBar.titleTextAttributes = [NSAttributedString.Key.paragraphStyle: paragraphStyle, NSAttributedString.Key.backgroundColor: UIColor.clear, NSAttributedString.Key.foregroundColor: UIColor.red, NSAttributedString.Key.font: UIFont.systemFont(ofSize: 24)] if let popupContentView = self.containerVC.popupContentView { + // TODO: + //popupContentView.popupEffectView.effect = nil popupContentView.popupIgnoreDropShadowView = false - popupContentView.popupPresentationDuration = 0.4 + //popupContentView.popupPresentationDuration = 0.4 popupContentView.popupCanDismissOnPassthroughViews = true //popupContentView.popupContentDraggingView = UIView(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 200)) }