views:

328

answers:

1

Hello,

I'm trying to drag a UIImageView according to an anchorPoint but the whole image move. In fact i have a view for my app settings and one parameter is setted with a dial (with a hand/needle(?)). I'd like the rotation center of the needle/hand doesn't move when i'm dragging it.

Thanks for your future answers.

+1  A: 

You will have to set up a transform rotation on the layer of your needle.

The perfect sample code for you to look at is the Metronome app that Apple provides. This will be very similar to what you want to do.

Kailoa Kadano
Thanks Kailoa, moreover i have this sample code but i didn't thought about it. Sorry i can't vote up for you i've just 11pts reputation at the moment (i'm beginner).Have a nice day, and thx again
Albatrox
Re Kailoa, i've tried and it almost works. If i have just one needle, that's ok but i have two needles, so i've tested withif(CGRectContainsPoint([needle1 frame],[touch locationInView:self]){[self rotate:angle];}but it's not a clean rotate and it doesn't rotate more than ≈ M_PI (almost)
Albatrox