Skip to content

Instantly share code, notes, and snippets.

@agammahajan1
Created December 29, 2019 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agammahajan1/0eca208cfed7df0d44fb7247a85e1e24 to your computer and use it in GitHub Desktop.
Save agammahajan1/0eca208cfed7df0d44fb7247a85e1e24 to your computer and use it in GitHub Desktop.
private func addAnimation(firstImageView: UIImageView, secondImageView: UIImageView) {
CATransaction.begin()
CATransaction.setCompletionBlock {
self.addNextImage(forImageView: firstImageView)
}
let basicAnimation1 = getBasicAnimation(withInitialPostion: centerPosition, finalPos: finalPosition)
firstImageView.layer.add(basicAnimation1, forKey: "position")
CATransaction.commit()
let basicAnimation2 = self.getBasicAnimation(withInitialPostion: self.initalPosition, finalPos: self.centerPosition)
secondImageView.layer.add(basicAnimation2, forKey: "position")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment