1.平移出来,停留几秒再原路返回后消失
func playAnimate() { //图标先平移出来,停留5秒 再回去然后消失 UIView.animate(withDuration: 1.5, delay: 0, options: .allowUserInteraction, animations: { self.voteTitleImgview.frame.origin.x = -125 self.voteTitleImgview.frame.size.width = 125 }) { (_) in UIView.animate(withDuration: 1.5, delay: 5, options: .allowUserInteraction, animations: { self.voteTitleImgview.frame.origin.x = 125 self.voteTitleImgview.frame.size.width = 20 }) { (_) in self.voteTitleImgview.removeFromSuperview() } } }