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

iOSDC2021 - Compositional Layoutsで実現する疎結合な実装

h.crane
September 17, 2021

iOSDC2021 - Compositional Layoutsで実現する疎結合な実装

h.crane

September 17, 2021
Tweet

More Decks by h.crane

Other Decks in Technology

Transcript

  1. 2 About me 〈Company〉 ・Rakuten Group, Inc. 〈 Application 〉

    ・Rakuma 〈Role〉 ・iOS Developer ・Developer Relations 〈Account〉 ・Twitter: @hcrane14 ・GitHub: @crane-hiromu
  2. 3

  3. 6 What is Composi'onal Layouts ? Quote: https://developer.apple.com/documentation/uikit/views_and_controls/collection_views/layouts Overview A

    collection view layout defines the visual arrangement of the content in your collection. Layouts are designed to be flexible to let you create any kind of arrangement you need for your content, from simple to complex. The simplest type of collection view layout displays its items in a grid, but you can define layouts to arrange items however you like. For example, you might create a layout where items are arranged in a circle or vary in size. You can also change layouts dynamically at runtime whenever you need to present items differently, such as when a user rotates the device. Collection view layouts are customizable and highly visual. For example, the App Store app uses a single collection view with custom layouts per section to showcase different kinds of content.
  4. 11 Reason • 作りたい画面を作成するのに向いていない 1. 縦横スワイプするデザインの場合 → UICollectionView に相当するものがない 2.

    動的にコンテンツが増える場合(追加読み込み実装) → スクロールの offset がデフォルトでとれない • 画面の状態を保持できない - 特定の動作で画面が自動でリフレッシュされてしまう → タブ切り替え → 画面遷移
  5. 18 MVP + Clean Architecture with ComposiConal Layouts ViewController Presenter

    UseCase Repository DataStore Compositional Layouts
  6. 20 MVP + Clean Architecture with Compositional Layouts of Abstraction

    Presenter UseCase Repository DataStore ViewController ComposiJonal Layouts
  7. 29

  8. 31 MVP + Clean Architecture with Compositional Layouts of Abstraction

    Presenter UseCase Repository DataStore ViewController ComposiJonal Layouts