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

札幌iPhone開発懇談会2020年11月資料

notoroid
November 23, 2020

 札幌iPhone開発懇談会2020年11月資料

iOS14で追加されたWidget/ウィジット設定ダイアログについての発表資料。

・ウィジット略史
・16ステップでできるウィジット設定ダイアログ

notoroid

November 23, 2020
Tweet

More Decks by notoroid

Other Decks in Programming

Transcript

  1. ΢ΟδοτઃఆμΠΞϩά
    8JEHFU$POpHVSBUJPO$VTUPN*OUFOU

    View full-size slide

  2. ೳొཁ !OPUPSPJE

    w J04ΞϓϦ։ൃऀ
    w ԰߸͍Γ·͢ిࢉاը
    w !OPUPSPJE
    w !JSJNBTV
    w ࠷ۙͷಈ޲
    w ϒϩά࡮৽͠·ͨ͠

    View full-size slide

  3. ॆిใࠂ͞Μ #BUUFSFDFJWFS

    w όοςϦʔϞχλʔ ϢʔςΟϦςΟʔ

    w ࠷େ୆ ࣮ػϦϞʔτ୆

    w ख࣋ͪͷJ1IPOF͔Βଞʹ͍࣋ͬͯΔ
    J1IPOF J1BEͳͲͷػثͷόοςϦʔঢ়ଶ֬
    ೝՄೳ
    w ࣗ୐ʹ͋ΔJ1IPOFͷόοςϦʔঢ়ଶ֬ೝՄ

    View full-size slide

  4. ॆిใࠂ͞Μ #BUUFSFDFJWFS

    w "QQMF8BUDIରԠ
    w $PNQMJDBUJPOTରԠ
    w ॆి׬ྃ௨஌
    w ॆి׬ྃΛ఻͑ͯ͘ΕΔ௨஌Λ௥Ճ
    w ҎԼʹࢦఆ͢Δ͜ͱͰόοςϦʔ
    ΛέΞ͢Δ͜ͱ͕Մೳ
    w Կ͔ͱߴ͍J1IPOFΛ௕࣋ͪͤ͞Δͷʹ༗

    View full-size slide

  5. ॆిใࠂ͞Μ #BUUFSFDFJWFS

    /FX
    ΢ΟδοτʹରԠ͠·ͨ͠ J04ʙ

    4NBMM .FEJVN

    View full-size slide

  6. ॆిใࠂ͞Μ #BUUFSFDFJWFS

    ΢ΟδοτઃఆΛ௥Ճ͠·ͨ͠ W

    View full-size slide

  7. ࿩͢͜ͱ
    w ΢Οδοτུ࢙
    w 8JEHFU,JU8JEHFU$POpHVSBUJPO
    w $VTUPN*OUFOU

    View full-size slide

  8. ࿩͞ͳ͍͜ͱ
    w 4XJGU6*Λ࢖ͬͨ8JEHFU,JUͷදࣔ

    View full-size slide

  9. ୊໨
    w ΢Οδοτུ࢙
    w ΢ΟδοτઃఆμΠΞϩά
    w ΢ΟδοτઃఆμΠΞϩάͷ࡞੒εςοϓ
    w ·ͱΊ

    View full-size slide

  10. ΢Οδοτུ࢙

    View full-size slide

  11. J04Ͱ΢ΟδοτରԠ
    ௥Ճ͞Ε·ͨ͠

    View full-size slide

  12. ͦ΋ͦ΋΢ΟδοτͬͯԿ
    J04ͷ΢Οδοτʹͭͳ͕Δ΢Οδοτͱ͸

    View full-size slide

  13. ḪΔ͜ͱ೥
    ,POGBCVMBUPS :BIPP8JEHFU&OHJOF

    View full-size slide

  14. ḪΔ͜ͱ೥
    ,POGBCVMBUPS :BIPP8JEHFU&OHJOF

    View full-size slide

  15. :BIPP8JEHFU&OHJOF

    View full-size slide

  16. :BIPP8JEHFU&OHJOF
    Ξφϩά࣌ܭ
    σδλϧ࣌ܭ
    ϛϡʔδοΫ
    ϓϨΠϠʔ
    8Jpڧ౓
    όοςϦʔ࢒ྔ
    Ϛοϓ
    ఱؾ
    ΰϛശ
    ΧϨϯμʔ
    ΧϨϯμʔ

    View full-size slide

  17. "QQMF

    %BTICPBSE

    View full-size slide

  18. %BTICPBSE 04ᶠ

    Ξφϩά࣌ܭ
    ఱؾ
    $BMDVMBUPS
    ΧϨϯμʔ

    View full-size slide

  19. %BTICPBSE΢Οδοτͷߏ੒
    w εΩϡϞʔϑΟζϜ
    w 8FC༝དྷͷٕज़
    w 9.-
    w &$."4DSJQUY
    w σʔλιʔε
    w γεςϜʹ௚઀ΞΫηεՄೳ
    w ωοτϫʔΫ΁ͷΞΫηε

    View full-size slide

  20. ॳ୅J1IPOFͷϧοΫεϥΠΫʹӨڹ
    J1IPOF(
    04ᶠΞϓϦ
    04ᶠ%BTICPBSE
    ΢Οδοτ
    J1PE

    View full-size slide

  21. ॳ୅J1IPOFͷϧοΫεϥΠΫʹӨڹ
    J1IPOF(
    04ᶠΞϓϦ
    04ᶠ%BTICPBSE
    ΢Οδοτ
    J1PE
    ˞΄΅049ͷػೳ͔Βͷ࣋ͪग़͕ͩ͠ɺ
    ɹ࣌ܭɺఱؾͳͲ͸΢ΟδοτͷӨڹ͕େ͖͍

    View full-size slide

  22. Կ͕ݴ͍͍͔ͨͱ͍͏ͱ

    View full-size slide

  23. J1IPOF্ཱͪ͛౰ॳ͸
    ϑΝʔεταʔυύʔςΟؚΊͯ
    ΢ΟδοτతΞϓϦͱΞϓϦ͕ࠞࡏ

    View full-size slide

  24. ͦͷޙɺΞϓϦࢢ৔্ཱ͕ͪΓͱڞʹ
    ΢ΟδοτతΞϓϦ͸৹ࠪͰ
    ػೳෆ଍ͱΈͳ͞ΕΔΑ͏ʹ

    View full-size slide

  25. ೥ΞϓϦͷ֦ுػೳͱͯ͠
    5PEBZ&YUFOTJPO͕ొ৔

    View full-size slide

  26. ೥ΞϓϦͷ֦ுػೳͱͯ͠
    5PEBZ&YUFOTJPO͕ొ৔
    &YUFOTJPOٕज़Λ޿Ί͍͚ͨͩͷΤα

    View full-size slide

  27. ೥8JEHFU,JUൃද
    ϚϧνϓϥοτϑΥʔϜΤωϧΪʔޮ཰Λߟྀ

    View full-size slide

  28. ೥8JEHFU,JUൃද
    ϚϧνϓϥοτϑΥʔϜΤωϧΪʔޮ཰Λߟྀ
    4XJGU6**OUFOUٕज़Λ޿Ί͍͚ͨͩͷΤα

    View full-size slide

  29. 8JEHFU,JU
    8JEHFU$POpHVSBUJPO

    View full-size slide

  30. 8JEHFU$POpHVSBUJPO
    ΢ΟδοτઃఆμΠΞϩά

    View full-size slide

  31. ΢Οδοτઃఆ
    ௕ԡ͠Ͱϝχϡʔදࣔ ઃఆ߲໨Ұཡ બ୒ࢶΛλοϓՄೳ

    View full-size slide

  32. ΢Οδοτઃఆ
    ௕ԡ͠Ͱϝχϡʔදࣔ ઃఆ߲໨Ұཡ બ୒ࢶΛλοϓՄೳ
    $VTUPN*OUFOU
    QBSBNFUFS
    QBSBNFUFS

    View full-size slide

  33. 4JSJɺ4JSJ4IPSUDVUͰ
    ಋೖ͞Ε͍ͯͨ$VTUPN*OUFOUΛ
    ΢ΟδοτઃఆμΠΞϩάͰ࢖༻

    View full-size slide

  34. $VTUPN*OUFOU
    $VTUPN*OUFOU)BOEMFS
    $VTUPN*OUFOU /46TFS"DUJWJUZ J04J1BE"QQ
    1BSBNFUFST
    04ͷ஥հ
    *OUFOU໊
    *OUFOUҾ͖౰ͯ
    *OUFOUެ։

    View full-size slide

  35. $VTUPN*OUFOU
    $VTUPN*OUFOU)BOEMFS
    $VTUPN*OUFOU
    1BSBNFUFST
    04ͷ஥հ
    J04J1BE8JEHFU
    8JEHFUʹ$VTUPN*OUFOUΛख౉͠
    *OUFOU໊
    *OUFOUҾ͖౰ͯ
    *OUFOUެ։

    View full-size slide

  36. ΢ΟδοτઃఆμΠΞϩάͷ
    εςοϓຖͷखॱ

    View full-size slide

  37. αϯϓϧίʔυ

    View full-size slide

  38. IUUQTHJUIVCDPNOPUPSPJE
    8JEHFU$POpHVSBUJPO%FNP

    View full-size slide

  39. ΢ΟδοτઃఆμΠΞϩάͷલఏ
    J04J1BEΞϓϦͷϓϩδΣΫτ
    ΢ΟδοτλʔήοτΛ௥Ճ͢Δ
    w ઃఆμΠΞϩά෇͖
    ΢Οδοτઃఆ༻ʹΠϯςϯτ֦ுΛ௥Ճ͢Δ

    View full-size slide

  40. બ୒ࢶ༻ͷఆٛ

    View full-size slide

  41. enum DisplayTypeDefinition: String {
    case slot234 = "Slot2-3-4"
    case slot1 = "Slot1"
    case slot2 = "Slot2"
    case slot3 = "Slot3"
    case slot4 = "Slot4"
    func identifier() -> String {
    self.rawValue
    }
    func displayName() -> String {
    switch self {
    case .slot234:
    return "Stack(Slot2,3,4)"
    case .slot1:
    return "Slot1"
    case .slot2:
    return "Slot2"
    case .slot3:
    return "Slot3"
    case .slot4:
    return "Slot4"
    }
    }
    }

    View full-size slide

  42. εςοϓͰऴΘΔ
    ΢ΟδοτઃఆμΠΞϩά

    View full-size slide

  43. ̏ͭͷث
    "QQ 8JEHFU *OUFOU

    Λຬͨͤ͹׬੒

    View full-size slide

  44. ΢ΟδοτλʔήοτΛ௥Ճᶃ

    View full-size slide

  45. ΢ΟδοτλʔήοτΛ௥Ճᶄ

    View full-size slide

  46. *OUFOUEFpOJUJPOΛઃఆ͢Δᶃ

    View full-size slide

  47. *OUFOUEFpOJUJPOΛઃఆ͢Δᶄ

    View full-size slide

  48. *OUFOUEFpOJUJPOΛઃఆ͢Δᶅ

    View full-size slide

  49. *OUFOUEFpOJUJPOΛઃఆ͢Δᶆ

    View full-size slide

  50. *OUFOUEFpOJUJPOΛઃఆ͢Δᶇ

    View full-size slide

  51. *OUFOUEFpOJUJPOΛઃఆ͢Δᶈ

    View full-size slide

  52. ΢Οδοτઃఆ༻*OUFOUTΛ௥Ճ͢Δᶃ

    View full-size slide

  53. ΢Οδοτઃఆ༻*OUFOUTΛ௥Ճ͢Δᶄ

    View full-size slide

  54. ΢Οδοτઃఆ༻*OUFOUTΛ௥Ճ͢Δᶅ

    View full-size slide

  55. 4VQQPSUFE*OUFOUTΛઃఆ

    View full-size slide

  56. ྻڍఆٛΛ௥Ճ

    View full-size slide

  57. *OUFOU)BOEMFSΛஔ͖׵͑Δ

    View full-size slide

  58. class IntentHandler: INExtension, ConfigurationIntentHandling {
    func provideDisplayTypeOptionsCollection(for intent: ConfigurationIntent, with completion:
    @escaping (INObjectCollection?, Error?) -> Void) {
    let displayTypeDefinitions: [DisplayTypeDefinition] = [ .slot234,
    .slot1,
    .slot2,
    .slot3,
    .slot4
    ]
    let displayType = displayTypeDefinitions.map { (displayTypeDefinition) -> DisplayType in
    DisplayType(identifier: displayTypeDefinition.identifier(), display:
    displayTypeDefinition.displayName())
    }
    completion(INObjectCollection(items: displayType), nil)
    }
    func defaultDisplayType(for intent: ConfigurationIntent) -> DisplayType? {
    return DisplayType(identifier: DisplayTypeDefinition.slot234.identifier(), display:
    DisplayTypeDefinition.slot234.displayName())
    }
    }

    View full-size slide

  59. 8JEHFU͔ΒઃఆΛ࢖͏ᶃ

    View full-size slide

  60. 8JEHFU͔ΒઃఆΛ࢖͏ᶄ

    View full-size slide

  61. struct GraphEntryView : View {
    var entry: Provider.Entry
    func displayType() -> DisplayTypeDefinition {
    let defaultValue = DisplayTypeDefinition.slot234
    let rawValue = entry.configuration.displayType?.identifier ??
    defaultValue.identifier()
    return DisplayTypeDefinition(rawValue: rawValue) ?? defaultValue
    }
    var body: some View {
    switch self.displayType() {
    case .slot234:
    return Text("ελοΫදࣔ")
    default:
    return Text("ͦͷଞ")
    }
    }
    }

    View full-size slide

  62. ΑΓৄ͘͠஌Γ͍ͨํ͸
    IUUQTJSJNBTVDPNUBHXJEHFULJU

    View full-size slide

  63. ·ͱΊ
    w ΢Οδοτػೳ͕։ൃऀͷΤαͱͯ͠࠶ొ৔͠·ͨ͠
    w "QQMF͕࢖ͬͯ΄͍ٕ͠ज़͸4XJGU6*$VTUPN*OUFOUTͰ͢
    w $VTUPN*OUFOTΛऔΓѻ͏ͨΊʹ͸׳Ε͕ඞཁͰ͢
    w ͨͩ͠8JEHFUΛ࡞Δػձ͸ࠓͷͱ͜Ζͳ͍Ͱ͢

    View full-size slide

  64. IUUQTJSJNBTVDPN
    <13>#MPHਵ࣌౤ߘத

    View full-size slide