Created
June 21, 2020 15:47
-
-
Save sgl0v/b6479509be0d4765da431db85bc3658d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func fadeInPlayerAnimator(with duration: TimeInterval) -> UIViewPropertyAnimator { | |
let animator = UIViewPropertyAnimator(duration: duration, curve: .easeIn) | |
addKeyframeAnimation(to: animator, withRelativeStartTime: 0.0, relativeDuration: 0.5) { | |
self.updatePlayer(with: self.state) | |
} | |
animator.scrubsLinearly = false | |
return animator | |
} | |
private func fadeOutMiniPlayerAnimator(with duration: TimeInterval) -> UIViewPropertyAnimator { | |
let animator = UIViewPropertyAnimator(duration: duration, curve: .easeOut) | |
addKeyframeAnimation(to: animator, withRelativeStartTime: 0.0, relativeDuration: 0.5) { | |
self.updateMiniPlayer(with: self.state) | |
} | |
animator.scrubsLinearly = false | |
return animator | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment