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 ๐Ÿ‘จ๐Ÿฝโ€๐Ÿซ๐Ÿ‘ฉ๐Ÿปโ€๐Ÿซ

F6daba4a87c95d82b33153c339422a70?s=128

pahill

May 05, 2021
Tweet

Transcript

  1. Comparing Jetpack Compose and SwiftUI: Fun with declarative uis

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

    for Firebase You can ๏ฌnd me at @pjapplez 2
  3. Hello! I am Pamela Hill Android Engineer, Over by GoDaddy

    You can ๏ฌnd me at @pamelaahill 3
  4. 1. Why Declarative?

  5. Declarative UIs Describe what elements you need in your UI

    and to a degree what they should look like 5
  6. 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
  7. Benefits of new Declarative UIs State handling easier Unidirectional data

    ๏ฌ‚ow Compatible with Reactive architectures ๐Ÿค–: RxJava, LiveData, Flow ๐ŸŽ: RxSwift, Combine Compatible with older UI toolkits 7
  8. 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
  9. Benefits of using the same language No interop necessary ๏ฌndViewById

    hell Mix in control structures Easier to read Not different ๏ฌles, struggling to get the bigger picture from them all 9 One place Styling and behaviour
  10. ๐ŸŽ Storyboard demo 10

  11. 2. Clone wars

  12. ๐ŸŽ

  13. ๐Ÿค–

  14. 3. So, what now?

  15. โ€œ When should I start using Jetpack Compose / SwiftUI?

    15
  16. โžœ 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
  17. โ€œ Iโ€™m a newbie to Android / iOS, should I

    still learn the old way of doing things? 17
  18. โ€œ What architectures work best with Jetpack Compose / SwiftUI?

    18
  19. โ€œ Iโ€™ve struggled with theming on Android in the past

    - is Jetpack Compose making it easier? 19
  20. โ€œ Getting accessibility right is hard - will Jetpack Compose

    improve that? 20
  21. Thanks! Any questions? 21