Skip to content

Commit eb4d180

Browse files
committed
Added animation for QR-code frame update
1 parent 863b551 commit eb4d180

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Sources/SPQRCode/Interface/SPQRFrameLayer.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ class SPQRFrameLayer: CAShapeLayer {
4949
fatalError("init(coder:) has not been implemented")
5050
}
5151

52+
override func action(forKey event: String) -> CAAction? {
53+
if event == "path" {
54+
let animation: CABasicAnimation = .init(keyPath: event)
55+
56+
animation.duration = 0.3
57+
animation.timingFunction = CATransaction.animationTimingFunction()
58+
59+
return animation
60+
}
61+
62+
return super.action(forKey: event)
63+
}
64+
5265
// MARK: - Actions
5366

5467
func update(using points: [CGPoint]) {

0 commit comments

Comments
 (0)