Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sgl0v/b6479509be0d4765da431db85bc3658d to your computer and use it in GitHub Desktop.
Save sgl0v/b6479509be0d4765da431db85bc3658d to your computer and use it in GitHub Desktop.
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