[WIP] Video chats

This commit is contained in:
Isaac
2024-09-06 21:41:16 +08:00
parent 3aceee1696
commit ccedf9fc06
9 changed files with 1533 additions and 147 deletions

View File

@@ -471,7 +471,12 @@ public struct ComponentTransition {
layer.removeAnimation(forKey: "opacity")
completion?(true)
case .curve:
let previousAlpha = layer.presentation()?.opacity ?? layer.opacity
let previousAlpha: Float
if layer.animation(forKey: "opacity") != nil {
previousAlpha = layer.presentation()?.opacity ?? layer.opacity
} else {
previousAlpha = layer.opacity
}
layer.opacity = Float(alpha)
self.animateAlpha(layer: layer, from: CGFloat(previousAlpha), to: alpha, delay: delay, completion: completion)
}