I am using an UIImage, in which I have an Image, and I want to know the name of image.
That functionality is not built-in to UIImage
because images are not always loaded from files. However, you could create a custom UIImageView
subclass to fit your needs.
It is not possible. UIImage instance contains the actual image data without any reference to the filename.
Images do not necessarily come from files or other named sources, so not all images even have a name. When you create an image from a file, you could store the name in a separate NSString*
, and then refer to that stored name when necessary.
this code will help you out
NSString *imgName = [self.imgView1st image].accessibilityIdentifier;
NSLog(@"%@",imgName);
[self.imgView2nd setImage:[UIImage imageNamed:imgName]];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With