Airbnb Anne Lu May 7, 2024

Animations: Bringing the Host Passport to Life on iOS

Article Summary

Anne Lu from Airbnb reveals how her team built a 3D page-flipping animation that looks effortless but required solving novel iOS challenges. The Host Passport feature needed pixel-perfect timing across multiple synchronized animations.

Airbnb's iOS team created the Host Passport, a delightful 3D book animation that introduces hosts to guests in Private Room listings. Released in May 2023, this feature required bridging UIKit's animation framework with custom 3D transforms, all while maintaining 60fps performance and seamless integration with their declarative transition system.

Key Takeaways

Critical Insight

Airbnb achieved a fluid 3D book animation on iOS by combining UIKit's animation framework with clever view composition tricks and precisely timed keyframes, despite SwiftUI lacking the necessary APIs.

The article reveals the specific anchor point dilemma that almost derailed the entire animation and the elegant workaround that saved it.

About This Article

Problem

Anne Lu's team had to coordinate multiple animations at once. Growth, X/Y translation, 3D page rotation, and shadow movement each needed separate timing curves and keyframe-specific start and stop points, all within a 2.0-second window.

Solution

Airbnb used UIView.animateKeyframes with relative start times and durations to control exactly when each property animated within the overall timeline. They combined this with UIViewPropertyAnimator to handle dynamic playback control.

Impact

The team got pixel-perfect synchronization between the 3D passport animation and the modal transition. The spring timing was tuned so the X and Y coordinates lined up perfectly at the transition cutoff, even though the spring curve theoretically extended beyond the animation duration.