Small caption adjustment

This commit is contained in:
Ali
2023-07-11 23:41:07 +04:00
parent 441978fbad
commit 8ce559ec67
7 changed files with 75 additions and 24 deletions

View File

@@ -1064,4 +1064,18 @@ public struct Transition {
)
}
}
public func animateContentsImage(layer: CALayer, from fromImage: CGImage, to toImage: CGImage, duration: Double, curve: Transition.Animation.Curve, completion: ((Bool) -> Void)? = nil) {
layer.animate(
from: fromImage,
to: toImage,
keyPath: "contents",
duration: duration,
delay: 0.0,
curve: .easeInOut,
removeOnCompletion: true,
additive: false,
completion: completion
)
}
}