iOS UIImageView用代码添加点击事件
image.userInteractionEnabled = YES; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(imagePressed:)]; [image addGestureRecognizer:tap];
Stay hungry,stay foolish.
image.userInteractionEnabled = YES; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(imagePressed:)]; [image addGestureRecognizer:tap];