Last active
October 5, 2017 11:30
-
-
Save ArchieR7/0ac0d77ee861cfe1e1b51e27765f3f82 to your computer and use it in GitHub Desktop.
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
private func scaleMapImage(_ image: UIImage?, size: CGSize) -> UIImage? { | |
guard let image = image else { | |
return nil | |
} | |
UIGraphicsBeginImageContext(CGSize(width: size.width, height: size.height)) | |
image.draw(in: CGRect(x: 0, y: 0, width: size.width, height: size.height)) | |
let newImage = UIGraphicsGetImageFromCurrentImageContext() | |
UIGraphicsEndImageContext() | |
return newImage | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment