Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
@@ -0,0 +1,36 @@
import UIKit
import UIKitRuntimeUtils
public class PortalView {
public let view: UIView & UIKitPortalViewProtocol
public weak var sourceView: UIView?
public init?(matchPosition: Bool = true) {
guard let view = makePortalView(matchPosition) else {
return nil
}
self.view = view
}
func reloadPortal(sourceView: PortalSourceView) {
self.view.sourceView = sourceView
self.sourceView = sourceView
if let portalSuperview = self.view.superview, let index = portalSuperview.subviews.firstIndex(of: self.view) {
portalSuperview.insertSubview(self.view, at: index)
} else if let portalSuperlayer = self.view.layer.superlayer, let index = portalSuperlayer.sublayers?.firstIndex(of: self.view.layer) {
portalSuperlayer.insertSublayer(self.view.layer, at: UInt32(index))
}
}
func disablePortal() {
self.view.sourceView = nil
self.sourceView = nil
}
public func reloadPortal() {
if let sourceView = self.sourceView as? PortalSourceView {
self.reloadPortal(sourceView: sourceView)
}
}
}