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

Backend Driven UIs

Backend Driven UIs

Presented by Bhagat Singh

Eeb061c8b2816b771920da1b3e7904a3?s=128

Swift India

January 25, 2020
Tweet

Transcript

  1. Backend Driven UIs

  2. PhonePe iOS Engineer raywenderlich.com Contributor

  3. How we build it now?

  4. We make a TableView or a CollectionView.

  5. Includes a lot of boilerplate, which you are tired of

    writing.
  6. Bloats the app.

  7. We keep on doing this till infinity.

  8. The main turn off

  9. Design Iterations

  10. Changing that same view

  11. Again

  12. And Again

  13. Again.

  14. None
  15. Make it independent

  16. “Driving it from the backend”

  17. Why would you want such a thing?

  18. It is purely use-case dependent.

  19. SwiftUI has not taken over the world right now.

  20. Consistency

  21. Adaptability

  22. Iterative

  23. Scaleable

  24. Prerequisites

  25. Design System

  26. Steps to uniforming your UI

  27. Invest time in making a uniform design system

  28. Many Design tools such as Figma, Sketch, Adobe XD.

  29. The most important part.

  30. Get that design system into code

  31. Make it driven from the backend.

  32. Laying our views realtime

  33. UICollectionView

  34. Consists of two entities

  35. Data and Layout

  36. Layout

  37. ViewType

  38. None
  39. ScrollType

  40. None
  41. Data

  42. Data is just an array of objects, which includes necessary

    parameters like title, image etc.
  43. UI Elements

  44. BaseView

  45. BaseView is a UIView + A protocol which has all

    necessary information to calculate sizes, set some data and so on.
  46. BaseCollectionViewCell

  47. BaseCollectionViewCell is a CVC which has all relevant information on

    calculating size and for the layout of the rest of the view.
  48. BaseTableViewCell

  49. BaseTableViewCell is a container which holds all our collectionViews

  50. Some Code

  51. Handling Clicks

  52. Deeplinks and ViewModels

  53. Deeplinks are the key here for in-app navigation

  54. Some Pros

  55. Scaleable

  56. Testable

  57. No intervention necessary

  58. Realtime Updates

  59. Fast and hassle-free

  60. Can last you at least a year if done properly.

  61. Can last you at least a year if done properly.

    Unless you have a crazy designer
  62. Some Cons

  63. Performance

  64. Overkill

  65. Idk if it works with Storyboards

  66. What can be improved?

  67. Height Calculations

  68. Height Caching

  69. Some boilerplate

  70. Questions, Suggestions, Ideas!

  71. Thanks @soulful_swift