(swift, storyboards, macOS)
Can I stop or pause an animation?
(I could find how to remove it:
view1.layer?.removeAllAnimations()
Here is the official documentation but I do not understand:
https://developer.apple.com/documentation/uikit/uiviewanimating/1649843-pauseanimation)
@IBAction func fadeOut(_ sender: NSButton) {
NSAnimationContext.runAnimationGroup({ (context) in
context.duration = 5.0
view1.animator().alphaValue = 0
})
}
3
0
2.2k