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

Comparing Jetpack Compose and SwiftUI: Fun with Declarative UIs

Comparing Jetpack Compose and SwiftUI: Fun with Declarative UIs

Declarative UIs are a hot 🔥 topic right now, whether you're in #team-android 🤖 with Jetpack Compose or #team-apple 🍎 with SwiftUI.

Join Peter-John and Pamela to learn:
- What declarative UIs are 🤔
- The basics of creating a Netflix clone with Compose and SwiftUI in an epic live-coding battle of the toolkits 📚
- When to adopt ⏳
- Best practices for successful toolkit adoption 👨🏽‍🏫👩🏻‍🏫

pahill

May 05, 2021
Tweet

More Decks by pahill

Other Decks in Programming

Transcript

  1. Hello! I am Peter-John Welcome Android Engineer, Paystack & GDE

    for Firebase You can find me at @pjapplez 2
  2. Declarative UIs Describe what elements you need in your UI

    and to a degree what they should look like 5
  3. Declarative Describe what the UI should look like 🤖: -

    Jetpack Compose Comparing with Imperative Style Imperative Code out the steps to create the UI 🤖: - Creating views - Adding views to container views 6
  4. Benefits of new Declarative UIs State handling easier Unidirectional data

    flow Compatible with Reactive architectures 🤖: RxJava, LiveData, Flow 🍎: RxSwift, Combine Compatible with older UI toolkits 7
  5. Downsides of new Declarative UIs Mindshift necessary Even more to

    learn Thinking, planning ahead How to handle state changes from the start 8 Immature UI toolkits Not full functionality like the existing toolkits Incompatible with older platform languages Java, Objective-C Sometimes more code for more control
  6. Benefits of using the same language No interop necessary findViewById

    hell Mix in control structures Easier to read Not different files, struggling to get the bigger picture from them all 9 One place Styling and behaviour
  7. ➜ You need to decide for yourself when stable is

    stable enough ➜ Required platforms 🤖: API 21+ 🍎: iOS 13+ ➜ Dealing with bugs in new UI toolkits ➜ Migration strategies 16
  8. “ I’m a newbie to Android / iOS, should I

    still learn the old way of doing things? 17
  9. “ I’ve struggled with theming on Android in the past

    - is Jetpack Compose making it easier? 19