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
570
つまづいた時のデバッグ術 / yumemi-swift-how-to-debug
IshibaSeiko
May 15, 2020
Tweet
Share
Other Decks in Programming
See All in Programming
概念モデル→論理モデルで気をつけていること
sunnyone
1
110
奥深くて厄介な「改行」と仲良くなる20分
oguemon
1
520
はじめてのMaterial3 Expressive
ym223
2
330
Navigating Dependency Injection with Metro
zacsweers
3
260
モバイルアプリからWebへの横展開を加速した話_Claude_Code_実践術.pdf
kazuyasakamoto
0
320
Navigation 2 を 3 に移行する(予定)ためにやったこと
yokomii
0
180
Deep Dive into Kotlin Flow
jmatsu
1
330
Cache Me If You Can
ryunen344
2
710
🔨 小さなビルドシステムを作る
momeemt
4
680
「手軽で便利」に潜む罠。 Popover API を WCAG 2.2の視点で安全に使うには
taitotnk
0
850
print("Hello, World")
eddie
2
530
HTMLの品質ってなんだっけ? “HTMLクライテリア”の設計と実践
unachang113
4
2.8k
Featured
See All Featured
A Tale of Four Properties
chriscoyier
160
23k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Embracing the Ebb and Flow
colly
87
4.8k
Why Our Code Smells
bkeepers
PRO
339
57k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Balancing Empowerment & Direction
lara
3
620
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
The Cult of Friendly URLs
andyhume
79
6.6k
The Cost Of JavaScript in 2023
addyosmani
53
8.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Building Adaptive Systems
keathley
43
2.7k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
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Λλοϓ͢Δ