[WIP] Call UI

This commit is contained in:
Isaac
2023-12-01 22:50:48 +04:00
parent d2ffa8e19e
commit 7a12540f66
11 changed files with 411 additions and 74 deletions

View File

@@ -481,8 +481,14 @@ public struct Transition {
}
public func setScale(layer: CALayer, scale: CGFloat, delay: Double = 0.0, completion: ((Bool) -> Void)? = nil) {
let t = layer.presentation()?.transform ?? layer.transform
let currentScale = sqrt((t.m11 * t.m11) + (t.m12 * t.m12) + (t.m13 * t.m13))
let currentTransform: CATransform3D
if layer.animation(forKey: "transform") != nil || layer.animation(forKey: "transform.scale") != nil {
currentTransform = layer.presentation()?.transform ?? layer.transform
} else {
currentTransform = layer.transform
}
let currentScale = sqrt((currentTransform.m11 * currentTransform.m11) + (currentTransform.m12 * currentTransform.m12) + (currentTransform.m13 * currentTransform.m13))
if currentScale == scale {
if let animation = layer.animation(forKey: "transform.scale") as? CABasicAnimation, let toValue = animation.toValue as? NSNumber {
if toValue.doubleValue == scale {