mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-05-01 07:18:08 +02:00
4647310322
Based on Swiftgram 12.5 (Telegram iOS 12.5). All GLEGram features ported and organized in GLEGram/ folder. Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass, Font Replacement, Fake Profile, Chat Export, Plugin System, and more. See CHANGELOG_12.5.md for full details.
45 lines
812 B
Swift
45 lines
812 B
Swift
//
|
|
// NodePropertyMap.swift
|
|
// lottie-swift
|
|
//
|
|
// Created by Brandon Withrow on 1/21/19.
|
|
//
|
|
|
|
import Foundation
|
|
import QuartzCore
|
|
|
|
// MARK: - NodePropertyMap
|
|
|
|
protocol NodePropertyMap {
|
|
var properties: [AnyNodeProperty] { get }
|
|
}
|
|
|
|
extension NodePropertyMap {
|
|
|
|
var childKeypaths: [KeypathSearchable] {
|
|
[]
|
|
}
|
|
|
|
var keypathLayer: CALayer? {
|
|
nil
|
|
}
|
|
|
|
/// Checks if the node's local contents need to be rebuilt.
|
|
func needsLocalUpdate(frame: CGFloat) -> Bool {
|
|
for property in properties {
|
|
if property.needsUpdate(frame: frame) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
/// Rebuilds only the local nodes that have an update for the frame
|
|
func updateNodeProperties(frame: CGFloat) {
|
|
properties.forEach { property in
|
|
property.update(frame: frame)
|
|
}
|
|
}
|
|
|
|
}
|