Giter Site home page Giter Site logo

-infiteeanimation's Introduction

InfiteeAnimation,优秀的入门iOS动画Demo

之前无意在App Store看到了一个叫Infintee的app,瞬间被其华丽流畅的交互动画吸引了。所以花了一点时间尝试实现里面的动画效果。 实现过程发现里面的动画还是挺复杂的,所以自己目前还不能100%实现里面的所有动画 希望各路大神有兴趣的可以交流一下。

系统需求

  • iOS 9.0 +
  • Xcode 9.0 +
  • Swift 5

涉及技术要点

  • CAAnimation

项目主要使用CAAnimation库构建动画,包括其各种子类,CASpringAnimation,CAAnimationGroup,CAKeyframeAnimation。

  • 自定义转场动画

自定义Navigation转场动画

  • tableviewCell动画

自定义tableviewCell动画

展示

image

部分代码展示


let positAnimation = CABasicAnimation()
positAnimation.keyPath = "position"
positAnimation.fromValue = closeButton.center
let centerX = self.frame.size.width - 25
let toPoint = CGPoint(x: centerX, y: closeButton.center.y)
positAnimation.toValue = toPoint

positAnimation.fillMode = .forwards
positAnimation.isRemovedOnCompletion = false

let rotationAnimation = CABasicAnimation()
rotationAnimation.keyPath = "transform.rotation.z"
rotationAnimation.fromValue = 0
rotationAnimation.toValue = Double.pi
rotationAnimation.fillMode = .forwards
rotationAnimation.isRemovedOnCompletion = false

let groupAnimation = CAAnimationGroup()
groupAnimation.animations = [positAnimation, rotationAnimation]
groupAnimation.delegate = self
groupAnimation.duration = 0.4
groupAnimation.fillMode = .forwards
groupAnimation.isRemovedOnCompletion = false
groupAnimation.setValue(toPoint, forKey: "posit")
closeButton.layer.add(groupAnimation, forKey: nil)

运行

git clone项目之后直接点击InfiteeAnimation.xcworkspace运行

后续更新

  • 完善Infintee其他动画效果
  • 优化动画流畅性

-infiteeanimation's People

Contributors

etherealyi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.