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
iOSDC 2016 talk
Search
USAMI Kosuke
August 19, 2016
Programming
3
3.2k
iOSDC 2016 talk
iOS アプリ開発の補助ツールのベストプラクティス
https://iosdc.jp/2016/c/node/40
USAMI Kosuke
August 19, 2016
Tweet
Share
More Decks by USAMI Kosuke
See All by USAMI Kosuke
Onsager代数とその周辺 / Onsager algebra tsudoi
usamik26
0
560
Apple HIG 正式名称クイズ結果発表 / HIG Quiz Result
usamik26
0
130
ゆめみ大技林製作委員会の立ち上げの話 / daigirin project
usamik26
0
290
@ViewLoadingプロパティラッパの紹介と自前で実装する方法 / @ViewLoading property wrapper implementation
usamik26
0
440
これからUICollectionViewを実践活用する人のためのガイド / Guide to UICollectionView
usamik26
1
700
Xcodeとの最近の付き合い方のはなし / Approach To Xcode
usamik26
2
630
UICollectionView Compositional Layout
usamik26
0
710
Coding Swift with Visual Studio Code and Docker
usamik26
0
470
Swift Extension for Visual Studio Code
usamik26
2
940
Other Decks in Programming
See All in Programming
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
380
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
130
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
8
1.7k
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
260
Kaigi on Railsに初参加したら、その日にLT登壇が決定した件について
tama50505
0
130
Spatial Rendering for Apple Vision Pro
warrenm
0
300
KubeCon NA 2024の全DB関連セッションを紹介
nnaka2992
0
100
Beyond ORM
77web
11
1.5k
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
160
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
210
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
230
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
130
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
We Have a Design System, Now What?
morganepeng
51
7.3k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Typedesign – Prime Four
hannesfritz
40
2.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
4 Signs Your Business is Dying
shpigford
182
21k
Facilitating Awesome Meetings
lara
50
6.2k
Done Done
chrislema
182
16k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Transcript
։ൃิॿπʔϧͷ ϕετϓϥΫςΟε Ӊࠤݟ ެี Fenrir Inc. iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) -
iOSDC 2016 1
iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 2
ิॿπʔϧͱʁ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 3
ิॿπʔϧ » ϥΠϒϥϦཧπʔϧ » ϦιʔεऔΓࠐΈπʔϧ » ίʔυνΣοΫπʔϧ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26)
- iOSDC 2016 4
ϓϥΫςΟεΛߟ͑Δ » ͨͩิॿπʔϧΛಋೖ͢ΔͷͰͳ͘ɺߟ͑Α͏ » ͦͦͳͥπʔϧΛ͏ͷ͔ʁ » ಋೖ͢ΔϝϦοτΛߟ͑Δ » Ͳ͏͍͏͍ํ͕ྑ͍ͷ͔ʁ »
ϝϦοτΛͭͿ͞ͳ͍ϓϥΫςΟεΛߟ͑Δ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 5
ϥΠϒϥϦཧ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 6
ϥΠϒϥϦཧπʔϧ » CocoaPods » Carthage » Swift Package Manager iOS
ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 7
ԿΛ͢Δπʔϧʁ » ֎෦ϥΠϒϥϦΛΞϓϦʹ؆୯ʹऔΓࠐΉ # CocoaPods ͷઃఆྫ target 'MyApp' do pod
'RxSwift', '~> 2.6.0' pod 'RxCocoa', '~> 2.6.0' end iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 8
Bad Practice πʔϧΛΘͣʹϥΠϒϥϦΛೖΕΔ » ΞϓϦຊମͱϥΠϒϥϦ͕͞Εͳ͍ » ϥΠϒϥϦͷόʔδϣϯ͕͔Βͳ͘ͳΔ » ϥΠϒϥϦΛಋೖͨ͠ਓҎ֎ʹ͔Βͳ͍ »
ϥΠϒϥϦ෦৮ͬͯͳΒ͵งғؾ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 9
Good Practice πʔϧΛͬͯϥΠϒϥϦΛೖΕΔ » ΞϓϦຊମͱϥΠϒϥϦ͕͞ΕΔ » ϥΠϒϥϦͷόʔδϣϯ͕໌֬ʹͳΔ » ϥΠϒϥϦͷՃɾߋ৽ָ͕ʹͳΔ iOS
ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 10
Bad Practice ϥΠϒϥϦΛϦϙδτϦʹೖΕͳ͍ » ֤ϏϧυڥʹϥΠϒϥϦཧπʔϧ͕ඞཁ » ϥΠϒϥϦΛऔಘ͢ΔͨΊʹπʔϧΛ࣮ߦ͢Δ » ֎෦ϦϙδτϦ͕μϯͨ͠ΒϏϧυͰ͖ͳ͍ »
πʔϧಋೖ͕ٯޮՌʹͳͬͯ͠·͏ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 11
Good Practice ϥΠϒϥϦΛϦϙδτϦʹೖΕΔ » ֤ϏϧυڥʹϥΠϒϥϦཧπʔϧ͕ෆཁ » ֎෦ϦϙδτϦʹґଘͤͣϏϧυͰ͖Δ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26)
- iOSDC 2016 12
Bad Practice ϥΠϒϥϦͷιʔεΛฤू͢Δ » πʔϧΛ͏ϝϦοτʢʹϥΠϒϥϦͷՃɾߋ৽ ָ͕ʹͳΔʣ͕ࣦΘΕΔ » ʮpod install ͠ͳ͍Ͱ͍ͩ͘͞ʯͱ͍͏ҙॻ
͖͕͋Δͱɾɾɾ » ΞϓϦͷϦϙδτϦʹϥΠϒϥϦͷฤू͕ೖΔ » ͲͷόʔδϣϯͷͲ͜Λฤू͔ͨ͠ෆ໌֬ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 13
Good Practice ϥΠϒϥϦΛ clone ͯ͠ฤू͢Δ » πʔϧΛ͏ϝϦοτͦͷ·· » ΞϓϦͱผϦϙδτϦʹϥΠϒϥϦͷฤू͕ೖΔ »
ͲͷόʔδϣϯͷͲ͜ʹΛฤू͔ͨ͠໌֬ʹͳΔ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 14
ϦιʔεऔΓࠐΈ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 15
ϦιʔεऔΓࠐΈπʔϧ » SwiftGen » R.swift » rdotm iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26)
- iOSDC 2016 16
ԿΛ͢Δπʔϧʁ » ΞϓϦͷը૾ςΩετͷѻָ͍͕ʹͳΔίʔυΛ ੜͯ͘͠ΕΔ // πʔϧͳ͠ͷ߹ let image = UIImage(named:
"banana") // SwiftGen Λͬͨ߹ let image = UIImage(asset: .Banana) iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 17
Bad Practice ςΩετΛιʔείʔυʹॻ͘ label.text = "͜Μʹͪ" » දࣔςΩετ͕Ͳ͜Ͱࢦఆ͞Ε͍ͯΔ͔͔Γʹ͍͘ » ݕࡧͮ͠Β͍
» ैͬͯɺमਖ਼ͮ͠Β͍ʢಛʹޙͰमਖ਼͢Δͱ͖ʣ » ϩʔΧϥΠζͷͱ͖ʹࠔΔ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 18
Good Practice 1 ςΩετΛ strings ϑΝΠϧʹஔ͘ label.text = NSLocalizedString("label_hello") »
දࣔςΩετ͕Ͳ͜Ͱࢦఆ͞Ε͍ͯΔ͔͔Γ͍͢ » ݕࡧ͍͢͠ » ϩʔΧϥΠζͷͱ͖ʹָʹͳΔ » ͨͩ͠ɺςΩετΛ strings ʹஔ͘ͷ͕໘ͳؾ࣋ ͪ͋Δʢ৺ཧతෛ୲ʣ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 19
Good Practice 2 ϦιʔεऔΓࠐΈπʔϧΛ͏ // SwiftGen ͷ߹ label.text = tr(.LabelHello)
» strings ͷΩʔจࣈྻͷϛε͕ͳ͘ͳΔ » ίϯύΠϧ࣌ʹνΣοΫ͞ΕΔ » ςΩετΛ strings ʹஔ͘৺ཧతෛ୲ͷܰݮ » ίʔυ͕ॻ͖͘͢ͳΔͷ͔ͩΒ͓ͬͯ͜͏ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 20
ίʔυνΣοΫ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 21
ίʔυνΣοΫπʔϧ » SwiftLint » Tailor » OCLint iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26)
- iOSDC 2016 22
ԿΛ͢Δπʔϧʁ » ·͘͠ͳ͍ίʔυΛݕग़͢Δ » ίʔυϑΥʔϚοτΛ͑Δ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC
2016 23
Bad Practice ίʔυνΣοΫΛ࣮ߦ͠ͳ͍ » ڊେͳΫϥε » ذ͕ଟ͗͢Δϝιου » ෆదͳ force
cast iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 24
Good Practice 1 ίʔυνΣοΫΛ࣮ߦ͢Δ » ·͘͠ͳ͍ίʔυ͕ػցతʹൃݟͰ͖Δ » ૣظൃݟɺૣظ࣏ྍ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε
(@usamik26) - iOSDC 2016 25
Good Practice 2 Ϗϧυ࣌ʹࣗಈతʹίʔυνΣοΫ » Build Phase ʹπʔϧ࣮ߦΛೖΕΔ » πʔϧͷ࣮ߦΛΕͣʹ͢Ή
» Warning / Error දࣔ͞ΕΔͷͰରԠָ͕ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 26
ิ طଘͷϓϩδΣΫτʹಋೖ͢Δʹ » طଘϓϩδΣΫτʹಋೖ͢ΔͱϏοΫϦ͢Δ΄Ͳଟ͘ ͷ Warning / Error ͕ग़Δ »
ͦΕͰಋೖͨ͠ํ͕͍͍ » νΣοΫϧʔϧΛܰݮͯ͠Ͱಋೖ͓ͯ͘͠ » ͍ͬͨΜಋೖͯ͠͠·͑৺ཧతෛ୲͕ܰ͘ͳΔ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 27
Bad Practice ίʔυνΣοΫͷ݁ՌΛ์ஔ͢Δ » Warning Λ์ஔ͢Δͷ͕ͨΓલʹͳΔ » ରॲ͖͢ Warning Λݟམͱ͢
iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 28
Good Practice ίʔυνΣοΫͷ݁Ռʹ͙͢ରॲ͢Δ » ৗʹ Warning Λͳ͘͢ » ରॲ͖͢ Warning
Λݟམͱ͞ͳ͍ » Warning ʹରॲ͢Δͷ͕େมͳΒɺ͍ͬͦͷ͜ͱν ΣοΫϧʔϧΛܰݮͯ͠͠·͏ » ίʔυνΣοΫΛܧଓ͢Δ΄͏͕େࣄ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 29
Bad Practice ίʔυϑΥʔϚοτΛߦΘͳ͍ » ΧοίͷҐஔͱ͔εϖʔεͷೖΕํͱ͔όϥόϥ » ϧʔϧ͕͋ͬͯकΔͷେม » ϑΥʔϚοτͷϧʔϧΛ͍֮͑ͯͳ͍ͱμϝ »
͏͔ͬΓΦϨΦϨϧʔϧͰॻ͍ͯ͠·͏ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 30
Good Practice ίʔυϑΥʔϚοτΛπʔϧͰߦ͏ » ྫɿSwiftLint ͳΒ swiftlint autocorrect » ΧοίͷҐஔͱ͔εϖʔεͷͷೖΕํͱ͔উखʹमਖ਼
͞ΕΔ » ϑΥʔϚοτͷϧʔϧΕΑ͏ » πʔϧʹͤΑ͏ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 31
·ͱΊ iOS ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 32
·ͱΊ » ͨͩπʔϧΛಋೖ͢ΔͷͰͳ͘ɺߟ͑Α͏ » ಋೖ͢ΔϝϦοτΛߟ͑Δ » ϝϦοτΛͭͿ͞ͳ͍ϓϥΫςΟεΛߟ͑Δ » ߟ͑ͨ͏͑ͰπʔϧΛೖΕΔͱָʹͳΔ iOS
ΞϓϦ։ൃͷิॿπʔϧͷϕετϓϥΫςΟε (@usamik26) - iOSDC 2016 33