Draw an image on top of UIImage

 1func drawImageOnImage(image:UIImage, onBgImage bgImage:UIImage, atPoint point:CGPoint) -> UIImage {
 2  UIGraphicsBeginImageContextWithOptions(bgImage.size, false, 0.0)
 3  bgImage.drawInRect(CGRectMake(0, 0, bgImage.size.width, bgImage.size.height))
 4  image.drawInRect(CGRectMake(point.x, point.y, image.size.width, image.size.height))
 5
 6  var newImage:UIImage = UIGraphicsGetImageFromCurrentImageContext()
 7  UIGraphicsEndImageContext()
 8
 9  return newImage
10}
overlaied image when clicked on thumbnail

Makzan | Ios dev scrapbook | Table of Content