我的 MainViewController 中有以下代码。那是最好的地方吗?我还有其他几种具有类似行为的方法。这种类型的代码是否属于一个单独的类,仅用于 UI 转换和操作?
-(void)slideView3P{
[self.view bringSubviewToFront:_view3P];
if (view3PIsMinimized){
view3PIsMinimized = NO;
[UIView beginAnimations:@"animationOff" context:NULL];
[UIView setAnimationDuration:0.5f];
[_view3P setFrame:CGRectMake(_view3P.frame.origin.x, 7, _view3P.frame.size.width, 446)];
[UIView commitAnimations];
}
else {
view3PIsMinimized = YES;
[UIView beginAnimations:@"animationOff" context:NULL];
[UIView setAnimationDuration:0.5f];
[_view3P setFrame:CGRectMake(_view3P.frame.origin.x, 57, _view3P.frame.size.width, 46)];
[UIView commitAnimations];
}
}