Ali Zahedi
Ali Zahedi

Reputation: 41

Combine Label Text With Image

I have an image with a label that comes over it, but when I save photo to album, of course the label doesn't show up. How would I do this, I have search a lot, and nothing works.

Upvotes: 2

Views: 1505

Answers (1)

Michael Dautermann
Michael Dautermann

Reputation: 89509

I did a bit of research in other questions to come up with an answer for you (click here for the best and most detailed answer), but the short answer for you would be this:

If you do combine your label and image into one UIView object (let's call it myView), you can do something like this: something like this:

UIGraphicsBeginImageContext(myView.bounds.size);
[myView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

And the viewImage UIImage object would be what you save to the album.

Upvotes: 5

Related Questions