iOS UIbutton overlay

-(void) viewDidAppear:(BOOL)animated    {
   
    //*** Example***

    //UIButton *pauseImg;
    //pauseImg =[self drawImage:pauseIcon inImage:pauseImg];
      

}

-(UIImage*) drawImage:(UIImage*) fgImage
              inImage:(UIImage*) bgImage
{
    UIGraphicsBeginImageContextWithOptions(bgImage.size, FALSE, 0.0);
    [bgImage drawInRect:CGRectMake( 0, 0, bgImage.size.width, bgImage.size.height)];
    [fgImage drawInRect:CGRectMake( 0, 0, fgImage.size.width, fgImage.size.height)];
    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return newImage;
}