Created
March 6, 2019 00:01
-
-
Save stephen-francis/b5b4a63dacafed12256108615ad81306 to your computer and use it in GitHub Desktop.
adjustsImageSizeForAccessibilityContentSizeCategory
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
| extension UIImageView { | |
| static func scaledImageWithName(_ name: String, sizeValue: CGFloat) -> UIImageView { | |
| let widthAndHeight = UIFontMetrics.default.scaledValue(for: sizeValue) | |
| let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: widthAndHeight, height: widthAndHeight)) | |
| imageView.image = UIImage(named: name) | |
| return imageView | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment