Я новичок в Swift, и это мой первый вопрос... Я хотел бы уменьшить шар продолжительностью 2 секунды, а затем увеличить его в течение 5 секунд. Моя проблема в том, что вторая продолжительность игнорируется (мяч сжимается в течение 2 секунд и растет в течение 2 секунд). Я надеюсь, что кто-то может помочь мне.
Это моя попытка:
let ball = UIView()
ball.frame = CGRectMake(50, 50, 50, 50)
ball.backgroundColor = UIColor.blueColor()
ball.layer.cornerRadius=25
relaxContainer.addSubview(ball)
UIView.animateWithDuration(2.0, delay:0, options: [.Repeat, .Autoreverse], animations: {
ball.frame = CGRectMake(50, 50, 20, 20)
}, completion: { finished in
UIView.animateWithDuration(5.0, animations: {
ball.frame = CGRectMake(50, 50, 50, 50)
})
})