Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 811 Bytes

File metadata and controls

39 lines (29 loc) · 811 Bytes

首页动画


Update更新:2016530日 By {MISSAJJ琴瑟静听} 
  • 添加动画代码
/// 开始动画
func startAnimation() {
    let anim = CABasicAnimation(keyPath: "transform.rotation")
    anim.toValue = 2 * M_PI
    anim.repeatCount = MAXFLOAT
    anim.duration = 20.0

    iconView.layer.addAnimation(anim, forKey: nil)
}
  • HomeTableViewController 中增加如下代码,开始和停止动画
func setupVisitorInfo(isHome: Bool, imageName: String, message: String){
        iconView.hidden = !isHome
        messageLabel.text = message
        homeIconView.image = UIImage(named: imageName)

        if isHome{
            startAnimation()
        }
    }

###模拟器动画演示图

image