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

Modernizing Your UI for iOS 13

Modernizing Your UI for iOS 13

Timers Meetup #2 ~WWDC After Party~で発表したスライドです。
https://timers.connpass.com/event/131798/

Demo App
https://github.com/hirothings/Context-Menus-Demo

C0c3e2b792a468590679e46b86e1784d?s=128

hirothings

June 18, 2019
Tweet

More Decks by hirothings

Other Decks in Technology

Transcript

  1. Modernizing Your UI for iOS 13 @hirothings

  2. https://developer.apple.com/videos/play/wwdc2019/224/

  3. Agenda • New Presentation Style (Demo) • Menus (Demo) •

    Search (Demo)
  4. ࣗݾ঺հ • @hirothings (Objective-ͻΖC) • ݩϥʔϝϯ԰ళ௕ϓϩάϥϚʔ • ৭ʑ͋ͬͯݱࡏiOSσϕϩούʔ • Money

    Forward, Inc.
  5. New Presentation Style

  6. New Presentation Style • ϋʔϑϞʔμϧ͕ඪ४UIͱͯ͠ొ৔ • Xcode11 betaͰϏϧυ • Կ΋͠ͳͯ͘΋ϋʔϑϞʔμϧ

    • (portraitϞʔυͷ৔߹) • UIModalPresentationStyle.pageSheet͕దԠ ͞ΕΔ
  7. New Presentation Style Demo..

  8. UIModalPresentationStyle.a utomatic (iOS13~) • γεςϜ͕ࣗಈͰϞʔμϧͷελΠϧΛৼΓ෼͚Δ • ΄ͱΜͲͷ৔߹ɺ.pageSheet͕దԠ͞ΕΔ • .pageSheet͸ϥϯυεέʔϓϞʔυͷ৔߹ɺ .fullScreenͱಉ͡

    ڍಈʹͳΔ
  9. Կ΋ࢦఆ͍ͯ͠ͳ͍৔߹ͷɺ UIModalPresentationStyle iOS12: .fullScreen iOS13: .pageSheet ※͍ͣΕ΋portraitϞʔυ

  10. “ฤूத”ͷϋʔϑϞʔμϧΛϢʔ βʔ͕εϫΠϓͰด͡Α͏ͱͨ͠ ͱ͖ͷ੍ޚʹ͍ͭͯ

  11. None
  12. None
  13. None
  14. Demo..ɹ(Appleެࣜ) IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZ XXED

  15. presentationControllerDidA ttemptToDismiss(_:) • Ϣʔβʔ͕εϫΠϓͰϞʔμϧΛด͡Δͱ੍͖ޚ ͕Մೳ • ϋʔϑϞʔμϧ࣌୅ͷDelegateϝιου

  16. presentationControllerDidA ttemptToDismiss(_:) • UIAdaptivePresentationControllerDelegateͷNewϝ ιου • isModalInPresentation(iOS13~)͕true·ͨ͸ presentationControllerShouldDismiss͕falseͷ৔߹ɺ͜ ͷϝιου͕ݺ͹ΕΔ

  17. ࣮૷ͷྲྀΕ 1. isModalInPresentationΛ੍ޚ

  18. ࣮૷ͷྲྀΕ 2. presentationControllerDidAttemptToDismiss(_:) ಺ͰΞϥʔτΛग़͢ isModalInPresentation = trueͳͷͰݺ͹ΕΔ

  19. ϑϩʔ

  20. Context Menus

  21. • ϦονϓϨϏϡʔ • ωετͨ͠αϒϝχϡʔ • Ұ؏ͨ͠δΣενϟ • 3D Touch •

    Haptic Touch • Long press • Secondary click Context Menus
  22. Demo https://github.com/hirothings/Context-Menus-Demo Context Menus

  23. UIContextMenuInteractionDel egate • UIViewͳͲʹContext MenuදࣔͷΠϯλϥΫ γϣϯΛ෇༩ • ࣮૷ඞཁͳϝιου͸Delegateϝιου1͚ͭͩ

  24. UIContextMenuConfiguration • UITableView and UICollectionView • ؆୯ʹϝχϡʔΛදࣔͰ͖ΔDelegate͕௥Ճ

  25. UIContextMenuConfiguration

  26. UIContextMenuConfiguration • previewProvider: ϓϨϏϡʔΛฦ͢ViewControllerΛࢦఆ • actionProvider: ϝχϡʔͱΞΫγϣϯΛࢦఆ ※࣮ଶ͸Ϋϩʔδϟͷtypealias

  27. ※ϝχϡʔදࣔͷίʔυશମ

  28. Search

  29. UISearchTextField

  30. UISearchTextField • ؆୯ʹUISearchBarͷtextField͕ΧελϚΠζͰ ͖ΔΑ͏ʹͳͬͨ (ࠓ·Ͱ͸Viewͷ֊૚Λ۷ͬͯΧελϚΠζ͢ΔͳͲΧελϚΠ ζ͕ΊΜͲ͔ͬͨ͘͞) UISearchTextField

  31. UISearchToken

  32. • ͜Μͳײ͡ͷλάදࣔΛެࣜαϙʔτ UISearchToken

  33. Demo..

  34. ٙ໰఺͕ଟ͍.. (ཧղෆ଍ͷՄೳੑ͋Γ) UISearchToken • tokenΛΩʔϘʔυͷdeleteϘλϯͰ࡟আͨ͠ͱ ͖ͷΠϕϯτ͕ݟ౰ͨΒͳ͍ • tokenͷจࣈྻ΁ͷΞΫηε͕value(forKey key: String)Ҏ֎ݟ౰ͨΒͳ͍

    • Ϣʔεέʔε͕ϋοΩϦΘ͔Βͳ͔ͬͨ
  35. • ެࣜsample..

  36. ݟ౰ͨΒͳ͍ • ެࣜsample..͕ݟ౰ͨΒͳ͍(ݟ͚ͭΕͯͳ͍͚͔ͩ΋͠Εͳ͍)

  37. • ஍ٿ্ʹsample͕ݟ౰ͨΒͳ͍(ݟ͚ͭΕͯͳ͍͚͔ͩ΋͠Εͳ͍) 4XJGU݅

  38. More Information https://developer.apple.com/wwdc19/224

  39. ϑϧFirebaseͰݸਓΞϓϦ࡞Γ·ͨ͠

  40. ܦඅ is God !! ܦඅ is God !! Join us!!

    iOSΤϯδχΞઈࢍืूதͰ͢