美文网首页
swift 简单动画实现思路

swift 简单动画实现思路

作者: 优优切克闹 | 来源:发表于2019-06-17 10:55 被阅读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

相关文章

网友评论

      本文标题:swift 简单动画实现思路

      本文链接:https://www.haomeiwen.com/subject/cwwofctx.html