Created
January 18, 2019 05:23
-
-
Save Aymenworks/f75f5deb3832fb4e2fb2532a8e0ab7a2 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
func update(progress: CGFloat) { | |
let shiftedProgress = (progress - AnimationState.start.rawValue) / (AnimationState.full.rawValue - AnimationState.start.rawValue) | |
let height: CGFloat = foregroundButton.bounds.height * shiftedProgress | |
let rect = CGRect(x: 0, y: foregroundButton.bounds.height - height, width: foregroundButton.bounds.width, height: height) | |
let path = UIBezierPath(rect: rect).cgPath | |
shapeLayer.path = path | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment