Rather than just move a UIView, I want to have it slide from the first spot to the second. I see the property center for moving views... and I see a bunch of different functions related to animating the views... but I can't understand the lingo...
Edit: Oh... and I guess I need help with CGPoints too...
I just found out my code for moving the center doesn't work anyways.
marker is a UIImageView (subclass of UIView which has the property center)... it expects me to give it a CGPoint. I tried adding a cast but that didn't do anything.
Oh and hey! Somehow I overlooked that line... it confirms my suspicion that beginAnimation: context is how I get it to slide from one point to another. Unfortunately I still have no idea what I'm supposed to give it (what's an animationID?)
2X Edit: Uhhh... wait... I'll just read this document to figure out how to get it to animate right:
http://developer.apple.com/document...nimations.html#//apple_ref/doc/uid/TP40003581
I still need help with the CGPoint thing though...
3X Edit:
OK, I've got this now:
It seems a bit overly complicated... it really seems like this should all be able to be summed up in one line of code like I had... but at least it works.
I still don't understand how to have it slide though (even after having read that document...)
but I found this which appears to be exactly what I want:
http://developer.apple.com/document...l/CoreAnimation_guide/Articles/Headstart.html
What's an "animation block"?Begins an animation block.
Edit: Oh... and I guess I need help with CGPoints too...
I just found out my code for moving the center doesn't work anyways.
Code:
marker.center = (CGPoint *) (160, 62);
error: incompatible type for argument 1 of 'setCenter:'
marker is a UIImageView (subclass of UIView which has the property center)... it expects me to give it a CGPoint. I tried adding a cast but that didn't do anything.
Oh and hey! Somehow I overlooked that line... it confirms my suspicion that beginAnimation: context is how I get it to slide from one point to another. Unfortunately I still have no idea what I'm supposed to give it (what's an animationID?)
2X Edit: Uhhh... wait... I'll just read this document to figure out how to get it to animate right:
http://developer.apple.com/document...nimations.html#//apple_ref/doc/uid/TP40003581
I still need help with the CGPoint thing though...
3X Edit:
OK, I've got this now:
Code:
CGPoint p;
p.x = 160;
p.y = 62;
marker.center = p;
It seems a bit overly complicated... it really seems like this should all be able to be summed up in one line of code like I had... but at least it works.
I still don't understand how to have it slide though (even after having read that document...)
but I found this which appears to be exactly what I want:
http://developer.apple.com/document...l/CoreAnimation_guide/Articles/Headstart.html