We may be using image sets where few images are pretty big or small in size(say big 500X500 for instance). And if you want to resize the image to your desired size then it’s easiest by creating an extension of UIImage that will draw the image in the required/provided size.
Here are the steps to accomplish:
1- Create a bitmap-based graphics context
UIGraphicsBeginImageContext( newSize )
this will create the current context of bitmap based graphics.
2- Draw the complete image in the rectangle, using required size.