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

ランタイムデバッグのススメ/iOSDC21

noppefoxwolf
September 19, 2021

 ランタイムデバッグのススメ/iOSDC21

noppefoxwolf

September 19, 2021
Tweet

More Decks by noppefoxwolf

Other Decks in Technology

Transcript

  1. 3

  2. 4

  3. 6

  4. 7

  5. ର৅ • ςελʔ • ΞϓϦΤϯδχΞ • QA୲౰ऀ • σβΠφʔ ...etc

    ※ ࣮ػσόοάΛਪ঑͢ΔηογϣϯͰ͸͋Γ·ͤΜɻ ࣮ػσόοάͤ͟Δಘͳ͍έʔεͱ͍͏લఏͰ͓ฉ͖͍ͩ͘͞ɻ 9
  6. ݕূ଎౓ͷվળ ϥϯλΠϜσόοάͷϑϩʔ 1. ίϯύΠϧ 2. సૹ 3. ؀ڥͷ֬ೝ 4. ը໘·Ͱͷૢ࡞

    5. ಈ࡞ݕূ ͜ΕΒͷͲ͜ʹͲΜͳ͕͔͔͍࣌ؒͬͯΔͷ͔Λ஌Δඞཁ͕͋Δɻ 13
  7. σόοάϝχϡʔͷ࣮૷ func onTapSettings(section: Section) { switch section { case .general:

    ... #if DEBUG // #endif·Ͱͷίʔυ͸ຊ൪ʹؚ·Εͳ͍ case .debugMenu: let vc = DebugMenuViewController() present(vc, animated: true) #endif } } #if DEBUG final class DebugMenuViewController: UITableController { ... } #endif 18
  8. 22

  9. TIPS Q. ΞϓϦΛ࠶ىಈ͢Δʹ͸ A. Shortcut.appΛ࢖͏ 1. ड͚औͬͨURLΛSafariͰ։͘γϣʔτΧοτΛ࡞੒ 2. ΞϓϦ͔Βࣗ਎ͷURLεΩʔϜΛؚΜͩγϣʔτΧοτ3Λୟ͘ 3.

    ΞϓϦΛऴྃͤ͞Δ 4. Shortcut.app͕URLεΩʔϜΛ࣮ߦ 5. ΞϓϦ͕࠶ىಈ͢Δ 3 shortcuts://run-shortcut?name=shortcutName&input=text&text=urlScheme 25
  10. import ReplayKit // ىಈ͙ͯ͢͠ʹΫϦοϓͷόοϑΝϦϯάΛ։࢝͢Δ func launched() async throws { try

    await RPScreenRecorder.shared().startClipBuffering() } ... // ҧ࿨ײΛײͨ͡Β͙͢ʹΫϦοϓΛγΣΞͯ͠΋Β͏ɻ func onTapClipShareButton() async throws { let url: URL = URL(string: "")! try await RPScreenRecorder.shared().exportClip(to: url, duration: 5) try await RPScreenRecorder.shared().stopClipBuffering() shareVideo(url) } 34
  11. import DebugMenu func applaunched() { #if DEBUG DebugMenu.install(windowScene: windowScene, items:

    [ ViewControllerDebugItem<ColorViewController>(), ClearCacheDebugItem(), UserDefaultsResetDebugItem(), CustomDebugItem() ], complication: [ CPUUsageComplication() ]) #endif } 39
  12. /* ΧελϜDebugItem */ struct CustomDebugItem: DebugItem { /// දࣔ͢ΔΞΠςϜ໊ let

    debugItemTitle: String = "Custom item" /// let action: DebugItemAction = .didSelect { from, completion in ... completion(.success()) } } 42