8

Animating a Bouquet of Flowers

Welcome to the next project. Here, we will create a bouquet of flowers, animate the flower petals so they open and close, and then add a smoke/vapor effect to make it look like the flower is breathing by using the blur modifier.

Behind the flowers, we will place a winter backdrop, and make it snow too by using the CAEmitter class. The CAEmitter class is a UIKit class that was built for animation, but to be able to access it, we will need to use a SwiftUI bridging protocol called UIViewRepresentable. The UIViewRepresentable protocol will let us bridge the two frameworks, UIKit and SwiftUI.

Accompanying this, we will include two labels – Breathe In and Breathe Out – so that you can breathe along with the flowers, ...

Get Animating SwiftUI Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.