Skip to content

Instantly share code, notes, and snippets.

@Aymenworks
Created January 18, 2019 05:48
Show Gist options
  • Save Aymenworks/8ec6f8731cec5eeb72b88c14c553b731 to your computer and use it in GitHub Desktop.
Save Aymenworks/8ec6f8731cec5eeb72b88c14c553b731 to your computer and use it in GitHub Desktop.
switch progress {
case AnimationState.full.rawValue...:
let newProgress = (progress - AnimationState.full.rawValue) / (AnimationState.finalBigSize.rawValue - AnimationState.full.rawValue)
let scale = 1 + (maxScale-1) * newProgress
foregroundButton.transform = CGAffineTransform(scaleX: scale, y: scale)
case ...AnimationState.full.rawValue:
foregroundButton.transform = .identity
default:
print("surprise")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment