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
410
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
270
Deep Dive into "any" and "some"
freddi
3
1.4k
挑戦!ISUCON de Server-side Swift 〜タイムゾーンには気をつけろ〜
freddi
0
1.7k
意外と知られてないXcode13の新しい参照カウンタ最適化オプションの挙動
freddi
2
150
How to develop SIL Optimizer in Swift Language
freddi
0
350
SwiftコンパイラがSwiftで開発できるようになる話
freddi
3
640
知ろう! ShazamKit
freddi
1
210
Swift Optimizing at Compiler World
freddi
2
820
Recap Pointfree Vol. 1~3
freddi
1
820
Other Decks in Technology
See All in Technology
Amazon Bedrock AgentCore でプロモーション用動画生成エージェントを開発する
nasuvitz
6
410
EKS Pod Identity における推移的な session tags
z63d
1
200
制約理論(ToC)入門
recruitengineers
PRO
2
200
マイクロモビリティシェアサービスを支える プラットフォームアーキテクチャ
grimoh
1
190
LLMエージェント時代に適応した開発フロー
hiragram
1
400
ECS モニタリング手法大整理
yendoooo
1
120
Evolution on AI Agent and Beyond - AGI への道のりと、シンギュラリティの3つのシナリオ
masayamoriofficial
0
160
GitHub Copilot coding agent を推したい / AIDD Nagoya #1
tnir
2
4.4k
浸透しなさいRFC 5322&7208
hinono
0
110
AIが住民向けコンシェルジュに?Amazon Connectと生成AIで実現する自治体AIエージェント!
yuyeah
0
260
Go で言うところのアレは TypeScript で言うとコレ / Kyoto.なんか #7
susisu
3
910
Goss: New Production-Ready Go Binding for Faiss #coefl_go_jp
bengo4com
0
1.1k
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
Into the Great Unknown - MozCon
thekraken
40
2k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
How STYLIGHT went responsive
nonsquared
100
5.7k
It's Worth the Effort
3n
187
28k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
We Have a Design System, Now What?
morganepeng
53
7.7k
The Pragmatic Product Professional
lauravandoore
36
6.8k
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ͷΠϯετϥΫλʔͰ͢