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

45 lines
1.2 KiB
Swift

import Foundation
import Postbox
import TelegramCore
import AsyncDisplayKit
final class InstantPageAnchorItem: InstantPageItem {
let wantsNode: Bool = false
let medias: [InstantPageMedia] = []
let anchor: String
var frame: CGRect
init(frame: CGRect, anchor: String) {
self.frame = frame
self.anchor = anchor
}
func matchesAnchor(_ anchor: String) -> Bool {
return anchor == self.anchor
}
func drawInTile(context: CGContext) {
}
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 nil
}
func matchesNode(_ node: InstantPageNode) -> Bool {
return false
}
func linkSelectionRects(at point: CGPoint) -> [CGRect] {
return []
}
func distanceThresholdGroup() -> Int? {
return nil
}
func distanceThresholdWithGroupCount(_ count: Int) -> CGFloat {
return 0.0
}
}