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
Engineer Career Talk
lycorp_recruit_jp
0
200
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.8k
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
180
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
39
13k
10XにおけるData Contractの導入について: Data Contract事例共有会
10xinc
7
720
SkiaとImpellerについて
moriya0130
0
140
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
130
SAP Community and Developer Update
sygyzmundovych
0
350
OCI Security サービス 概要
oracle4engineer
PRO
0
6.6k
LINEヤフーにおけるPrerender技術の導入とその効果
narirou
1
420
FlutterアプリにおけるSLI/SLOを用いたユーザー体験の可視化と計測基盤構築
ostk0069
0
170
プロダクト活用度で見えた真実 ホリゾンタルSaaSでの顧客解像度の高め方
tadaken3
0
260
Featured
See All Featured
Bash Introduction
62gerente
608
210k
Faster Mobile Websites
deanohume
305
30k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
It's Worth the Effort
3n
183
27k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Designing Experiences People Love
moore
138
23k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
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ͷΠϯετϥΫλʔͰ͢