Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
つまづいた時のデバッグ術 / yumemi-swift-how-to-debug
Search
IshibaSeiko
May 15, 2020
Programming
1
550
つまづいた時のデバッグ術 / yumemi-swift-how-to-debug
IshibaSeiko
May 15, 2020
Tweet
Share
Other Decks in Programming
See All in Programming
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
300
Better Code Design in PHP
afilina
PRO
0
130
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
250
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.2k
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
Arm移行タイムアタック
qnighy
0
340
Quine, Polyglot, 良いコード
qnighy
4
650
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
RubyLSPのマルチバイト文字対応
notfounds
0
120
Amazon Qを使ってIaCを触ろう!
maruto
0
420
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
110
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
88
5.7k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
380
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
A Tale of Four Properties
chriscoyier
156
23k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Speed Design
sergeychernyshev
25
620
RailsConf 2023
tenderlove
29
900
Agile that works and the tools we love
rasmusluckow
327
21k
Transcript
ͭ·͍ͮͨ࣌ͷσόοάज़ w ࣗݾհ w എܠͱత w σόοάज़ w QSJOUPCKFDU w
#SFBLQPJOU "DUJPO w &YDFQUJPO#SFBLQPJOU w 7JFX%FCVH
2 ੴਗ਼ࢠ ͍͍ͤ͜͠ w J04ΤϯδχΞ w ࣮ܦݧ ݄d w
Swiftେ͖ w (JUIVC • https://github.com/IshibaSeiko w 2JJUB • https://qiita.com/seikoseikou w 5XJUUFS • @seikoseikou w #MPH • https://seikoseikou.com
3 എܠͱత wϓϩάϥϛϯά΄΅ະܦݧͰೖࣾͨͨ͠Ίɺ ʮσόοάʯΛΒͳ͔ͬͨ wϏϧυͨ͠Βɺࢥ͍ඳ͍͍ͯͨڍಈʹͳΒͳ͔ͬͨʂ wόάௐࠪΛ͞Εͨʂ w ͰɺݪҼͷௐํ͕Θ͔Βͳ͍ ϧʔΩʔୡʹɺσόοάज़Λڭ͍͑ͨʂ
4 αϯϓϧΞϓϦʹ͍ͭͯ ιʔείʔυ https://github.com/IshibaSeiko/DebugDemo ػೳ ϘλϯΛλοϓ͢Δͱɺ ৭ͷViewͱ੨৭ͷViewͷલޙ͕ΓସΘΔ ॲཧ @IBAction func
didTapSwapButton(_ sender: UIButton) { view.bringSubviewToFront(view.subviews[1]) }
5 ࠓհ͢Δσόοάज़ • print object w Λ֬ೝ͍ͨ͠ • Breakpoint +
Action w ॲཧΛ௨ΔͨͼʹΛ֬ೝ͍ͨ͠ • Exception Breakpoint w ΞϓϦΫϥογϡͷݪҼ͕Γ͍ͨ • View Debug w UI্ͷΛΓ͍ͨ
6 σόοάज़print object import UIKit class ViewController: UIViewController { override
func viewDidLoad() { super.viewDidLoad() } @IBAction func didTapSwapButton(_ sender: UIButton) { view.bringSubviewToFront(view.subviews[1]) } } ϚδοΫφϯόʔ͔ͩΒɺ ͲͷView͕औಘ͞ΕΔ͔Θ͔Βͳ͍
7 Α͋͘ΔΓํ @IBAction func viewSwapButton(_ sender: UIButton) { view.bringSubviewToFront(view.subviews[1])
print(view.subviews[1]) } • ֬ೝ͢ΔͨΊʹBuild͢Δඞཁ͕͋Δ • ػೳͱͯ͠ෆཁͳίʔυΛهड़͢Δ͜ͱͱͳΔ
8 σόοάज़print object ίϯιʔϧͰΛ֬ೝ͢Δ
9 σόοάज़print object ৭ͷView͕औಘ͞Εͨ Ͱɺຖճpo͢Δͷɺ໘ʜ ϚδοΫφϯόʔ͔ͩΒɺ ͲͷView͕औಘ͞ΕΔ͔Θ͔Βͳ͍
10 σόοάज़Breakpoint + Action BreakpointʹActionΛՃ͠ɺϩάΛදࣔ͢Δ
11 σόοάज़Breakpoint + Action Ͱɺຖճ֬ೝ͢Δͷɺ໘ʜ ࣗಈͰϩά͕දࣔ͞ΕΔΑ͏ʹͳͬͨ ࣍όάΛൃੜͯ͠ΈΑ͏
12 σόοάज़Exception Breakpoint ࣄ ϘλϯΛλοϓ͢Δͱɺ ΞϓϦ͕Ϋϥογϡ͢Δ ݪҼʜ
13 σόοάज़Exception Breakpoint AppDelegateͰΫϥογϡ͢Δͭ
14 σόοάज़Exception Breakpoint ྫ֎͕ൃੜͨ͠ՕॴͰϒϨʔΫ͢Δ
15 σόοάज़Exception Breakpoint ϘλϯΛλοϓ͢Δͱɺ ΞϓϦ͕Ϋϥογϡ͢Δ ྻʹଘࡏ͠ͳ͍σʔλΛऔಘ͠Α͏ͱ͍ͯͨ͠ ࣍όάΛൃੜͤͯ͞ΈΔ
16 σόοάज़View Debug ࣄ ϘλϯΛλοϓͰ͖ͳ͍ ݪҼʜ
17 σόοάज़View Debug Viewͷ֊Λ֬ೝ͢Δ
18 σόοάज़View Debug SwapϘλϯΑΓલ໘ʹɺ User Interaction Enabled͕Onʹͳ͍ͬͯΔView͕ ॏͳ͍ͬͯͨ ϘλϯΛλοϓͰ͖ͳ͍
19 ·ͱΊ • print object w ίϯιʔϧͰApo{֬ೝ͍ͨ͠ίʔυ}AΛೖྗ͢Δ • Breakpoint +
Action w ઃఆͨ͠BreakpointΛμϒϧλοϓͯ͠actionΛՃ͢Δ • Exception Breakpoint w Breakpoint NavigatorࠨԼͷʮ ʯ͔Β Exception BreakpointΛՃ͢Δ • View Debug w Debug View HierarchyΛλοϓ͢Δ