2017-01-31 6 views

답변

1
당신의 UIView의 애니메이션 블록을 사용할 수 있습니다

... 스위프트 언어에서

[UIView animateWithDuration:0.3 animations:^{ 

     //Do your stuff here... 

    } completion:^(BOOL isFinished){ 

    }]; 
0

, 당신은 다음과 같이 몇 가지 사소한 사용자 정의하여 사용자 정의 애니메이션을 만들 수 있습니다

let left = CGAffineTransformMakeTranslation(-200, 0) 
let right = CGAffineTransformMakeTranslation(200, 0) 
let top = CGAffineTransformMakeTranslation(0, -200) 

UIView.animateWithDuration(0.4, delay: 0.0, options: [], animations: { 
     // Add the transformation in this block 
     // self.container is your view that you want to animate 
     self.container.transform = top 
}, completion: nil)