Skip to content

Commit d47c3da

Browse files
committed
Added animation for QR-code frame update
1 parent 26a3e61 commit d47c3da

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
@@ -37,6 +37,19 @@ class SPQRFrameLayer: CAShapeLayer {
3737
fatalError("init(coder:) has not been implemented")
3838
}
3939

40+
override func action(forKey event: String) -> CAAction? {
41+
if event == "path" {
42+
let animation: CABasicAnimation = .init(keyPath: event)
43+
44+
animation.duration = 0.3
45+
animation.timingFunction = CATransaction.animationTimingFunction()
46+
47+
return animation
48+
}
49+
50+
return super.action(forKey: event)
51+
}
52+
4053
// MARK: - Actions
4154

4255
func detected(with newBezierPath: UIBezierPath) {

0 commit comments

Comments
 (0)