I want to perform additional tasks whenever the image of a UIImageView is set. I’m attempting to define a custom setter method, but having no luck.
h:
@property (nonatomic, strong, setter = setImage:) UIImage *image;
m:
- (void)setImage:(UIImage *)image {
self.image = image;
// additional tasks here
}
This obviously incurs an infinite loop. How do I do this?
Instead of
do
Also, you don’t need to specify the setter since that is the default.