Created
July 30, 2018 19:32
-
-
Save eMdOS/545502d96539edae319dc3be5b2260a5 to your computer and use it in GitHub Desktop.
CGSize Scaling
This file contains 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
extension CGSize { | |
func widthScaling(with value: CGFloat) -> CGSize { | |
return CGSize(width: value, height: (value * height) / width) | |
} | |
func heightScaling(with value: CGFloat) -> CGSize { | |
return CGSize(width: (value * width) / height, height: value) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment