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

SwiftUI in LINE LIVE iOS - Technology Selection...

SwiftUI in LINE LIVE iOS - Technology Selection and Implementation

Wei Wang (onevcat) (LINE / LIVE Client Development Team / Senior Engineer)

https://tech-verse.me/ja/sessions/19
https://tech-verse.me/en/sessions/19
https://tech-verse.me/ko/sessions/19

Tech-Verse2022

November 18, 2022
Tweet

More Decks by Tech-Verse2022

Other Decks in Technology

Transcript

  1. Agenda - Why a new UI framework - Why SwiftUI

    - How to migrate - How does it feel
  2. LINE LIVE - a medium scale native iOS app ~200k

    lines of Swift UIKit MVC From 2015 Why a new UI framework
  3. Massive View Controller LINE LIVE - potential tech risk ~200k

    lines of Swift UIKit From 2015 Why a new UI framework
  4. LINE LIVE - potential tech risk ~200k lines of Swift

    UIKit Massive View Controller From 2015 Why a new UI framework
  5. Complexity and Mental Burden UIKit and MVC are too flexible

    ਺஋࣠ .VUBCJMJUZ $PEF$PNQMFYJUZ )VNBO$POUSPM
  6. Mental Burden and Bugs Complexity and Mental Burden UIKit and

    MVC are too flexible ਺஋࣠ .VUBCJMJUZ $PEF$PNQMFYJUZ )VNBO$POUSPM
  7. Mental Burden and Bugs Complexity and Mental Burden UIKit and

    MVC are too flexible ਺஋࣠ .VUBCJMJUZ $PEF$PNQMFYJUZ )VNBO$POUSPM
  8. Mental Burden and Bugs Complexity and Mental Burden UIKit and

    MVC are too flexible ਺஋࣠ .VUBCJMJUZ $PEF$PNQMFYJUZ )VNBO$POUSPM
  9. Complexity and Mental Burden UIKit and MVC are too flexible

    ਺ᆴᇠ .VUBCJMJUZ $PEF$PNQMFYJUZ )VNBO$POUSPM - Reduce code complexity - Reduce mutability
  10. Complexity and Mental Burden UIKit and MVC are too flexible

    ਺ᆴᇠ .VUBCJMJUZ $PEF$PNQMFYJUZ )VNBO$POUSPM - Reduce code complexity - Reduce mutability - Declarative
  11. Complexity and Mental Burden UIKit and MVC are too flexible

    ਺ᆴᇠ .VUBCJMJUZ $PEF$PNQMFYJUZ )VNBO$POUSPM - Reduce code complexity - Reduce mutability - Declarative - Functional
  12. SwiftUI vs. UIKit SwiftUI is getting more resources Popular WWDC

    21/22 Lounge Fast Bug Reporting Feedback Clear Swift Syntax
  13. Do not affect existing components or development schedule Evaluate the

    cost compared to UIKit to guide future work Help all team members to become familiar with SwiftUI Migration Goals
  14. - Only used in internal debug builds - Used only

    by developers and the QA team First Step - Debug Panel
  15. - Only used in internal debug builds - Used only

    by developers and the QA team - Understand the basics of SwiftUI First Step - Debug Panel
  16. - Only used in internal debug builds - Used only

    by developers and the QA team - Understand the basics of SwiftUI - Verify layout, styles, and concepts quickly First Step - Debug Panel
  17. - In-app logger - Record/display logs such as API requests

    - Filtering, log sending, live logging More complicated scene
  18. - In-app logger - Record/display logs such as API requests

    - Filtering, log sending, live logging - Verify navigating, data sharing, and basic architecture More complicated scene
  19. - A standalone app to inspect downloadable resources - A

    side-project with the concurrency refactoring in the LINE LIVE app A Step Further - Tool app
  20. - A standalone app to inspect downloadable resources - A

    side-project with the concurrency refactoring in the LINE LIVE app - Verify networking, performance, data model, and complex architecture A Step Further - Tool app
  21. - Some simple scenes were rewritten in SwiftUI - Easy

    enough to quick rollback if necessary Limited use in Production
  22. - Some simple scenes were rewritten in SwiftUI - Easy

    enough to quick rollback if necessary - Verify actual behavior in production build Limited use in Production
  23. - Complicated layout and styles - Self-contained module - Seamlessly

    integrated with other UIKit components Build new features
  24. - Complicated layout and styles - Self-contained module - Seamlessly

    integrated with other UIKit components - Start to build with pure SwiftUI Build new features
  25. - Complicated layout and styles - Self-contained module - Seamlessly

    integrated with other UIKit components - Start to build with pure SwiftUI Build new features We will talk more about it soon….
  26. Migration Path Solve problems in early stage.   

           ࢛݄ ޒ݄ ࿡݄ ࣣ݄ ະ໋໊ Debug Panel Debug Logger Inspector App Simple Scene Complex Scene From very simple to moderately complex
  27. Solve these Problems A better pure functional, redux-like architecture Complex

    State Management - Single statement management mechanism - Clear, understandable, and no surprises
  28. Dependency Injection Pure Child View Parent View Pure Child View

    Child View deliver data API client, user credentials, etc
  29. Solve these Problems A better pure functional, redux-like architecture -

    Keep smaller components independent and composable - Stable, scalable, and compiler-friendly Difficult to Perform Dependency Injection Complex State Management - Single statement management mechanism - Clear, understandable, and no surprises
  30. The Composable Architecture (TCA) Building applications in a consistent and

    understandable way, with composition, testing, and ergonomics in mind https://github.com/pointfreeco/swift-composable-architecture
  31. The Composable Architecture - Store wraps a State and drives

    the View - The view sends actions - Action derives the next state and execute side-effect
  32. Solve these Problems A better pure functional, redux-like architecture -

    Keep smaller components independent and composable - Stable, scalable, and compiler-friendly Difficult to Perform Dependency Injection Complex State Management - Single statement management mechanism - Clear, understandable, and no surprises
  33. UIKit SwiftUI With SwiftUI + TCA, Previews dramatically boosted development

    time Development Time (Estimated) Estimated ~50% in this case
  34. Before Fully Adopting Helpful if you can understand these View

    lifecycle Layout system Identifier based Proposed & Cooperative
  35. Before Fully Adopting Helpful if you can understand these View

    lifecycle Layout system Version evolution Identifier based Proposed & Cooperative Use latest technology