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

SwiftUI In Production

SwiftUI In Production

With the 10.3 release of our iOS PDF SDK, we’re shipping SwiftUI in production. This is a big milestone for us, and an even more interesting one, as our product still supports iOS 12. In this talk I'll explain how we built this feature while also keep things working for iOS 12, and why we picked SwiftUI for it.

Video: https://vimeo.com/536908653

This talk has been made for Swift Heroes 2021.

Peter Steinberger

April 16, 2021
Tweet

More Decks by Peter Steinberger

Other Decks in Programming

Transcript

  1. Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  2. whoami
    • Peter Steinberger
    • Founder @ PSPDFKit
    • @steipete on Twi7er
    • h7ps:/
    /steipete.com/speaking
    h"ps:/
    /twi"er.com/steipete

    View full-size slide

  3. h"ps:/
    /pspd(it.com - The Complete PDF Solu:on You Can Rely On

    View full-size slide

  4. Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  5. Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  6. Catalyst Se*ngs In Swi0UI
    h"ps:/
    /twi"er.com/steipete/status/1363079081198288898?s=20

    View full-size slide

  7. Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  8. The New Feature: Electronic Signatures
    Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  9. Benefits of Swi-UI
    Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  10. Mixing with Exis,ng Code
    Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  11. Challenges of Swi/UI
    Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  12. Presen&ng Popovers on iPhone
    Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  13. h"ps:/
    /pspd(it.com/blog/2020/popovers-from-swi:ui-uibarbu"on/

    View full-size slide

  14. Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  15. Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  16. h"ps:/
    /stackoverflow.com/ques5ons/58837007/mul5ple-shee5spresented-doesnt-work-in-swi@ui

    View full-size slide

  17. h"ps:/
    /gist.github.com/steipete/b9f43b455f396a8db764d13eec971e9b

    View full-size slide

  18. Toolbars in Swi-UI
    h"ps:/
    /github.com/Swi2UIX/Swi2UIX

    View full-size slide

  19. Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  20. SE-0308
    h"ps:/
    /github.com/apple/swi4-evolu7on/blob/main/proposals/0308-postfix-if-config-expressions.md

    View full-size slide

  21. Geometry Readers
    Exception Type: EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Exception Note: EXC_CORPSE_NOTIFY
    Application Specific Information:
    abort() called
    AttributeGraph precondition failure: invalid input index: 2.
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0 libsystem_kernel.dylib 0x00007fff677a733a __pthread_kill + 10
    1 libsystem_pthread.dylib 0x00007fff67867e60 pthread_kill + 430
    2 libsystem_c.dylib 0x00007fff6772e808 abort + 120
    3 com.apple.AttributeGraph 0x00007fff41832631 AG::precondition_failure(char const*, ...) + 273
    4 com.apple.AttributeGraph 0x00007fff418096a6 AG::Graph::input_value_ref_slow(unsigned int) + 490
    5 com.apple.SwiftUI 0x00007fff6a3a0761 RootGeometry.update(context:) + 97
    6 com.apple.SwiftUI 0x00007fff6a3a44d8 partial apply for protocol witness for static
    UntypedAttribute._update(_:graph:attribute:) in conformance RootGeometry + 24
    7 com.apple.AttributeGraph 0x00007fff41805bb9 AG::Graph::UpdateStack::update() + 455
    h"ps:/
    /pdfviewer.io/

    View full-size slide

  22. h"ps:/
    /stackoverflow.com/ques5ons/60868788/precondi5on-failure-invalid-input-index-when-using-geometryreader-in-swiCui-s

    View full-size slide

  23. ObservableObject on iOS 13
    Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  24. First Responder
    Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  25. h"ps:/
    /github.com/siteline/Swi5UI-Introspect

    View full-size slide

  26. h"ps:/
    /github.com/siteline/Swi5UI-Introspect

    View full-size slide

  27. Scale Factor Loop
    Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  28. Wrapping Views
    Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  29. Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  30. Retrofi'ng Combine Publisher
    Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  31. Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  32. Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  33. Keyboard Avoidance
    Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  34. Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  35. Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  36. Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  37. Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  38. Summarize
    • State of Swi+UI
    • Mixing with exis4ng Code
    • Presen4ng Popovers
    • Toolbar Logic
    • Geometry Reader (and other) Bugs
    • Wrapping Views
    • First Responder SeKng
    • RetrofiKng Combine
    Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide

  39. Thanks! Ques,ons?
    Swi$UI In Produc/on — Swi$ Heroes 2021 | Peter Steinberger — @steipete

    View full-size slide