Skip to content

Instantly share code, notes, and snippets.

Created August 30, 2016 02:26
What would you like to do?
Resizing Image using UIKit
extension UIImage {
func resizeUI(size:CGSize) -> UIImage? {
UIGraphicsBeginImageContextWithOptions(size, true, self.scale)
self.drawInRect(CGRect(origin: CGPointZero, size: size))
let resizedImage = UIGraphicsGetImageFromCurrentImageContext()
return resizedImage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment