2015-02-04 3 views
0

저는 앱으로 시작하는 애니메이션을 가지고 있습니다. 이 애니메이션이 끝나면 다른 함수를 호출해야하지만이를 수행하는 프로세스를 찾지 못했습니다.애니메이션이 Swift에서 완료 될 때 함수 호출

func bettyAnimation(){ 

var betty: UIImageView = UIImageView() 

var bettyImageList: [UIImage] = [] 

for i in 1...77{ 
    let imageName = "pantalla_02_betty_\(i).png" 
    bettyImageList += [UIImage(named: imageName)!] 
} 

self.view.addSubview(betty) 
betty.animationRepeatCount=1 
betty.animationImages = bettyImageList 
betty.animationDuration = 6.0 

betty.startAnimating() 

} 당신은 completion 블록 내부의 코드를 삽입 할 필요가

+0

시도한 내용을 보여줄 수 있습니까? – rakeshbs

답변

2

:

이 내 애니메이션 코드입니다.

UIView.animateWithDuration(
    // duration 
    1.0, 
    // delay 
    delay: 0.0, 
    options: nil, 
    animations: { 

    // put animation code here 

    }, completion: {finished in 

    // the code you put here will be executed when your animation finishes, therefore 
    // call your function here 
    } 
) 
관련 문제