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
560
つまづいた時のデバッグ術 / yumemi-swift-how-to-debug
IshibaSeiko
May 15, 2020
Tweet
Share
Other Decks in Programming
See All in Programming
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
0
170
DROBEの生成AI活用事例 with AWS
ippey
0
130
Grafana Loki によるサーバログのコスト削減
mot_techtalk
1
110
ASP. NET CoreにおけるWebAPIの最新情報
tomokusaba
0
360
Open source software: how to live long and go far
gaelvaroquaux
0
620
データの整合性を保つ非同期処理アーキテクチャパターン / Async Architecture Patterns
mokuo
41
15k
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
1
140
iOSエンジニアから始める visionOS アプリ開発
nao_randd
3
120
sappoRo.R #12 初心者セッション
kosugitti
0
230
【PHP】破壊的バージョンアップと戦った話〜決断と説得
satoshi256kbyte
0
120
Introduction to kotlinx.rpc
arawn
0
630
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
2
490
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
The Cult of Friendly URLs
andyhume
78
6.2k
Rails Girls Zürich Keynote
gr2m
94
13k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
Optimizing for Happiness
mojombo
376
70k
Designing Experiences People Love
moore
139
23k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
Site-Speed That Sticks
csswizardry
3
370
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
29
2.2k
Adopting Sorbet at Scale
ufuk
74
9.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
20
2.4k
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Λλοϓ͢Δ