Swiftgram/TelegramUI/InstantPageFeedbackItem.swift
2018-11-02 11:52:37 +04:00

45 lines
1.3 KiB
Swift

import Foundation
import Postbox
import TelegramCore
import AsyncDisplayKit
final class InstantPageFeedbackItem: InstantPageItem {
var frame: CGRect
let wantsNode: Bool = true
let medias: [InstantPageMedia] = []
init(frame: CGRect) {
self.frame = frame
}
func node(account: Account, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (Int, Int) -> Void) -> (InstantPageNode & ASDisplayNode)? {
return InstantPageFeedbackNode(account: account, strings: strings, theme: theme, openPeer: openPeer)
}
func matchesAnchor(_ anchor: String) -> Bool {
return false
}
func matchesNode(_ node: InstantPageNode) -> Bool {
if node is InstantPageFeedbackNode {
return true
}
return false
}
func distanceThresholdGroup() -> Int? {
return nil
}
func distanceThresholdWithGroupCount(_ count: Int) -> CGFloat {
return 0.0
}
func linkSelectionRects(at point: CGPoint) -> [CGRect] {
return []
}
func drawInTile(context: CGContext) {
}
}