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

WeatherKit iOS18 update - お天気の更新

notoroid
October 19, 2024

WeatherKit iOS18 update - お天気の更新

札幌iPhoneアプリ開発懇談会2024年10月19日勉強会資料

iOS18で追加されたWeatherKit の新機能のサンプルコード含む

notoroid

October 19, 2024
Tweet

More Decks by notoroid

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ w J1IPOFΞϓϦ։ൃऀ 9!OPUPSPJE  w ΞϓϦ։ൃऀྺ ʙ  w

    ΞϓϦ࡞࢛ͬͯ൒ੈل ೥౸ୡ  w झຯ͸ήʔϜ ൓ࣹਆܦ͕ਰ͑ͱ໨ͷർΕ͕ൈ͚ͳ͍
  2. 8FBUIFS,JU w J04͔Β௥Ճ͞Εͨ w 4XJGUݴޠઐ༻ 0CKFDUJWF$ඇαϙʔτ  w 3&45"1*ίʔϧʹ΋ରԠ w

    αϒεΫϦϓγϣϯαʔϏε w ຖ݄࠷େ ճ IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPOXFBUIFSLJU
  3. 8FBUIFS,JUͷ໔੹ࣄ߲ w IUUQTEFWFMPQFSBQQMFDPNTVQQPSUEPXOMPBETUFSNTBQQMF EFWFMPQFSQSPHSBN"QQMF%FWFMPQFS1SPHSBN-JDFOTF "HSFFNFOU+BQBOFTFQEG w ໔੹ࣄ߲ʹ8FBUIFS,JUͷผ߲໨͋Γ ෇ଐॻ  w

    8FBUIFS,JU"1*ͷ͍͔ͳΔ࢖༻΋ɺຊܖ໿ プ ϩ グ ϥϜཁ݅ΛؚΈ·͢ ͓ Α び ෇ଐॻ 8FBUIFS,JU"1*ͷར༻ʹؔ͢Δ෇Ճ৚݅ ͷ৚݅ʹ४ڌ͠ͳ ͚Ε ば ͳΒͳ͍΋ͷͱ͠·͢ɻ
  4. 8FBUIFS,JUͷ৽ػೳ J04ʙ w #SJOHDPOUFYUUPUPEBZ`TXFBUIFS88%$7JEFPT"QQMF%FWFMPQFS w IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXED w ݱ࣌ࠁͷఱؾ w </FX>࣌ؒ͝ͱͷมԽ

    IPVSMZ  w </FX>ఱީͷมԽ DIBOHFT  w </FX>աڈͷఱީͱͷൺֱ IJTUPSJDBM$PNQBSJTPOT  w </FX>݄ผ౷ܭ NPOUIMZ4UBUJTUJDT  w </FX>ظؒΛࢦఆͨ֓͠ཁ EBJMZ4VNNBSZ
  5. 8FBUIFS,JUͷ৽ػೳ J04ʙ w #SJOHDPOUFYUUPUPEBZ`TXFBUIFS88%$7JEFPT"QQMF%FWFMPQFS w IUUQTEFWFMPQFSBQQMFDPNWJEFPTQMBZXXED w ݱ࣌ࠁͷఱؾ w </FX>࣌ؒ͝ͱͷมԽ

    IPVSMZ  w </FX>ఱީͷมԽ DIBOHFT  w </FX>աڈͷఱީͱͷൺֱ IJTUPSJDBM$PNQBSJTPOT  w </FX>݄ผ౷ܭ NPOUIMZ4UBUJTUJDT  w </FX>ظؒΛࢦఆͨ֓͠ཁ EBJMZ4VNNBSZ ఱؾ΢ΟδοτͰͰ͖Δ͜ͱશൠ
  6. 8FBUIFS,JUͷ࢖͍ํᶄ 8FBUIFS4FSWJDFܦ༝Ͱఱؾ৘ใΛऔಘՄೳ let weatherService = WeatherService() let weather = try!

    await weatherService.weather(for: location) ݱࡏ஍Λऔಘ͢Δࡍ͸$PSF-PDBUJPOΛར༻ͯ͠ݱࡏ஍ʹΞΫηε͢Δඞཁ͋Γ
  7. 8FBUIFS,JUͷ࢖͍ํᶅ 8FBUIFS4FSWJDFܦ༝Ͱఱؾ৘ใΛऔಘՄೳ let weatherService = WeatherService() let temperatures = try!

    await weatherService.weather( for: location, including: .hourly ) ৽ػೳ͸JODMVEJOHύϥϝʔλʔͰࢦఆՄೳ
  8. ॲཧͷෳࡶ͞ΛͲͷΑ͏ʹԡ͠ࠐΊΔ͔ w ೥୅ޙ൒ w ෳࡶͳσʔλετϦʔϜΛϋϯυϦϯά͢ΔͨΊͷखஈͱͯ͠3FBDUJWF9 3Y4XJGU ͕࢖ΘΕΔ w 3FBDUJWF9͸ϒϥϯσΟϯάͱͯ͠ϦΞΫςΟϒϓϩάϥϛϯάΛ༻͍͕࣮ͨࡍ͸ͷ σʔλετϦʔϜ੍ޚͱ6*αϙʔτ

    w 3Y4XJGU͸σʔλετϦʔϜ੍ޚͷͨΊ๲େͳϘΩϟϒϥϦʔ ޠኮ ௥Ճͯ͠ରॲ w 3FBDUJWF9͸ϚϧνϓϥοτϑΥʔϜ J04 "OESPJE  w ೥લ൒ w "QQMF͕4XJGU΍4XJGU6*Λ͔ͭͬͯ؆ܿͳίʔυͱݴ͍ͬͯΔ͕গͳ͍ޠኮ BTZOD  BXBJU BDUPS ͰͷσʔλετϦʔϜ੍ޚΛߦ͍ͬͯΔ͕গͳ͍ޠኮʹଟॏͷҙຯ߹͍ Λ͍࣋ͨͤͯΔͷͰεΩϧ͕3Y4XJGUͱ͸ҟͳΔ͚ͩͰ೉қ౓͸มΘΒͳ͍͔΋ w 4XJGUͷσʔλετϦʔϜ੍ޚ͸&$."4DSJQUʹ͍͕ۙͦ͠ΕͰ΋ݽཱ͍ͯ͠Δ ΞϓϦέʔγϣϯͷύΠϓϥΠϯ ΋͘͠͸σʔλετϦʔϜ ʹ͍ͭͯ
  9. ࢀߟ w 8FBUIFS,JUc"QQMF%FWFMPQFS %PDVNFOUBUJPO w #SJOHDPOUFYUUPUPEBZ`T XFBUIFS88%$7JEFPT "QQMF%FWFMPQFS w OPUPSPJE8FBUIFS,JU5FTU

    8FBUIFS,JUTBNQMFGPSJ04 w 88%$ J048FBUIFS,JUͰ ؾ৅σʔλΛऔಘ 2JJUB&OHJOFFS'FTUB2JJUB