Find out which segment the image resides in objective c
I have created a rotating wheel of 5 images. What I would like to find out is which image ends up in the top right c开发者_运维技巧orner.
Is there any way I can realize which one is in the top right corner through coding?
Thanks :)
If your images are going to end up in specific spots, meaning you know exactly what will be the position of an image when it is in the 'top right corner', you can check the origin (of directly the frame) of that image view.
BOOL bingo = CGRectEqualToRect(imageViewRect, topRightCornerRect);
or
BOOL bingo = CGPointEqualToPoint(imageViewOrigin, topRightCornerRectOrigin);
精彩评论