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
390
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
240
Deep Dive into "any" and "some"
freddi
3
1.4k
挑戦!ISUCON de Server-side Swift 〜タイムゾーンには気をつけろ〜
freddi
0
1.5k
意外と知られてないXcode13の新しい参照カウンタ最適化オプションの挙動
freddi
2
130
How to develop SIL Optimizer in Swift Language
freddi
0
320
SwiftコンパイラがSwiftで開発できるようになる話
freddi
3
600
知ろう! ShazamKit
freddi
1
180
Swift Optimizing at Compiler World
freddi
2
800
Recap Pointfree Vol. 1~3
freddi
1
790
Other Decks in Technology
See All in Technology
Amazon EKS Auto ModeでKubernetesの運用をシンプルにする
sshota0809
0
110
問題解決に役立つ数理工学
recruitengineers
PRO
7
2.2k
製造業の会計システムをDDDで開発した話
caddi_eng
3
980
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
20k
3/26 クラウド食堂LT #2 GenU案件を通して学んだ教訓 登壇資料
ymae
1
210
Engineering Managementのグローバルトレンド #emoasis / Engineering Management Global Trend
kyonmm
PRO
6
990
30 代子育て SRE が考える SRE ナレッジマネジメントの現在と将来
kworkdev
PRO
0
110
大規模サービスにおける カスケード障害
takumiogawa
2
260
LINEギフトのLINEミニアプリアクセシビリティ改善事例
lycorptech_jp
PRO
0
250
20250328_OpenAI製DeepResearchは既に一種のAGIだと思う話
doradora09
PRO
0
150
グループポリシー再確認
murachiakira
0
170
日本MySQLユーザ会ができるまで / making MyNA
tmtms
1
360
Featured
See All Featured
Being A Developer After 40
akosma
90
590k
Making Projects Easy
brettharned
116
6.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
What's in a price? How to price your products and services
michaelherold
245
12k
Automating Front-end Workflow
addyosmani
1369
200k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
8
700
Embracing the Ebb and Flow
colly
85
4.6k
GraphQLの誤解/rethinking-graphql
sonatard
70
10k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7.1k
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ͷΠϯετϥΫλʔͰ͢