mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Upgrade peek controller to modern context menu implementation
This commit is contained in:
29
submodules/ContextUI/Sources/PeekControllerContent.swift
Normal file
29
submodules/ContextUI/Sources/PeekControllerContent.swift
Normal file
@@ -0,0 +1,29 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
import AsyncDisplayKit
|
||||
import Display
|
||||
|
||||
public enum PeekControllerContentPresentation {
|
||||
case contained
|
||||
case freeform
|
||||
}
|
||||
|
||||
public enum PeerControllerMenuActivation {
|
||||
case drag
|
||||
case press
|
||||
}
|
||||
|
||||
public protocol PeekControllerContent {
|
||||
func presentation() -> PeekControllerContentPresentation
|
||||
func menuActivation() -> PeerControllerMenuActivation
|
||||
func menuItems() -> [ContextMenuItem]
|
||||
func node() -> PeekControllerContentNode & ASDisplayNode
|
||||
|
||||
func topAccessoryNode() -> ASDisplayNode?
|
||||
|
||||
func isEqual(to: PeekControllerContent) -> Bool
|
||||
}
|
||||
|
||||
public protocol PeekControllerContentNode {
|
||||
func updateLayout(size: CGSize, transition: ContainedViewLayoutTransition) -> CGSize
|
||||
}
|
||||
Reference in New Issue
Block a user