Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Animating SwiftUI Applications

You're reading from   Animating SwiftUI Applications Create visually stunning and engaging animations for iOS with SwiftUI

Arrow left icon
Product type Paperback
Published in Mar 2023
Publisher Packt
ISBN-13 9781803232669
Length 478 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Stephen DeStefano  Stephen DeStefano 
Author Profile Icon Stephen DeStefano 
Stephen DeStefano 
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Chapter 1: Exploring the Fundamentals of SwiftUI 2. Chapter 2: Understanding Animation with SwiftUI FREE CHAPTER 3. Chapter 3: Creating a Breathing App 4. Chapter 4: Building a Record Player 5. Chapter 5: Animating Colorful Kaleidoscope Effects 6. Chapter 6: Animating a Girl on a Swing 7. Chapter 7: Building a Series of Belts and Gears 8. Chapter 8: Animating a Bouquet of Flowers 9. Chapter 9: Animating Strokes around Shapes 10. Chapter 10: Creating an Ocean Scene 11. Chapter 11: Animating an Elevator 12. Chapter 12: Creating a Word Game (Part 1) 13. Chapter 13: Creating a Word Game (Part 2) 14. Chapter 14: Creating a Color Game 15. Chapter 15: Integrating SpriteKit into Your SwiftUI Projects 16. Index 17. Other Books You May Enjoy

What this book covers

In Chapter 1, Exploring the Fundamentals of SwiftUI, you will receive a comprehensive overview of the two distinct programming styles: imperative and declarative. Then, we will delve into the Xcode interface, the free application provided by Apple, where all our development work will take place. Finally, we will examine the fundamental SwiftUI structures required for creating applications, laying the groundwork for advancing with animations.

In Chapter 2, Understanding Animation in SwiftUI, we will examine the mechanics of animations, covering essential topics such as timing curves and animatable properties. This will establish a solid foundation for the projects we will construct.

In Chapter 3, Creating a Breathing App, we will harness the power of SwiftUI’s user-friendly modifiers and design tools to effortlessly rotate, scale, and move views. Moreover, we will utilize the animation modifier to smoothly interpolate between start and end values, producing a seamless animation.

In Chapter 4, Building a Record Player, we will incorporate images from the Asset Catalog into our code. Then, we will create standalone files for creating various views that can be seamlessly integrated into the main view for display. Furthermore, we will add a button to trigger the animation and incorporate sound into the project.

In Chapter 5, Animating Colorful Kaleidoscope Effects, we will explore the animation of colors using the hueRotation modifier, where hue pertains to the colors of the object and rotation signifies the rotation or animation of these colors. We will construct a straightforward project that showcases various images, and then utilize hueRotation to alter the color of the images, producing a kaleidoscope-like effect.

In Chapter 6, Animating a Girl on a Swing, we will investigate the process of cutting up images into separate parts, and then using code to animate these separate parts together in creative and unique ways. Additionally, we will utilize a new modifier, mask, to help disguise and hide specific areas of our animation that we don’t want to see.

In Chapter 7, Building a Series of Belts and Gears, we will generate a “marching ants” effect by employing the stroke modifier, and then examine how to neatly organize code using Pragma Marks and Groups. We will also animate objects along all three axes, x, y, and z, by utilizing the rotation3Deffect modifier.

In Chapter 8, Animating a Flower, we will construct the illusion of a bouquet of flowers breathing through the use of modifiers such as blur, scale, and rotationEffect. Additionally, we will examine the UIViewRepresentable protocol and the CAEmitter class to incorporate falling snow into the scene.

In Chapter 9, Animating Strokes around Shapes, we will delve into the process of converting bitmap images into vector files, and then transform these vector files into code that we can utilize in a SwiftUI project. Furthermore, we will animate a stroke around various shapes through the use of the stroke modifier and timers.

In Chapter 10, Creating an Ocean Scene, we will utilize the Shape protocol to craft an oceanic scene featuring undulating waves, a buoy that bobs in the water, a flashing light, and accompanying sounds.

In Chapter 11, Animating an Elevator, we will employ GeometryReader and the proxy constant to insert images into the project and position them appropriately. This will enable the images to be dynamically resized based on the device in use. Furthermore, we will create a DataModel to store the app’s data and functions and make use of timers to activate doors and light animations at various points in the scene.

In Chapter 12, Creating a Word Game – Part 1, we will commence with the construction of a word-based game that allows players to input words to play using three different languages, with validations in place to verify their choices.

In Chapter 13, Creating a Word Game – Part 2, we will add the finishing touches to our word game by organizing its properties and functions within DataModel and creating distinct header and footer views to display information to the user. Additionally, we will incorporate user feedback in three different forms: pop-up alerts, haptic feedback, and audio.

In Chapter 14, Creating a Color Game, we will develop an RGB color-matching game that keeps track of the score and displays a celebratory confetti animation upon the player achieving a perfect score. We will also examine the integration of Swift packages into the project.

In Chapter 15, Integrating SpriteKit into your SwiftUI Projects, we will create six separate projects that showcase SpriteKit and a variety of particle systems. We will learn how to blend realistic and fluid animations seamlessly with your SwiftUI code.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image