swift 简单动画实现思路

2019-06-17  本文已影响0人  优优切克闹

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()             }         }     }     

参考链接:https://www.jianshu.com/p/ec73573e112a

上一篇 下一篇

猜你喜欢

热点阅读