mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Stream improvements
This commit is contained in:
@@ -617,7 +617,7 @@ public extension CombinedComponent {
|
||||
return UIView()
|
||||
}
|
||||
|
||||
func update(view: View, availableSize: CGSize, environment: Environment<EnvironmentType>, transition: Transition) -> CGSize {
|
||||
func update(view: View, availableSize: CGSize, state: State, environment: Environment<EnvironmentType>, transition: Transition) -> CGSize {
|
||||
let context = view.getCombinedComponentContext(Self.self)
|
||||
|
||||
let storedBody: Body
|
||||
@@ -823,4 +823,8 @@ public extension CombinedComponent {
|
||||
static func Guide() -> _ChildComponentGuide {
|
||||
return _ChildComponentGuide()
|
||||
}
|
||||
|
||||
static func StoredActionSlot<Arguments>(_ argumentsType: Arguments.Type) -> ActionSlot<Arguments> {
|
||||
return ActionSlot<Arguments>()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public protocol Component: _TypeErasedComponent, Equatable {
|
||||
|
||||
func makeView() -> View
|
||||
func makeState() -> State
|
||||
func update(view: View, availableSize: CGSize, environment: Environment<EnvironmentType>, transition: Transition) -> CGSize
|
||||
func update(view: View, availableSize: CGSize, state: State, environment: Environment<EnvironmentType>, transition: Transition) -> CGSize
|
||||
}
|
||||
|
||||
public extension Component {
|
||||
@@ -131,7 +131,9 @@ public extension Component {
|
||||
}
|
||||
|
||||
func _update(view: UIView, availableSize: CGSize, environment: Any, transition: Transition) -> CGSize {
|
||||
return self.update(view: view as! Self.View, availableSize: availableSize, environment: environment as! Environment<EnvironmentType>, transition: transition)
|
||||
let view = view as! Self.View
|
||||
|
||||
return self.update(view: view, availableSize: availableSize, state: view.context(component: self).state, environment: environment as! Environment<EnvironmentType>, transition: transition)
|
||||
}
|
||||
|
||||
func _isEqual(to other: _TypeErasedComponent) -> Bool {
|
||||
|
||||
@@ -147,6 +147,12 @@ public struct Transition {
|
||||
return result
|
||||
}
|
||||
|
||||
public func withAnimation(_ animation: Animation) -> Transition {
|
||||
var result = self
|
||||
result.animation = animation
|
||||
return result
|
||||
}
|
||||
|
||||
public static var immediate: Transition = Transition(animation: .none)
|
||||
|
||||
public static func easeInOut(duration: Double) -> Transition {
|
||||
|
||||
Reference in New Issue
Block a user