The below sample code provides an extension for UIImage, to resizing it's image with the targeted size.