iOS 14のピッカーあれこれ

iOS 14のピッカーあれこれ

CA.swift #12 WWDC20報告会
NDAの関係で中身がすかすかのスライド

9d1961575e45a8286cdde5f86dbba312?s=128

akatsuki174

July 01, 2020
Tweet

Transcript

  1. iOS 14ͷϐοΧʔ͋Ε͜Ε CA.swift #12 WWDC20ใࠂձ @akatsuki174

  2. ࣗݾ঺հ

  3. • ਢ౻ຘʢ@akatsuki174ʣ • iOS→AndroidΤϯδχΞ • גࣜձࣾTimersॴଐ • Ұ൪Θ͘Θͨ͘͠ػೳɿWidget

  4. ΞΠεϒϨΠΫ 5

  5. ࠓ೔ͷ࿩

  6. ໨࣍ • [New] ColorPicker • [Update] DatePicker

  7. ͜ͷࢿྉͷݩʹͳͬͨಈը • Design with iOS pickers, menus and actions •

    https://developer.apple.com/videos/play/ wwdc2020/10205
  8. ࠓ೔ͷࢿྉ

  9. ࠓ೔ͷࢿྉ • NDAతʹ΍͹Ίͳͱ͜ΖΛൈ͔ͯ͠Ξοϓࡁ • TwitterͰྲྀͯ͠·͢ • ΘΓͱ͚ܽͯ͠·ͬͨ… • ϑϧver΄͍͠ਓ͍ͨΒ࿈བྷ͍ͩ͘͞

  10. ColorPicker

  11. ColorPickerͱ͸ • ͦͷ໊ͷ௨Γ৭Λબ΂ΔϐοΧʔ • άϦουɺεϖΫτϧɺεϥΠμʔͳͲΛɹ ࢖ͬͯ৭Λબ୒Ͱ͖Δ

  12. None
  13. ColorPickerͷ͍͢͝ͱ͜Ζ̍ • ৭͸อଘͯ͠ผΞϓϦͰ΋࢖͏͜ͱ͕Ͱ͖Δ

  14. </%"> ৭Λอଘͯ͠Δ༷ࢠΛөͨ͠ಈը

  15. ColorPickerͷ͍͢͝ͱ͜Ζ̎ • εϙΠτπʔϧΛ࢖ͬͯ৭ΛऔಘͰ͖Δ

  16. </%"> εϙΠτπʔϧΛ࢖ͬͯΔ༷ࢠΛөͨ͠ಈը

  17. ࣮ࡍʹݟͯΈΑ͏ Ϙλϯλοϓ →ColorPickerදࣔ →৭બ୒ →ࢦఆͨ͠ViewͷbackgroundColorΛมߋ

  18. </%"> ΧϥʔϐοΧʔΛಈ͔͍ͯ͠Δ༷ࢠ

  19. </%"ʁ> ࣗ෼Ͱ࡞ͬͨσϞΞϓϦͷ࣮૷ίʔυ

  20. selectedColor • બ୒தͷ৭Λද͢ • getter, setter͕͋Δ • setter͸ϐοΧʔىಈ࣌ʹࢦఆ͢ΔͳͲͷ༻్ʁ

  21. supportsAlpha • AlphaεϥΠμʔΛ༻ҙ͢Δ͔Ͳ͏͔

  22. TVQQPSUT"MQIBGBMTF TVQQPSUT"MQIBUSVF </%"ʁ> "MQIBεϥΠμʔͷ༗ແ͕Θ͔ΔεΫγϣ

  23. colorPickerViewController DidSelectColor • ϐοΧʔ্Ͱ৭Λબ୒ͨ͠ͱ͖ʹݺ͹ΕΔ

  24. colorPickerViewController DidFinish • ϐοΧʔΛดͨ࣌͡ʢӈ্ͷXΛλοϓͨ࣌͠ʣ ʹݺ͹ΕΔ

  25. DatePicker

  26. Կ͕৽͘͠ͳͬͨͷ͔ • ίϯύΫτϞʔυɺΠϯϥΠϯϞʔυͰදࣔɹ Ͱ͖ΔΑ͏ʹͳͬͨ • ਖ਼֬ʹ͸ɺ.compact͸iOS 13.4Ҏ߱ • ࣌ؒ͸ΩʔϘʔυͰೖྗՄೳ

  27. શछྨ

  28. .compactදࣔ • UIButtonͷΑ͏ͳ೔෇දࣔΛλοϓͯ͠ɹ ϐοΧʔΛىಈ • ࣌ࠁɺ೔෇ΛϞʔμϧ಺Ͱબ୒Ͱ͖Δ • UIͷεϖʔε͕ݶΒΕ͍ͯΔͱ͖ʹศར

  29. </%"> DPNQBDUදࣔ͞ΕͨQJDLFSΛ ಈ͔͍ͯ͠Δ༷ࢠΛөͨ͠ಈը

  30. .inlineදࣔ • ϐοΧʔ͕ͦͷ··ຒΊࠐ·Ε͍ͯΔ • ϞʔμϧΛग़͢ख͕ؒল͚Δ • iPadͳͲεϖʔε͕޿͍৔߹ʹ༗ޮ

  31. </%"> JOMJOFදࣔ͞ΕͨQJDLFSͷεΫγϣ

  32. Կ͔ରԠ͸ඞཁʁ • UIDatePickerͷAPI͸·ͬͨ͘ಉ͡·· • iOS 13 SDKͰϏϧυͯ͠ΔݶΓ͸େৎ෉ͦ͏ • iOS 14

    SDKͰϏϧυͨ͠Β preferredDatePickerStyleʹ.automatic͕ઃఆ ͞Εͯಈ͖͕มΘΔ…ʁ
  33. J04BVUPNBUJD J04BVUPNBUJD </%"> BVUPNBUJDͷ༷ࢠͷҧ͍

  34. ࠓ·Ͱ௨Γʹ͍ͨ͠ͳΒ • preferredDatePickerStyleΛ.wheelsʹ͢Ε͹ ྑͦ͞͏

  35. ࣮ࡍʹݟͯΈΑ͏ compact date pickerΛλοϓ →೔෇બ୒ʢdate, time, dateAndTimeʣ →೔෇ܾఆ

  36. </%"> ֤λΠϓͷEBUFQJDLFSΛಈ͔͍ͯ͠Δ༷ࢠΛ өͨ͠ಈը

  37. </%"> 4UPSZCPBSEͷ༷ࢠ

  38. ·ͱΊ

  39. ·ͱΊ • ColorPicker͸༷ʑͳ؍఺͔Β৭Λબ୒Ͱ͖Δ • ৽͍͠DatePicker͸ΑΓࣗવͳUIʢओ؍ʣͰɹ ೔෇Λબ୒Ͱ͖Δ

  40. ೔ຊޠࢿྉ

  41. ݟͯͶ • iOS 14ͰมΘΔϐοΧʔͱɺ৽͘͠ొ৔ͨ͠ɹ ΧϥʔϐοΧʔ • https://qiita.com/akatsuki174/items/ 56fc648f513d3e92387f 5

  42. એ఻

  43. iOSDCνέοτൃചதʂʂ • ࠓ೥͸ΦϯϥΠϯ։࠵ • ࠓͳΒΞʔϦʔόʔυ2,000ԁʢ͍҆ʂʣ • ϊϕϧςΟ͸༣ૹ • ύϯϑϨοτʹ͸Ԡื͕͋ͬͨݪߘΛܝࡌ •

    9/19(౔) ʙ 9/21(݄ॕ)ɺͥͻ͝ࢀՃΛʂ 5
  44. • αʔόʔαΠυΤϯδχΞ (PHP, Golang, AWS) • AndroidΤϯδχΞ (Kotlin) • iOSΤϯδχΞ

    (Swift) TimersͰ͸ݱࡏΤϯδχΞશ৬छ࠾༻தʂ ৄ͘͠͸”Timers”Ͱݕࡧ 5
  45. ͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ