Upgrade to Pro — share decks privately, control downloads, hide ads and more …

"Building component-driven UIs at Spotify" from John Sundell

"Building component-driven UIs at Spotify" from John Sundell

Spotify is changing the way its building its mobile apps for iOS & Android. To be able to move faster than ever before; the company is now building most of its UIs in a component-driven, declarative way - most of which also have their layout driven from the backend. In this talk, John will give you a deep-dive into Spotify's new UI architecture, how it gives their app a lot more flexibility, makes testing & personalization easier, and how this kind of architecture can be applied on other apps - of any size.

uaMobiTech

July 28, 2016
Tweet

More Decks by uaMobiTech

Other Decks in Programming

Transcript

  1. Optimizing for experimentation UI should be easy to change Code

    needs to be dynamic Building new UIs should be fast Want to launch & learn as quick as possible
  2. Card Backend Feature Create View Controller Setup container view Register

    card Load data Handle offline Backend request Parse response Handle errors or timeouts Caching Bind data to cards Handle highlights & selection Integrate View Controller with the rest of the app Wait for the next binary release
  3. Most of the time, we write code to render a

    state and to handle events from state changes
  4. View Model Playlists Links Genres State Albums Artists Shared data

    model Component Model Component Model Component Model Component Model Component Model Component Model Render Components
  5. protocol Component { var view: UIView? { get } func

    loadView() } func configureWithModel(model: ComponentModel) UICollectionView var preferredViewSize: CGSize { get } var layoutTraits: [LayoutTrait] { get } UICollectionViewLayout
  6. Component-driven UI Components have built-in reusability UI as a function

    of state State can be loaded from backend We can now quickly iterate on UI