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
Debugging To The Gate
Search
freddi(Yuki Aki)
May 15, 2020
Technology
0
370
Debugging To The Gate
at YUMEMI.swift #7 ~あつまれルーキーの森~
freddi(Yuki Aki)
May 15, 2020
Tweet
Share
More Decks by freddi(Yuki Aki)
See All by freddi(Yuki Aki)
輝け俺のViewController 〜海外iOSカンファレンス登壇編〜
freddi
4
190
Deep Dive into "any" and "some"
freddi
3
1.3k
挑戦!ISUCON de Server-side Swift 〜タイムゾーンには気をつけろ〜
freddi
0
1.3k
意外と知られてないXcode13の新しい参照カウンタ最適化オプションの挙動
freddi
2
97
How to develop SIL Optimizer in Swift Language
freddi
0
280
SwiftコンパイラがSwiftで開発できるようになる話
freddi
3
550
知ろう! ShazamKit
freddi
1
160
Swift Optimizing at Compiler World
freddi
1
730
Recap Pointfree Vol. 1~3
freddi
1
760
Other Decks in Technology
See All in Technology
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.4k
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
1.1k
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
870
強いチームと開発生産性
onk
PRO
34
11k
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
0
110
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
110
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
340
The Rise of LLMOps
asei
7
1.6k
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
370
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Gamification - CAS2011
davidbonilla
80
5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
890
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Docker and Python
trallard
40
3.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
96
KATA
mclloyd
29
14k
Transcript
YUMEMI.swift #7 - 15th/May/2020 Debugging To The Gate! freddi (@_
_ _freddi _ _ _) from LINE Fukuoka
ϫΠʹ͍ͭͯ • freddi (@_ _ _freddi _ _ _) •
৽ଔ̎@ LINE Fukuoka • try! Swift ͱ͔ొஃͨ͠ • Tokyo, NYC 2019
λΠτϧʹ͍ͭͯ • STEINS; GATEͱ͍͏ΞχϝͷओՎ͕ݩωλ • ຊओਓެͷཱͪճΓΛΈͯσόοάज़Λ ֶͿͩͬͨ • ͕ɺωλόϨʹͳΔͷͰͦͷ෦ׂѪ •
Կલใͳ͠ʹݟΔͷ͕໘നϙΠϯτ
͜ͷτʔΫͷझࢫ • σόοάͰͷߟ͑ํɾඞཁͳ͜ͱΛʹ͚ͭΔ • ຊʹ৽ਓ͚
ͷྲྀΕ • ͍͔ͭ͘ͷʮΑ͋͘ΔσόοάͷέʔεʯΛհ • ͦͷ࣌ͷͷߟ͑ͨྫΛܰ͘հ • ཱͭπʔϧͱ͔հ • ݁ہσόοάͬͯͳʹʁ
σόοάͱ
σόοάͱ • ίϯϐϡʔλϓϩάϥϜͷόάɾܽؕΛൃݟ͓ Αͼमਖ਼͠ɺಈ࡞Λ༷௨Γͷͷͱ͢ΔͨΊ ͷ࡞ۀͰ͋Δ • By σόοά - Wikipedia
• De “Bug”
ͲΜͳσόοάͷέʔε͕͋Δͷ͔ ※ ͍͍ͩͨͷܦݧྫ
ʮ͔͚ͯ͠·͏ʯίʔυ
ʮ͔͚ͯ͠·͏ʯίʔυ • ʮॻ͘ʯͱʮܽ͘ʯͷμϒϧϛʔχϯά • Swiftͷศརͳॻ͖ํ͕ىҼ͢Δόά • ৽ػೳΛ࣮͢Δࡍʹؒҧͬͯফͨ͠ίʔυ • ίϯύΠϧɾϏϧυ͕௨ͬͯ͠·͏
ʮ͔͚ͯ͠·͏ʯίʔυʢྫʣ • ͜ͷΫϥογϡόάॻ͖ํʹىҼ static func showDialog(on viewController: UIViewController) { let
viewController = DialogViewController() viewController.present(viewController, animated: true) }
͜͏͍͏ͱ͖ͷσόοά • Ϋϥογϡ෦ΛաڈͷίʔυͱൺֱΛ͢Δ • ϓϩδΣΫτʹתೳʹͳͬͯΔͱͳ͓ྑ͍ • ม໊ͷ͍ํʹؾΛ͚ͭͯΈΔ • ׂΛߟ໊ྀͨ͠લΛ͚ͭΔ •
viewController => dialogViewController
ݪҼͱτϦΨʔ͕ಉ͡Ͱ͋ΔͱݶΒͳ͍
None
͜ͷهࣄͷ໘ന͍ϙΠϯτ • ۮવʮൃ۷ʯ͞Εͨόά • ϑΥʔΧεͯ͠Δػೳͱҧ͏ͷͰղ໌͕ࠔ • ݪҼͱʮ࠶ݱํ๏ʯͷؔ࿈ੑ͕࠷ॳݟ͑ͳ͍
࣮ࡍʹ͋ͬͨͭʢྫʣ • ຖόʔδϣϯΞοϓޙʹىಈ࣌ͷΫϥογϡ • ى͖ͳ͍߹͕ଟ͔ͬͨͬΆ͍ • ͋Δόʔδϣϯ͔ΒϦϦʔε͢Δͨͼʹ … • खݩͰ࠶ݱෆՄ
• ώϯτΫϥογϡղੳπʔϧͷϩάͷΈ
͜͏͍͏ͱ͖ͷσόοά • Ͱ͖ΔݶΓελοΫτϨʔεΛಡΉ • ϥΠϒϥϦͷίʔυ·ͰͨͲͬͯݪҼղ໌ • ߟ͑ΒΕΔͯ͢ͷέʔεΛચ͍ग़͢ • Ϋϥογϡݩͷؔ࿈ॲཧશ෦
ݪҼ • ΞϓϦͷΞοϓσʔτޙ • DBͷϚΠάϨʔγϣϯ͕ඞਢ • ϚΠάϨʔγϣϯલʹDBͷΞΫηε͕ൃՐ • σʔλͷෆ߹͕ى͖ͯΫϥογϡ͢Δ
ݪҼ • ͋Δόʔδϣϯ͔Β… • ىಈ࣌ʹσʔλΛऔಘ͢Δॲཧೖ • ऴྃ࣌ʹDBʹσʔλೖΕͯͨ • ͨ·ʹϚΠάϨʔγϣϯ͕͘ͳͬͯ
ରॲ • ελοΫτϨʔεͨͲͬͨΒDBΞΫηεͩͬͨ • ॳճىಈ࣌ͷDBͷॲཧચ͍ग़͠ • ॳճىಈ࣌ͷDBΞΫηεͷϦϑΝΫλ • ϚΠάϨʔγϣϯऴྃ࣌ʹΞΫηε͢Δ •
DBΞΫηεॲཧͷݟ௨͠Λྑ͘͢Δ
ʮͰ͖Δʯ͕ʮ͍͍ͯΔʯͱݶΒͳ͍
Ͱ͖Δίʔυͷؒҧ͍ͬͨํ • ͦΕͳΓʹհͳͭ • Ͱ͖Δ͔Βͱ͍ͬͯɺ͍͋ͬͯΔͱݶΒͳ͍ • ʮͰ͖ΔʯόΠΞε͕͔͔ͬͯ͠·͏ • όΠΞεͰɺࠜຊతͳݪҼΈͳͤͳ͍
࣮ࡍʹ͋ͬͨͭʢྫʣ • UIPageViewControllerͷϖʔδભҠ࣌ͷॲཧ extension PageViewController : UIPageViewControllerDataSource { func pageViewController(…,
viewControllerBeforeViewController … { ... callWhenPageChanged() // ϖʔδ͕มΘͬͨΒݺͼ͍ͨॲཧ ... /*Կ͔͠ΒͷViewControllerΛreturn͢Δॲཧ*/ }
࣮ࡍʹ͋ͬͨͭʢྫʣ • લͷίʔυؒҧ͍ • ͔ͨ͠ʹϖʔδભҠ࣌ʹݺΕΔ • ͕ɺॲཧͷ߹্ෳճݺΕͯ͠·͏ • ͨ·ʹ͜ΕΛॻ͍ͯΔղઆαΠτ͕͋Δ •
ղઆαΠτόΠΞεʹҙ
ݪҼ • UIPageViewControllerDataSource • ϖʔδભҠͷڍಈͷDelegate͡Όͳ͍ • UIPageViewControllerDelegate Λ͓͏
͜͏͍͏ͱ͖ͷσόοά • AppleͷެࣜͷϦϑΝϨϯεΛͳΔ͘ಡ͏ • ୈ̍ʹΑΉ͖ղઆαΠτͰ͢ • ผͷղઆαΠτͰಘͨ༰ˢͰΈͯΈΔ
Ͱ͖Δίʔυͷؒҧ͍ͬͨํʢྫʣ • ਖ਼ղྫͷίʔυ͕ͪ͜Β extension PageViewController: UIPageViewControllerDelegate { // δΣενϟʔʹΑΔભҠ͕ऴΘͬͨ߹ʹݺΕΔ func
pageViewController(… previousViewControllers: [UIViewController], transitionCompleted: Bool) { ... callWhenPageChanged() // ϖʔδ͕มΘͬͨΒݺͼ͍ͨॲཧ
πʔϧΛ͍͜ͳͦ͏
ਓతϨϏϡʔͷݶք • ਓؒෆ҆ఆʢਅཧʣ • ͦΜͳਓ͕ؒϨϏϡʔͯ͠વ͍͔ͭϛεΔ • ͳΒ͑ΔπʔϧΛ͓͏ɾ͓ͬͯ͜͏
ͨ͘͞Μͷπʔϧ • πʔϧ͍͜ͳͤΔ΄ͲΑ͍ • όάΛݟ͚ͭΔͨΊͷثʹͳΔ • ࣗͰπʔϧΛ࡞Δͷྑ͍ • πʔϧΛ࡞ͬͨͷಉ͡ʹૺͬͨਓؒ
LLDB • ϒϨʔΫϙΠϯτઃఆ͢Δͱ͖ʹͰͯ͘ΔίϨ
LLDB • ͔͜͜Βݱࡏࢭ·͍ͬͯΔॴͷใ͕औΕΔ • po hoge ← มhogeʹத͕ϩά͞ΕΔ
LLDB • LLDB Code Injection • ίʔυΛೖ༷ͯ͠ʑͳঢ়ଶΛఆͰ͖Δ • https://youtu.be/lm4sEcMxua0
Network Link Conditioner • ిͷѱ͍ঢ়گͱ͔࠶ݱͰ͖Δ • https://dev.classmethod.jp/articles/network- link-conditioner/ • ͖ͬ͞ͷDBͷରॲͷͱ͖ʹཱͬͨ
XCTAssertNoLeak • ϝϞϦϦʔΫൃͱ͔ͷݪҼʹͳΔ • ϝϞϦϦʔΫΛςετͰݟ͚ͭΔ͜ͱ͕Ͱ͖Δ • ϨϏϡʔͰͷݟམͱ͠ΛΧόʔ • https://techlife.cookpad.com/entry/ 2020/03/03/115000
Gedatsu • Auto LayoutͷΤϥʔը໘ભҠΛ͘͢Δ • Auto LayoutͷΤϥʔݟʹ͍͘ɾɾɾ • ͜ͷΤϥʔϩάΛGedatsuݟ͘͢͢Δ •
https://bannzai.hatenadiary.jp/entry/ 2020/05/08/091825
Gedatsu
όάӅͣ͞ʹใࠂɾमਖ਼͢Δ
ʮζϧΛ͢ΔͳʯɺͰͳ͘ɾɾɾ • ζϧΛ͠ͳ͍ͷͰͳ͍ʢਓͱͯ͠વʣ • OSSͷόάͳΒ Issue Λཱͯͯใࠂ͠Α͏ • ੈքͷ୭͔ͦΕʹࠔ͍ͬͯ·͢ •
͡Όͳ͍ͱɺ͍ͭ·ͰͨͬͯΓ·ͤΜ
ҙ֎ͱOSS׆ಈͷۙಓʹͳΔ • OSS ׆ಈܨ͕Δ • େʹमਖ਼ύονͱ͔ग़ͯ͠ΈΔ • ୭͔ΒධՁ͞ΕΔߦಈͰ͢ʂ • ΤϯδχΞͱͯ͠ͷܦݧΞοϓ
ͷྫ • OSSʹཉ͍͠ػೳΛՃͨ͠
ʲେࣄʳόάͷઐՈʹͳΔ
ઐՈʹͳΔͱ • όάʹଟ͘ͿͪͨͬͯݪҼΛੳ͢Δ • ཁ͢ΔʹࢁίʔυΛॻ͍ࣦͯഊ͍ͯͩ͘͠͞ • ͦͯ͠όάΛ͍ͬͯͩ͘͞
ઐՈʹͳΔͱ • ͜ͷք۾ܦݧ໋͕Ͱ͢ • ࣌ؒͷ͞Ͱͳ͘ྔͰ͢ • ͨ͘͞Μϛε͍ͬͯͩ͘͞
Μʁ
ཁ͢Δʹσόοάͬͯܦݧ͡ΌͶʁ
ܦݧ্͍͛ͯ͜͏ • ͍͍ͩͨଠࣈʹͳ͍ͬͯΔͭܦݧ͕ؔ࿈ • πʔϧΛͨ͘͞Μ͍ͬͯΔ͔ • ϦϑΝϨϯεΛͨ͘͞ΜಡΜͰΔ͔ • ͦͷόάΛ͍ͬͯΔ͔ •
ίʔυΛॻ͍ͯόάʹଟ͘ͿͪͨͬͯΔ͔
͋·ΓܦݧΛੵΉঢ়گ͕ݟ͔ͭΒͳ͍ • ࣗΒ͢͢ΜͰσόοά͢Δ͔͠ແ͍ • ͳʹ͔ͷϓϩδΣΫτʹ͍ΔͳΒɾɾɾ • όάͷνέοτʢҊ݅ʣΛࣗओతʹΖ͏ • OSSͰ͍͍Ͱ͢
·ͱΊ
·ͱΊ • ཁ͢Δʹσόοάܦݧ͕ੜ͖ΔͷͰؤுΖ͏ • ࢁίʔυॻ͍ͯόάͷઐՈʹͳΔ • πʔϧ͑Δ͚͓ͩͬͯ͘ etc…
ࢀߟจݙʢ֤ϖʔδʹࡌͤͯͳ͍ͭʣ • iOSDC Japan 2019: ςετέʔεͰ Ambiguous Layout Λൃݟ͢Δ •
https://youtu.be/RMicLhmPY84
ࢀߟจݙʢ֤ϖʔδʹࡌͤͯͳ͍ͭʣ • όχϥͷΞΠεΛങͬͨͱ͖͚ͩंͷΤϯδϯ ͕͔͔Βͳ͘ͳΔෆࢥٞͳݱɺͦͷݪҼʁ • https://gigazine.net/news/20200511-vanilla- ice-allergic-car/
એ
try! Swift WorldͷΠϯετϥΫλʔͰ͢