iOS: UIImageView - How to get the file name of the image assigned?

Is it possible to read the name of an UIImageView's UIImage that's presently stored in the UIImageView?

No, You can't do that, but you can use this tips:

You can use setAccessibilityIdentifier method for any subclass of UIView:


UIImageView *image ;
[image setAccessibilityIdentifier:@"file name"] ;

NSString *file_name = [image accessibilityIdentifier] ;
Also, you can compare in the same View Controller:


if ([imageForCheckMark.image isEqual:[UIImage imageNamed:@"crossCheckMark.png"]]||[imageForCheckMark.image isEqual:[UIImage imageNamed:@"checkMark.png"]])
{

}


iOS: UIImageView - How to get the file name of the image assigned? iOS: UIImageView - How to get the file name of the image assigned? Reviewed by Ricardo Castellanos on 9:49 Rating: 5

No hay comentarios:

Con la tecnología de Blogger.