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

Build for iPad recap

Build for iPad recap

Build for iPad

集まれSwift好き!Swift愛好会スピンオフ WWDC20セッション要約会 @オンライン
https://love-swift.connpass.com/event/181458/

ブログ記事
https://usami-k.hatenablog.com/entry/2020/07/09/225826

USAMI Kosuke

July 09, 2020
Tweet

More Decks by USAMI Kosuke

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • Ӊࠤݟ ެี • ϑΣϯϦϧגࣜձࣾʢେࡕຊࣾۈ຿ɺݱࡏ͸ࡏ୐ۈ຿ʣ • Mobile Act ओ࠵

    • Mobile Act ONLINE #1ʢ7/22ʣ • ొஃऀɾࢀՃऀΛืूத • iOSDC ݪߘԠืΛ࠾୒͍͖ͨͩ·ͨ͠ʢࣥචதʣ 2/25
  2. iPad ΞϓϦͷηογϣϯ ͜ͷ2͕͓ͭ͢͢Ί • Designed for iPadʢiPadͷઃܭʣ • Build for

    iPadʢiPad༻Ϗϧυʣ ଞʹ΋ɺApple PencilɺΩʔϘʔυɺτϥοΫύουɺ Catalyst ͳͲ΋஫ҙ iPhone ͱ Mac ͷதؒͷσόΠεͰɺߟ͑Δ΂͖͜ͱ͸ଟ͍ 3/25
  3. Multi-column Split View • UISplitViewController ʹଟ͘ͷ API ͕௥Ճ͞Εͨ • ࢀߟ

    : API Document Ͱ͸࣍ͷΑ͏ʹݺ͹Ε͍ͯΔ • ৽͍͠΋ͷ : Column Style Split Views • ैདྷͷ΋ͷ : Classic Split Views • iPad ͷαΠυόʔͷ࣮૷ʹ࢖͏ 6/25
  4. Size Class ରԠ • φϏήʔγϣϯͷσβΠϯ • Regular : αΠυόʔ •

    Compact : λϒόʔ • UISplitViewController Ͱڞ௨࣮૷ splitViewController .setViewController(tabBarController, for: .compact) 11/25
  5. Collection View setup • UICollectionLayoutListConfiguration ͕௥Ճ͞Εͨ • appearance : .sidebar

    / .sidebarPlain let configuration = UICollectionLayoutListConfiguration(appearance: .sidebar) let layout = UICollectionViewCompositionalLayout.list(using: configuration) let collectionView = UICollectionView(frame: frame, collectionViewLayout: layout) 17/25
  6. ·ͩ UITableView ࢖ͬͯΔͷʁ If you're still using UITableView, we highly

    recommend you switch to UICollectionView. ΋͋͠ͳ͕ͨ·ͩ UITableView Λ࢖͍ͬͯΔͳΒɺ UICollectionView ʹ੾Γସ͑Δ͜ͱΛڧ͘͢͢ΊΔɻ • αΠυόʔରԠ͸ͦΕʹͪΐ͏Ͳྑ͍ͱࢥΘΕΔ 19/25
  7. Reducing modality • iPad ͷΑ͏ͳ޿͍ը໘Λ࣋ͭσόΠεͰ͸ɺϞʔμϧදࣔ͸ ద੾Ͱ͸ͳ͍ • ྫ : ϝϞΞϓϦ

    • Color Picker Ͱ৭Λબ୒ͨ͠ޙɺPicker Λด͡Δૢ࡞ Λͤͣʹઢ͕͔͚Δ • Color Picker ͸ࣗಈతʹด͡Δ 21/25
  8. Case study : Shortcuts • γϣʔτΧοτΞϓϦͰͷ࣮ྫ঺հ • Multi-column Split View

    • Lists • Reducing modality • Regular / Compact ͷ੾Γସ͑ʹ͍ͭͯ΋ղઆ͞Ε͍ͯΔ 24/25