Upgrade peek controller to modern context menu implementation

This commit is contained in:
Ilya Laktyushin
2021-05-07 21:16:24 +04:00
parent b1e91b3c72
commit 4a465a5893
42 changed files with 728 additions and 981 deletions

View 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
}