I want to create a dial and i want to get the tag of images when clicked the images in the dial.i tried a lot , but i didn't get it.see the code below
- (void) drawWheel {
container = [[UIView alloc] initWithFrame:self.frame];
CGFloat angleSize = 2*M_PI/numberOfSections;
for (int i = 0; i < numberOfSections; i++) {
UIImageView *im = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"segment.png"]];
im.layer.anchorPoint = CGPointMake(1.0f, 0.5f);
im.layer.position = CGPointMake(container.bounds.size.width/2.0-container.frame.origin.x,
container.bounds.size.height/2.0-container.frame.origin.y);
im.transform = CGAffineTransformMakeRotation(angleSize*i);
im.alpha = minAlphavalue;
im.tag = i;
if (i == 0) {
im.alpha = maxAlphavalue;
}
cloveImage = [[UIImageView alloc] initWithFrame:CGRectMake(12, 15, 40, 40)];
cloveImage.image = [UIImage imageNamed:[NSString stringWithFormat:@"icon%i.png", i]];
cloveImage.tag=i;
[im addSubview:cloveImage];
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
//i want to get cloveImage.tag when i clicked the imageview
}
So my question is how can I detect tag of image in the rotatory wheels when i touched the
particular image?