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

iPhone が数秒おきにクラッシュするんだけど!

Avatar for watura watura
August 25, 2024
7

iPhone が数秒おきにクラッシュするんだけど!

Slide Shareにアップロードしていたものがめちゃめちゃ文字が抜けてしまっているのでアップロードしなおしました。
---

iOSDC 2018
2017年12月2日朝起きたら,Zaim のせいでiPhoneがクラッシュすると Twitter 上で騒がれていました.
前回のリリースから多少は時間がたっていたし,そもそもアプリが iPhone をクラッシュさせるなんてできるの?
本当にZaimのせいだったのか,そもそも何が起こっていたのか.何が原因だったのか.
わかったこと,推測できたこと,喋っても問題なさそうなこと喋ります.

Avatar for watura

watura

August 25, 2024
Tweet

Transcript

  1. 2017೥12݄2೔ 06:24 τϨϯυʹͳ͍ͬͯΔ͜ͱʹؾ͕͖ͭ Slack Ͱڞ༗ 06:38 Slack νϟϯωϧΛ࡞੒ ؔ܎ऀ͕νϟϯωϧʹ௥Ճ͞ΕΔ 06:42

    Crashlytics ΛνΣοΫ͍ͯͨ͠ࢲSlackʹొ৔ 06:48 ݪҼෆ໌ͳ͕ΒखݩͰ࠶ݱ 07:40 ݪҼ൑໌
  2. ೋͭͷNoti fi cation • Push Noti fi cation • αʔό͔Β୺຤ʹରͯ͠ૹ৴

    • Local Noti fi cation ←͍͕ͭ͜൜ਓ • ৚݅Λࢦఆͯ͠ΞϓϦ͕୺຤ʹొ࿥ • ͲͪΒΛ࢖͏ʹ΋ʮ௨஌ͷڐՄʯ͕ඞཁ • Ϣʔβతʹ͸ҧ͍͕ͳ͍
  3. Ҏ߱΍ͬͨ͜ͱ • Blog, Twitter౳Ͱ͓஌Βͤ • ҰൠϢʔβ޲͚ • https://zaim.co.jp/news/archives/3333 • ٕज़ऀ޲͚

    • https://zaim.co.jp/news/archives/3337 • ͓஌Βͤϝʔϧͷૹ৴ • గਖ਼ґཔ • Zaim͕൜ਓͩʂͱݴ͍ͬͯΔΑ͏ͳͱ͜Ζ
  4. ൃݟ͞Εͨෆ۩߹Λى͜͢ίʔυ1 // 2017/12/01ͷDateComponentsΛ࡞Δ guard let date = DateComponents( calendar: Calendar(identi

    fi er: .gregorian), timeZone: TimeZone.autoupdatingCurrent, year: 2017, month: 12, day: 1).date else { return } // ຖ݄1೔ʹ࣮ߦ͞ΕΔNoti fi cationΛ࡞Δ let notify = UILocalNoti fi cation() notify.repeatInterval = .month // ຖ݄܁Γฦ͢ notify. fi reDate = date // ऴྃͣΈͷ೔෇Λࢦఆ // Noti fi cationΛొ࿥͢Δ UIApplication.shared.scheduleLocalNoti fi cation(notify) // → Ϋϥογϡϧʔϓ iOSଆͰ࣮ߦ͞ΕΔͷͰɺiOS͕Ϋϥογϡ͢Δ
  5. ൃݟ͞Εͨෆ۩߹Λى͜͢ίʔυ2 // ೔෇Λࢦఆͨ͠DateComponents࡞੒ let dateComponents = DateComponents(day: 1) // ຖ݄1೔ʹൃಈ͢ΔNoti

    fi cationͷTriggerΛ࡞੒ let trigger = UNCalendarNoti fi cationTrigger( dateMatching: dateComponents, repeats: true) // 12/01ͷ࣍ʹNoti fi cation͕ൃੜ͢Δ೔෇Λܭࢉ print(trigger.nextTriggerDate()) // → ϝϞϦΛ৯͍ͭͿ͢ ΞϓϦଆͰಈ͍͍ͯΔίʔυͳͷͰ ΞϓϦ͕Ϋϥογϡ͢Δ͚ͩ