I am trying to do something pretty basic here. I am using a block-based UIView animation to bring the subview that is currently off the screen to the current view’s center. Obviously the sp.view.frame = self.view.center line is the issue here. In the end, how do I do what I want?
[UIView animateWithDuration:1 delay:0
options:UIViewAnimationOptionCurveLinear
animations:^{
sp.view.frame = self.view.center;
}
Thanks!
First,
sp.view.framereturns aCGRectwhereasself.view.centerreturns aCGPoint. The two are not the same type and so one cannot be set to the other. ASssuming you wish to set the center ofsp.viewto be the center ofself.view, you can do that in one of two ways:or