同时:
UIView.animate(withDuration: 0.5, delay: 0.3, options: [], animations: {
self.username.center.x += self.view.bounds.width;
}, completion: nil)
UIView.animate(withDuration: 0.5, delay: 0.3, options: [], animations: {
self.password.center.x += self.view.bounds.width;
}, completion: nil)
Repeat
UIView.animate(withDuration: 0.5, delay: 0.3, options: [.repeat], animations: {
self.username.center.x += self.view.bounds.width;
}, completion: nil)
AutoReverse
UIView.animate(withDuration: 0.5, delay: 0.3, options: [.autoreverse], animations: {
self.username.center.x += self.view.bounds.width;
}, completion: nil)
Include this option only in conjunction with .repeat
Repeat & AutoReverse
UIView.animate(withDuration: 0.5, delay: 0.3, options: [.repeat, .autoreverse], animations: {
self.username.center.x += self.view.bounds.width;
}, completion: nil)