Kyle Macomber's banner
Kyle Macomber's profile picture

Kyle Macomber

@kylemacomber3,942 subscribers

Co-founder & CEO @BitrigApp · Co-creator #SwiftUI at Apple

Shorts

The gold standard fluid interactions on iOS are built using in-process client animations (like SwiftUI does it) and not render-server animations (like CoreAnimation does it). This is common knowledge inside of Apple’s UI framework and system experience teams. A close inspection of iOS’s evolution reveals the gradual upgrading of system experiences written using render-server animations (that often disable user interaction) with ones using client animations (that are interruptible and interactive). The app switcher for iPhone X, the Dynamic Island, and Liquid Glass bars are prime examples of this trend. The other thing that makes these experiences feel so fluid is their use of spring animations that preserve velocity, rather than Bézier curve easing functions. To get velocity preservation, you need to be able to interrupt a spring animation and retarget it or drive it with a gesture. That’s a lot easier to do when the animation is running in the same process as the event handling. When we were first pitching SwiftUI, two of our go-to demos were a recreation of the iOS 9 navigation and Home Screen interactions which were fully interactive and interruptible, at a time when the actual implementations of those experiences in the OS disabled user interaction and ran server-side animations. CoreAnimation is great and the framework does much more than animation. You can build a fine app using its server-side animations. But if your UI framework can’t do efficient main thread client animations, there’s a ceiling to the quality of the experience your app can provide.

The gold standard fluid interactions on iOS are built using in-process client animations (like SwiftUI does it) and not render-server animations (like CoreAnimation does it). This is common knowledge inside of Apple’s UI framework and system experience teams. A close inspection of iOS’s evolution reveals the gradual upgrading of system experiences written using render-server animations (that often disable user interaction) with ones using client animations (that are interruptible and interactive). The app switcher for iPhone X, the Dynamic Island, and Liquid Glass bars are prime examples of this trend. The other thing that makes these experiences feel so fluid is their use of spring animations that preserve velocity, rather than Bézier curve easing functions. To get velocity preservation, you need to be able to interrupt a spring animation and retarget it or drive it with a gesture. That’s a lot easier to do when the animation is running in the same process as the event handling. When we were first pitching SwiftUI, two of our go-to demos were a recreation of the iOS 9 navigation and Home Screen interactions which were fully interactive and interruptible, at a time when the actual implementations of those experiences in the OS disabled user interaction and ran server-side animations. CoreAnimation is great and the framework does much more than animation. You can build a fine app using its server-side animations. But if your UI framework can’t do efficient main thread client animations, there’s a ceiling to the quality of the experience your app can provide.

190,711 просмотров

Videos

Больше нет контента для загрузки