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
アッテiOSの設計と開発フローの変遷
Search
Yosuke Ishikawa
April 19, 2016
9
13k
アッテiOSの設計と開発フローの変遷
Yosuke Ishikawa
April 19, 2016
Tweet
Share
More Decks by Yosuke Ishikawa
See All by Yosuke Ishikawa
Achieving Testability in Presentation Layer
ishkawa
4
3.6k
Introducing Wire: Dependency Injection by Code Generator
ishkawa
12
1.2k
Declarative UICollectionView
ishkawa
28
7.7k
Nuxt.jsが掲げる"Universal Vue.js Applications"とは何者か
ishkawa
10
2.6k
Static Dependency Injection by Code Generation
ishkawa
15
6.1k
実践クライアントサイドSwift
ishkawa
24
4.1k
JSON-RPC on APIKit
ishkawa
5
52k
RxSwiftは開発をどう変えたか?
ishkawa
12
3.7k
Swift + JSON-RPC
ishkawa
0
49k
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Done Done
chrislema
181
16k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Adopting Sorbet at Scale
ufuk
73
9.1k
Designing for humans not robots
tammielis
250
25k
Side Projects
sachag
452
42k
Why Our Code Smells
bkeepers
PRO
335
57k
Scaling GitHub
holman
458
140k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Transcript
ΞοςJ04ͷઃܭͱ ։ൃϑϩʔͷมભ 2016/04/18
ࣗݾհ 2 ੴ ༸ࢿ (ishkawa) • 20162݄ೖࣾͷiOSΤϯδχΞ • ΧϠοΫ →
LINE → ικ • ઃܭΛߟ͑Δͷ͕͖
INDEX 1. ಉ͡ߏͷ࣮ͷҰݩԽ 2. Ωϟογϡઓུ 3. σϓϩΠ
ಉ͡ߏͷ࣮ͷҰݩԽ
Α͋͘Δಉ͡ߏ 5 1. ϖʔδωʔγϣϯ 2. ϑΥʔϜͷόϦσʔγϣϯ
“ಉ͡ߏ”Λ୲͢ΔͷViewModel 6 6*7JFX$POUSPMMFS 6*7JFX "1*$MJFOU 6*Πϕϯτ ϦΫΤετ Ϩεϙϯε View ViewModel
Model 7JFX.PEFM දࣔ
ϖʔδωʔγϣϯ͕ඞཁͳՕॴ 7 1. λΠϜϥΠϯ 2. ͍͍ͶϦετ 3. ϝοηʔδ 4. ௨
5. ίϝϯτ
ϖʔδωʔγϣϯ͕ඞཁͳՕॴ 8 5JNFMJOF 7JFX$POUSPMMFS "1*$MJFOU 5JNFMJOF 7JFX.PEFM -JLFE0⒎FST 7JFX$POUSPMMFS -JLFE0⒎FST
7JFX.PEFM .FTTBHFT 7JFX$POUSPMMFS .FTTBHFT 7JFX.PEFM /PUJpDBUJPOT 7JFX$POUSPMMFS /PUJpDBUJPOT 7JFX.PEFM $PNNFOUT 7JFX$POUSPMMFS $PNNFOUT 7JFX.PEFM
ϖʔδωʔγϣϯ͕ඞཁͳՕॴ 9 5JNFMJOF 7JFX$POUSPMMFS "1*$MJFOU 1BHJOBUJPO 7JFX.PEFM&MFNFOU -JLFE0⒎FST 7JFX$POUSPMMFS .FTTBHFT
7JFX$POUSPMMFS /PUJpDBUJPOT 7JFX$POUSPMMFS $PNNFOUT 7JFX$POUSPMMFS
ԿΛύϥϝʔλʔԽ͢Δ͔ʁ 10 class PaginationViewModel<Element> { ... func bindRequest<Request: PaginationRequestType where
Request.Response.Element == Element>(baseRequest: Request) { ... } } • ϖʔδωʔγϣϯͷΤϨϝϯτ(Message, NotificationͳͲ) • ϖʔδωʔγϣϯͷͨΊͷϦΫΤετ
Ͳ͏࣮͢Δʁ 11 protocol PaginationRequestType: AtteRequestType { associatedtype Response: PaginationResponseType var
page: Int64 { get } } protocol PaginationResponseType { associatedtype Element var elements: [Element] { get } var hasNextPage: Bool { get } } • ϓϩτίϧͰ࣮ͷͨΊͷΛ༻ҙ • ϓϩτίϧͰఆٛͨ͠ΠϯλʔϑΣʔε͚ͩͰ࣮
ϖʔδωʔγϣϯ͕ඞཁͳՕॴ 12 5JNFMJOF 7JFX$POUSPMMFS "1*$MJFOU 1BHJOBUJPO 7JFX.PEFM&MFNFOU -JLFE0⒎FST 7JFX$POUSPMMFS .FTTBHFT
7JFX$POUSPMMFS /PUJpDBUJPOT 7JFX$POUSPMMFS $PNNFOUT 7JFX$POUSPMMFS
࣮ͷҰݩԽͰಘͨͷ 13 • ߴ • ҆શ
Ωϟογϡઓུͷมભ
ॳͷΩϟογϡઓུ 15 • RealmͰΩϟογϡΛऔΔ • ϨεϙϯεRealmͷObjectͱͯ͠දݱ
ॳͷΩϟογϡઓུͷ 16 Կ͔RealmͷObjectʹͳͬͯ͠·͏ͧ... • Կ͕ӬଓԽ͞Ε͍ͯΔͷ͔ܕ͔ΒผͰ͖ͳ͍ • আϙϦγʔ͕ෳࡶ • ϚΠάϨʔγϣϯର͕͘ͳΔ
ͦͦRealm͕୲ͬͯͨͷʁ 17 • ϨεϙϯεͷӬଓԽ • ը໘ؒͷมߋͷڞ༗
ϨεϙϯεͷӬଓԽ 18 ࣺͯͯྑ͍ͷύʔδલఏͷػߏͰอଘ͢Δ • LRUͷσΟεΫΩϟογϡͰJSONΛอଘ • อଘ͞ΕͨJSONͱܕʹෆ߹͕͋ΕJSONΛࣺͯΕྑ͍ • আϙϦγʔɾϚΠάϨʔγϣϯͷ৺͕ͳ͘ͳͬͨ
ϨεϙϯεͷӬଓԽ 19 ϨεϙϯεΛද͢ܕͷ੍ݶ͕ͳ͘ͳͬͨ • ҎલObjectMapperΛ͍ͬͯͨ • ݱࡏHimotokiʹҠߦࡁΈ • JSONͷόϦσʔγϣϯͱܕͷΠϯελϯεԽΛҰகͤ͞ΒΕͨ •
ෆਖ਼ͳJSONʹΑΔΤϥʔΛہॴతʹཹΊΔ͜ͱ͕Ͱ͖ͨ
ը໘ؒͷมߋͷڞ༗ 20 άϩʔόϧͳSubjectͰڞ༗ • ಉظಉظ͕ಘҙͳͷʹͤΔ(RxSwift)
ͪͳΈʹ 21 RealmࠓͰͬͯ·͢
RealmͱLRUΩϟογϡͷ͍͚ 22 • αʔόʔʹಧ͍͍ͯΔσʔλ: LRUσΟεΫΩϟογϡ • αʔόʔʹಧ͍͍ͯͳ͍σʔλ: Realm
αʔόʔʹಧ͍͍ͯͳ͍σʔλ 23 1. ૹ৴தͷϝοηʔδɾίϝϯτ 2. ೖྗதͷϑΥʔϜ
Ωϟογϡʹର͢ΔϙϦγʔ 24 దࡐదॴ
ࣗಈσϓϩΠ
ࣗಈσϓϩΠͷϞνϕʔγϣϯ 26 • Pull Request͕Ϛʔδ͞ΕͨΒ୭Ͱಈ࡞֬ೝͰ͖ΔΑ͏ʹ͍ͨ͠ • QA͕ྃͨ͠Β͙͢ʹ৹ࠪʹग़ͤΔΑ͏ʹ͍ͨ͠ • ୭͔ͷڥʹґଘͤͣʹσϓϩΠͰ͖ΔΑ͏ʹ͍ͨ͠
Travis CI 27
ࣗಈσϓϩΠͷϙϦγʔ 28 • git push͞ΕͨΒΞʔΧΠϒ + σϓϩΠ • Ϗϧυ൪߸Travis CI͕ৼΔ
• खݩͰͷΞʔΧΠϒجຊతʹ͠ͳ͍
ڥ 29 %FQMPZ(BUF %FWFMPQNFOU 5FTU'MJHIU 1SPEVDUJPO
Gitϒϥϯν͝ͱͷϏϧυλεΫ 30 • feature: ςετ • master: ςετ + Development
• release: ςετ + Development + Production
Ϗϧυ࣌ؒ 31
Ϗϧυ࣌ؒ 32
Ͳ͏ͳ͔ͬͨʁ 33 • ͙͢ಈ࡞Λ֬ೝͯ͠Β͑ΔΑ͏ʹͳͬͨ • Ϗϧυ͍ͯͩͬͯ͘͠͞ݴΘΕͳ͍ • ਃָ͕ʹͳͬͨ • ୭ͰਃͰ͖ΔΑ͏ʹͳͬͨ
34 ·ͱΊ
·ͱΊ 35 • ָʹ͘։ൃͰ͖ΔΑ͏ʹઃܭΛߟ͍͑ͯΔ • ϛε͕ى͜Γ͍͢ઃܭආ͚Δ • ୭ͰؾܰʹσϓϩΠͰ͖ΔΑ͏ʹ͓ͯ͘͠ • ·ͩ·ͩൃల్্...ʂ
None