mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-30 19:58:39 +00:00
Fix presentation context ordering
This commit is contained in:
parent
2707476621
commit
8d54a41f19
@ -56,7 +56,7 @@ public final class PresentationContext {
|
||||
|
||||
private var presentationDisposables = DisposableSet()
|
||||
|
||||
var topLevelSubview: UIView?
|
||||
var topLevelSubview: () -> UIView? = { nil }
|
||||
|
||||
var isCurrentlyOpaque: Bool {
|
||||
for (controller, _) in self.controllers {
|
||||
@ -93,7 +93,7 @@ public final class PresentationContext {
|
||||
if let topController = topController {
|
||||
return topController.view
|
||||
} else {
|
||||
return self.topLevelSubview
|
||||
return self.topLevelSubview()
|
||||
}
|
||||
}
|
||||
|
||||
@ -259,7 +259,7 @@ public final class PresentationContext {
|
||||
if let view = self.view, let layout = self.layout {
|
||||
for (controller, _) in self.controllers {
|
||||
controller.viewWillAppear(false)
|
||||
if let topLevelSubview = self.topLevelSubview {
|
||||
if let topLevelSubview = self.topLevelSubview() {
|
||||
view.insertSubview(controller.view, belowSubview: topLevelSubview)
|
||||
} else {
|
||||
view.addSubview(controller.view)
|
||||
|
||||
@ -250,6 +250,9 @@ public enum ViewControllerNavigationPresentation {
|
||||
return nil
|
||||
}
|
||||
|
||||
open func didAppearInContextPreview() {
|
||||
}
|
||||
|
||||
private func updateScrollToTopView() {
|
||||
/*if self.scrollToTop != nil {
|
||||
if let displayNode = self._displayNode , self.scrollToTopView == nil {
|
||||
|
||||
@ -318,6 +318,19 @@ public class Window1 {
|
||||
self.overlayPresentationContext = GlobalOverlayPresentationContext(statusBarHost: statusBarHost, parentView: self.hostView.containerView)
|
||||
self.topPresentationContext = PresentationContext()
|
||||
|
||||
self.presentationContext.topLevelSubview = { [weak self] in
|
||||
guard let strongSelf = self else {
|
||||
return nil
|
||||
}
|
||||
if let first = strongSelf.topPresentationContext.controllers.first {
|
||||
return first.0.displayNode.view
|
||||
}
|
||||
if let first = strongSelf._topLevelOverlayControllers.first {
|
||||
return first.view
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
self.presentationContext.updateIsInteractionBlocked = { [weak self] value in
|
||||
self?.isInteractionBlocked = value
|
||||
}
|
||||
@ -762,8 +775,6 @@ public class Window1 {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.presentationContext.topLevelSubview = self._topLevelOverlayControllers.first?.view
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user