Created
November 19, 2019 10:12
-
-
Save michaelevensen/846803f2fd4873c2b601a223dcf288e9 to your computer and use it in GitHub Desktop.
MinMax Example
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
// min(max()) example for scrolling | |
let minValue: CGFloat = 0 | |
let maxValue: CGFloat = 1 | |
let dynamicValue = (trackCell.trackImageView.frame.size.height - locationY) / trackCell.trackImageView.frame.size.height | |
let delta = min(maxValue, max(minValue, dynamicValue) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment