How does messages implement rubbery momentum physics-based scrolling behavior of speech bubbles?
Generated on 7/31/2024
1 search
Messages implements rubbery momentum physics-based scrolling behavior of speech bubbles using continuous velocity in animations. This is achieved through the use of interactive spring animations that preserve the velocity at the end of a gesture.
When a gesture, such as a pan, is performed, the gesture continuously fires change events as the finger moves. Each of these events creates a new interactive spring animation, which retargets the last one. When the gesture ends, a final non-interactive spring animation is created. This final spring uses the velocity from the interactive springs to carry the animation forward with continuous velocity, creating a smooth and natural scrolling effect.
For more details, you can refer to the session Enhance your UI animations and transitions at the chapter "Gesture-driven animations".
Enhance your UI animations and transitions
Explore how to adopt the zoom transition in navigation and presentations to increase the sense of continuity in your app, and learn how to animate UIKit views with SwiftUI animations to make it easier to build animations that feel continuous.
Create custom visual effects with SwiftUI
Discover how to create stunning visual effects in SwiftUI. Learn to build unique scroll effects, rich color treatments, and custom transitions. We’ll also explore advanced graphic effects using Metal shaders and custom text rendering.
Discover RealityKit APIs for iOS, macOS and visionOS
Learn how new cross-platform APIs in RealityKit can help you build immersive apps for iOS, macOS, and visionOS. Check out the new hover effects, lights and shadows, and portal crossing features, and view them in action through real examples.
What’s new in SwiftUI
Learn how you can use SwiftUI to build great apps for any Apple platform. Explore a fresh new look and feel for tabs and documents on iPadOS. Improve your window management with new windowing APIs, and gain more control over immersive spaces and volumes in your visionOS apps. We’ll also take you through other exciting refinements that help you make expressive charts, customize and layout text, and so much more.