mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Video embedding
This commit is contained in:
@@ -102,6 +102,19 @@ private final class NavigationControllerNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
public protocol NavigationControllerDropContentItem: class {
|
||||
}
|
||||
|
||||
public final class NavigationControllerDropContent {
|
||||
public let position: CGPoint
|
||||
public let item: NavigationControllerDropContentItem
|
||||
|
||||
public init(position: CGPoint, item: NavigationControllerDropContentItem) {
|
||||
self.position = position
|
||||
self.item = item
|
||||
}
|
||||
}
|
||||
|
||||
open class NavigationController: UINavigationController, ContainableController, UIGestureRecognizerDelegate {
|
||||
public var isOpaqueWhenInOverlay: Bool = true
|
||||
public var blocksBackgroundWhenInOverlay: Bool = true
|
||||
@@ -1221,6 +1234,35 @@ open class NavigationController: UINavigationController, ContainableController,
|
||||
}
|
||||
}
|
||||
|
||||
public func updatePossibleControllerDropContent(content: NavigationControllerDropContent?) {
|
||||
if let rootContainer = self.rootContainer {
|
||||
switch rootContainer {
|
||||
case let .flat(container):
|
||||
if let controller = container.controllers.last {
|
||||
controller.updatePossibleControllerDropContent(content: content)
|
||||
}
|
||||
case .split:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public func acceptPossibleControllerDropContent(content: NavigationControllerDropContent) -> Bool {
|
||||
if let rootContainer = self.rootContainer {
|
||||
switch rootContainer {
|
||||
case let .flat(container):
|
||||
if let controller = container.controllers.last {
|
||||
if controller.acceptPossibleControllerDropContent(content: content) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
case .split:
|
||||
break
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override open func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) {
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user