I am creating an image that is then saved to the users camera roll. I would like to add some text to the image. Should I add the string to a UILabel then convert this to an image?
What is your suggestion? Thanks. (I am using Swift)
let bottomImage = UIImage(named: "Image1.png")
let topImage = UIImage(named: "Image2.png")
let anotherImage = UIImage(named: "Image3.png")
let newSize = CGSizeMake(2480, 3508)
UIGraphicsBeginImageContext(newSize)
bottomImage?.drawInRect(CGRectMake(0, 0, newSize.width/2, 500))
topImage?.drawInRect(CGRectMake(newSize.width/2, 0, newSize.width/2, 500), blendMode: kCGBlendModeNormal, alpha: 0.8)
anotherImage?.drawInRect(CGRectMake(newSize.width/2, 500, newSize.width/2, 500), blendMode: kCGBlendModeNormal, alpha: 0.8)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
UIImageWriteToSavedPhotosAlbum(newImage, nil, nil, nil)