Combine label text with image

I have an image with a tag that comes over it, but when I save the photo to an album, of course, the shortcut does not appear. How would I do this, I have a lot of searches, and nothing works.

+2
source share
1 answer

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

If you combine your label and image into a single UIView object (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 will be what you save in the album.

+5
source

Source: https://habr.com/ru/post/895525/


All Articles