Say I'm creating an animation, and I want to move the center of a UIView to a certain CGPoint
I have. I know what I want the center to be, just the aforementioned CGPoint
, and I know the width and height that I want, but when I go to create the frame for my UIView
I have no idea what to set for the x
and y
for the origin
.
Should I just be setting 0, 0
or anything really? Does it matter?
Should I just be thinking as setting center
as a different method of setting the origin? Makes me wish CGRect had an instantiator with center
as an option.
There has been a previous question addressing a somewhat similar question, but it addresses them as three separate entities, rather than how to deal with center when creating the view.