mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
22 lines
569 B
Swift
22 lines
569 B
Swift
import UIKit
|
|
import UIKitRuntimeUtils
|
|
|
|
public class PortalView {
|
|
public let view: UIView & UIKitPortalViewProtocol
|
|
|
|
public init?() {
|
|
guard let view = makePortalView() else {
|
|
return nil
|
|
}
|
|
self.view = view
|
|
}
|
|
|
|
func reloadPortal(sourceView: PortalSourceView) {
|
|
self.view.sourceView = sourceView
|
|
|
|
if let portalSuperview = self.view.superview, let index = portalSuperview.subviews.firstIndex(of: self.view) {
|
|
portalSuperview.insertSubview(self.view, at: index)
|
|
}
|
|
}
|
|
}
|