0

I'm new to iOS and trying to practice falling animation like Yolo app.

What Yolo app has is on sign up page, it has bunch of falling emojis at different velocity seamlessly.

So if I want to implement the falling animation for each emojis and without using storyboard and SwiftUI(so with Appkit), what's the common practice here.

Is there any library I can use?

Si Choi
  • 25
  • 1
  • 3
  • Does this answer your question? [How can I make animation with CAEmitterLayer on SwiftUI?](https://stackoverflow.com/questions/61711020/how-can-i-make-animation-with-caemitterlayer-on-swiftui) – Sandeep Bhandari Feb 22 '21 at 16:02

1 Answers1

0
    let emitterLayer = CAEmitterLayer()
    emitterLayer.emitterPosition = CGPoint(x: 200, y: 200)
    let cell = CAEmitterCell()
    cell.birthRate = 10
    cell.lifetime = 1
    cell.velocity = 100
    cell.scale = 0.1
        
    cell.emissionRange = CGFloat.pi * 2.0
    cell.contents = UIImage(named: "yes")!.cgImage
    emitterLayer.emitterCells = [cell]
        
    view.layer.addSublayer(emitterLayer)
  • While this code may answer the question, providing additional context regarding *how* and/or *why* it solves the problem would improve the answer's long-term value. – Sven Eberth Jun 23 '21 at 22:55