코딩하는 나귀

아래 함수를 원하는 형태로 고처서 사용하세요.

- (void)animation:(UIView *)targetView view:(CGRect)toRect {
    CGContextRef context = UIGraphicsGetCurrentContext();
    [UIView beginAnimations:nil context:context]; //애니메이션 블럭의 시작
    [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; //애니메이션 효과선택
    [UIView setAnimationDuration:0.3f];  //애니메이션 동작(?)시간
    // 이 사이에 원하는 뷰의 이동을 정의 하세요.
    [targetView setFrame:toRect];
    // 여기까지
    [UIView commitAnimations]; // 애니메이션 효과 시작
}

사용예)

[self animation:pickerView view:CGRectMake(0, self.view.frame.size.height, pickerView.frame.size.width, pickerView.frame.size.height)];