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
20170613_iOSLT_UIKitにおけるViewLifecycle
Search
shtnkgm
June 13, 2017
Programming
0
70
20170613_iOSLT_UIKitにおけるViewLifecycle
shtnkgm
June 13, 2017
Tweet
Share
More Decks by shtnkgm
See All by shtnkgm
Combine入門
shtnkgm
2
250
Property Wrappers
shtnkgm
0
280
Saliency Detection
shtnkgm
0
23
パフォーマンス改善とユニットテスト
shtnkgm
4
1.5k
iOSのコードベースレイアウト
shtnkgm
2
700
20190117_iOSLT_CBLinSwift.pdf
shtnkgm
0
62
SwiftとFunctional Reactive Programming
shtnkgm
0
140
20180710_iOSLT_iOSでDarkModeを実装する
shtnkgm
0
62
20180410_iOSLT_SwiftとProtocol-OrientedProgramming
shtnkgm
0
81
Other Decks in Programming
See All in Programming
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
Better Code Design in PHP
afilina
PRO
0
120
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1k
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
Remix on Hono on Cloudflare Workers
yusukebe
1
280
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
120
Featured
See All Featured
Speed Design
sergeychernyshev
24
610
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
Fireside Chat
paigeccino
34
3k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Adopting Sorbet at Scale
ufuk
73
9.1k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Designing the Hi-DPI Web
ddemaree
280
34k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Done Done
chrislema
181
16k
Transcript
6*,JUʹ͓͚Δ 7JFX-JGFDZDMF 4IPUB/BLBHBNJ!TIUOLHN
6*࣮࣌ͷΑ͋͘Δ՝ w ͳΜ͔εΫϩʔϧ͕ΧΫΧΫ͢ΔɺҾ͔͔ͬΔ w "VUP-BZPVU͕ޮ͔ͳ͍ w 7JFXͷදࣔҐஔ͕͓͔͍͠ɺදࣔ͞Εͳ͍ w ը໘දࣔ·Ͱ͕͍
Α͋͘Δσόοά w 6*ߋ৽ΛαϒεϨου͔ΒϝΠϯεϨουʹมߋ ʢ௨৴ॲཧͷίʔϧόοΫ௨ͳͲʣ 㱺9DPEFͰ.BJO5ISFBE$IFDLFSͰ νΣοΫՄ w Կ͔Α͘Θ͔Βͳ͍͚ͲɺMBZPVU*G/FFEFEͱ͔ॻ ͍ͨΒΔ
6*,JUͰͷ7JFXͷ දࣔॲཧʹؔ͢Δ͕ࣝඞཁ
7JFX-JGFDZDMFʹؔ͢Δϝιου VQEBUF$POTUSBJOUT*G/FFEFE TFU/FFET-BZPVU VQEBUF$POTUSBJOUT TFU/FFET6QEBUF$POTUSBJOUT MBZPVU4VCWJFXT ESBX TFU/FFET%JTQMBZ MBZPVU*G/FFEFE WJFX%JE-PBE
MPBE7JFX WJFX8JMM"QQFBS VQEBUF7JFX$POTUSBJOUT WJFX8JMM-BZPVU4VCWJFXT WJFX%JE-BZPVU4VCWJFXT
ଟ͍ʂʘ ?P? ʗ
େ·͔ͳྲྀΕ w 7JFXͷಡΈࠐΈ w ੍ͷՃʢ"VUP-BZPVUʣ w ੍Λݩʹ7JFXͷGSBNFΛܭࢉʢϨΠΞτʣ w GSBNFͷҐஔʹඳըʢϨϯμϦϯάʣ
αϯϓϧϓϩδΣΫτ Λͭͬͯ͘ॲཧΛͬͯΈΔ IUUQTHJUIVCDPNTIUOLHN7JFX-JGFDZDMF4BNQMF
̏ຕϏϡʔΛॏͶ͚ͨͩ ʢΧελϜ6*7JFXʣ ԼͷϏϡʔ͔Βॱʹ ɾ8IJUF7JFX ʢTFMGWJFXʣ ɾ3FE7JFX ʢ8IJUF7JFXͷTVCWJFXʣ ɾ#MVF7JFX ʢ3FE7JFXͷTVCWJFXʣ
Ϋϥε໊ͱϝιου໊Λ ֤ϝιουݺͼग़࣌͠ʹϩάग़ྗ
7JFXͷදࣔ·Ͱͷ ϩάग़ྗ݁Ռ
ඳը ϨΠΞτ ੍ߋ৽ ϏϡʔͷಡΈࠐΈ
֤ϝιουͷઆ໌ 6*7JFX
੍ͷߋ৽ʹؔ͢Δϝιου w VQEBUF$POTUSBJOUT ੍ͷߋ৽Λ࣮ߦ ։ൃऀ͕ݺͼग़͢ͷ/( w TFU/FFET6QEBUF$POTUSBJOUT ੍ߋ৽ͷ࣮ߦཁ൱ͷϑϥάΛཱͯΔ
ܭࢉ࣮ߦλΠϛϯάγεςϜͤ w VQEBUF$POTUSBJOUT*G/FFEFE ੍ߋ৽Λଈ࠲ʹ࣮ߦʢߋ৽ϑϥά͋Εʣ
ύϑΥʔϚϯεͷྑ͍ॱ w PWFSSJEFͨ͠VQEBUF$POTUSBJOUT Ͱ੍ߋ৽ ʢϨΠΞτΤϯδϯͷόονॲཧʹؚ·Εɺϝ ΠϯεϨουΛϒϩοΫ͠ͳ͍ʣ w ੍ߋ৽ޙʹTFU/FFET6QEBUF$POTUSBJOUT ʢΤϯδϯ͕·ͱΊͯߋ৽ॲཧΛ࣮ࢪʣ
w ੍ߋ৽ޙʹVQEBUF$POTUSBJOUT*G/FFEFE ʢଈ࣮࣌ߦͷͨΊɺόονॲཧʹؚ·Εͳ͍ʣ
ϨΠΞτʹؔ͢Δϝιου w MBZPVU4VCWJFXT GSBNFͷߋ৽Λ࣮ߦ ։ൃऀ͕ݺͼग़͢ͷ/( w TFU/FFET-BZPVU GSBNFߋ৽ཁ൱ͷϑϥάΛཱͯΔ
ܭࢉ࣮ߦλΠϛϯάγεςϜͤ w MBZPVU*G/FFEFE GSBNFߋ৽Λଈ࠲ʹ࣮ߦʢߋ৽ϑϥά͋Εʣ
ύϑΥʔϚϯεͷྑ͍ॱ w PWFSSJEFͨ͠MBZPVU4VCWJFXT ͰGSBNFߋ৽ ʢϨΠΞτΤϯδϯͷόονॲཧʹؚ·Εɺ ϝΠϯεϨουΛϒϩοΫ͠ͳ͍ʣ w GSBNFߋ৽ޙʹTFU/FFET-BZPVU ʢΤϯδϯ͕·ͱΊͯߋ৽ॲཧΛ࣮ࢪʣ
w GSBNFߋ৽ޙʹMBZPVU*G/FFEFE ʢଈ࣮࣌ߦͷͨΊɺόονॲཧʹؚ·Εͳ͍ʣ
ඳըʹؔ͢Δϝιου w ESBX ։ൃऀ͕ݺͼग़͍͚ͯ͠ͳ͍ $PSF(SBQIJDTΛͬͯը໘ʹඳը͢Δ w TFU/FFET%JTQMBZ ඳըߋ৽ͷ࣮ߦཁ൱ͷϑϥάΛཱͯΔ
w ੍ϨΠΞτߋ৽ͷΑ͏ʹɺ ଈ࣮࣌ߦ༻ͷϝιουͳ͠
Ϗϡʔ֊ͱ࣮ߦॱং w ੍ࢠ7JFX͔Β w ϨΠΞτ7JFX͔ Β
͜͜·Ͱͷ·ͱΊʢ7JFXʣ w ੍ VQEBUF$POTUSBJOUT ύϑΥʔϚϯε͕ඞཁͳ߹ͳͲʹPWFSSJEF͢Δ TFU/FFET6QEBUF$POTUSBJOUT ߋ৽ϑϥά VQEBUF$POTUSBJOUT*G/FFEFE ଈ࣌ߋ৽ w
ϨΠΞτ MBZPVU4VCWJFXT ύϑΥʔϚϯε͕ඞཁͳ߹ͳͲʹPWFSSJEF͢Δ TFU/FFET-BZPVU ߋ৽ϑϥά MBZPVU*G/FFEFE ଈ࣌ߋ৽ w ඳը ESBX ύϑΥʔϚϯε͕ඞཁͳ߹ͳͲʹPWFSSJEF͢Δ TFU/FFET%JTQMBZ ߋ৽ϑϥά
֤ϝιουͷઆ໌ 6*7JFX$POUSPMMFS
MPBE7JFX w ཧ͢Δ7JFXΛಡΈࠐΉʢTFMGWJFXʣ w 4UPSZ#PBSEͰ࣮͢Δ߹PWFSSJEFෆཁ
WJFX%JE-PBE w MPBE7JFX ͕ྃͨ͠ࡍʹݺΕΔ w 7$ͷදࣔαΠΫϧͰҰ͚ͩݺΕΔͨΊɺ ΫϥεͰར༻͢ΔΦϒδΣΫτͷॳظԽͳͲʹద͢Δ
WJFX8JMM"QQFS w Ϗϡʔ͕දࣔ͞ΕΔલʹݺΕΔ w ॳճදࣔҎ֎ʹόοΫάϥϯυ෮ؼɺλϒ Γସ͑ͳͲ
VQEBUF7JFX$POTUSBJOUT w αϒϏϡʔͷ੍ߋ৽ޙɺTFMGWJFXͷ੍ߋ৽ ͕ඞཁͳࡍʹݺΕΔ w TFMGWJFXͷVQEBUF$POTUSBJOUT ͕ݺΕΔ w PWFSSJEFͰͷར༻༻్͋·Γͳ͠ʁ
WJFX8JMM-BZPVU4VCWJFXT w ϏϡʔͷϨΠΞτΛ։࢝͢ΔલʹݺΕΔ ʢॳظදࣔ࣌ը໘ճస࣌ͳͲʣ w ϏϡʔͷMBZPVU4VCWJFX ͕࣮ߦ͞ΕΔ
WJFX%JE-BZPVU4VCWJFXT w ϏϡʔͷϨΠΞτ͕ྃͨ͠ࡍʹݺΕΔ ʢෳճݺΕΔͷͰɺΦϒδΣΫτͷॳظԽͳͲ ʹ͔ͳ͍ʣ w TFMGWJFXGSBNF͜ͷϝιουΑΓલͩͱ֬ఆ͠ ͍ͯͳ͍ w WJFX%JE-PBE
ͳͲͰTFMGWJFXGSBNFΛ༻͍ͯϨΠ Ξτ͢Δͱҙਤ͢ΔϨΠΞτͱͳΒͳ͍Մೳੑ ͋Γ
WJFX%JE"QQFS w Ϗϡʔ͕දࣔ͞ΕͨޙʹݺΕΔ w WJFX8JMM"QQFS ಉ༷ɺόοΫάϥϯυ෮ؼ࣌ λϒΓସ͑࣌ͳͲෳճݺΕΔ w طʹ6*ද͕͍ࣔྃͯ͠ΔͷͰɺ6*දࣔʹؔ ͷͳ͍ॲཧΛ࣮ߦ͢Δͷʹద͢Δʢϩάૹ৴ͳ
Ͳʣ
͜͜·Ͱͷ·ͱΊʢ7$ʣ w WJFX%JE-BZPVU4VCWJFXT ͷ࣮ߦ·ͰGSBNF ͕֬ఆ͍ͯ͠ͳ͍ͨΊɺҙ͕ඞཁ w WJFX͕දࣔ͞ΕΔɺWJFX%JE"QQFS ͷ࣮ߦ·Ͱ 6*ؔ࿈Ҏ֎Ͱͷίετͷ͔͔ΔॲཧͳΔ ͘͠ͳ͍
"QQFOEJY
2੍Λߋ৽ͨ͠ΒͲ͏ͳΔʁ w ͍Ϗϡʔͱ੨͍Ϗϡʔͷ੍Λߋ৽ w ؔ࿈͢ΔϏϡʔͷTFU/FFET-BZPVU͕ݺΕΔ w ϑϥάཱ͕ͬͯɺMBZPVU4VCWJFXT͕ݺΕΔ ʢϨΠΞτΤϯδϯͷߋ৽λΠϛϯάʣ
2εΫϩʔϧ͕ΧΫͭ͘ w TDSPMM7JFX%JE4DSPMM ͳͲͰϨΠΞτߋ৽Λ ଈ࣮࣌ߦͯ͠ͳ͍͔νΣοΫ w ϏϡʔͷϨΠΞτௐ͕ϝΠϯεϨουΛϒ ϩοΫͯ͠͠·͍ɺεΫϩʔϧͷͨΊͷϨΠΞ τௐ͕ࢭ·͍ͬͯΔՄೳੑ͋Γ w
MBZPVU4VCWJFXT ΛPWFSSJEF͢Δͱྑ͍͔
2"VUP-BZPVUͰͷ Ξχϝʔγϣϯ͕ಈ͔ͳ͍ w GSBNFͰͷΞχϝʔγϣϯͱҧ͍ɺ ϒϩοΫ֎ʹߋ৽ॲཧΛॻ͘ ɾଈ࣌ߋ৽Λߦ͏ͨΊɺϒϩοΫͰlayoutIfNeeded()Λ ϨΠΞτΛଈ࣮࣌ߦ ʢGSBNF͕ܾఆʣ
2ίʔυͰ੍ΛՃͨ͠Βɺ ίϯϑϦΫτͨ͠ "VUP3FTJ[JOH.BTL༝དྷͷ ੍͕ࠞࡏ
w USBOTMBUFT"VUPSFTJ[JOH.BTL*OUP$POTUSBJOUT ΛແޮԽ w σϑΥϧτͰઃఆ͞ΕΔ"VUPSFTJ[JOHΛ "VUP-BZPVUͷ੍ʹม͠ͳ͍ઃఆ
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠