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
コードジェネレーターの威力を見てみる
Search
hirose yudai
January 28, 2017
0
360
コードジェネレーターの威力を見てみる
https://love-swift.connpass.com/event/47486/
の談義資料です。
自作コードジェネレーターについての紹介です
hirose yudai
January 28, 2017
Tweet
Share
More Decks by hirose yudai
See All by hirose yudai
Write swift macros
bannzai
1
220
Figma => SwiftUI
bannzai
0
150
爆速でクソリプを送る技術
bannzai
1
34
Tsukimi
bannzai
0
50
iOSDC_Reject_Conference_Day1
bannzai
0
220
iOSDC-2019.pdf
bannzai
0
1.2k
ios-de-kanpai
bannzai
0
45
waiwai-swiftc.pdf
bannzai
0
110
iosdcrc-conv.pdf
bannzai
4
560
Featured
See All Featured
Thoughts on Productivity
jonyablonski
67
4.3k
What's in a price? How to price your products and services
michaelherold
243
12k
Embracing the Ebb and Flow
colly
84
4.5k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Building Adaptive Systems
keathley
38
2.3k
How GitHub (no longer) Works
holman
310
140k
Being A Developer After 40
akosma
86
590k
The Invisible Side of Design
smashingmag
298
50k
RailsConf 2023
tenderlove
29
900
Become a Pro
speakerdeck
PRO
25
5k
The Cult of Friendly URLs
andyhume
78
6k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Transcript
4XJGUѪձWPM%"/(* ίʔυδΣωϨʔλͷҖྗΛݟͯΈΔ
ࣗݾհ ໊લኍ༤େ 4XJGUѪձͰࣗ࡞044Λ࡞ͬͯհ͠ ͍ͯ·͢ɻ ໊͋ͩ4UBSޤ৯ 4UBS͍ͩ͘͞ HJUIVCIUUQHJUIVCDPNCBOO[BJ RJJUBIUUQRJJUBDPNCBOO[BJ
ຊ ࠓճࣗ࡞044ʹ͍ͭͯͷհʹͳΓ·͢ɻ ҎԼͷͭͷ044ʹ͍ͭͯ৮ΕͯͦͷಋೖϝϦοτͱ ͍ํʹ͍ͭͯൃද͍͖ͯ͠·͢ɻ IUUQTHJUIVCDPNCBOO[BJ3FTPVSDF,JU IUUQTHJUIVCDPNCBOO[BJ,VSJ ͲͪΒJ04։ൃͰඞཁͳίʔυΛੜͯ͘͠ΕΔϥΠ ϒϥϦʹͳ͍ͬͯ·͢ɻ
ελʔ͍ͩ͘͞
3FTPVSDF,JU ϓϩδΣΫτͷϦιʔεΛ҆શʹ༻͢ΔͨΊͷϥΠϒϥϦ 4UPSZCPBSE 9JC 4FHVF ʜFUD 9DPEFͷϏϧυͷͨͼʹϦιʔεΛ༻͢ΔͨΊͷϝιουΛ࡞ ͯ͘͠ΕΔ ྨࣅϥΠϒϥϦ3TXJGU IUUQTHJUIVCDPNNBDDBJO3TXJGU
Ͳ͏͍͏͜ͱ͔3&"%.&Λνϥݟ
ղܾͯ͘͠ΕΔ͜ͱ ಉ͡Α͏ͳίʔυΛॻ͔ͳͯ͘ େମॻ͍͍ͯΔ༰͕͍ͭҰॹ ϝιουͷ໋໊نଇ͑͞௫ΜͰ͠·ָ͑ ΠϯελϯεΛੜ͢Δͱ͖ʹจࣈྻͷϋʔυίʔυΛͳ͘ ͯ͘͠ΕΔ ิ͕ޮ͘ UZQPʹΑΔ3VOUJNFFSSPSΛ͙ Ϧιʔε͝ͱফͨ͠߹ؔফ͑ΔͷͰ$PNQJMFFSSPSͱͳ Γɺؾ͚ͮΔ
3TXJGUͱൺͯ Ϋϥε͕໌֬ʹΘ͔Δ A7JFX$POUSPMMFSJOJUJBM7JFX$POUSPMMFS A A3TUPSZCPBSEWJFX$POUSPMMFS*EFOUJpFS A ΫϥεϝιουͳͷͰͲͷΫϥε͔͕Θ͔Δ +VNQ͍͢͠
αϙʔτ͍ͯ͠Δ߲͕গͳ͍ $PMPS 'POUαϙʔτ͍ͯ͠ͳ͍ͷ͕͋Δ ͦͷͿΜίϯύΠϧʹ͔͔Δ͕͍࣌ؒ (FOFSBUF͢Δ߲ΛબΔ ඞཁͳϝιου͚ͩચ୕ͯ͠(FOFSBUFͰ͖Δ ͞ΒʹίϯύΠϧ࣌ؒΛ͘Ͱ͖Δ
ͪΐͬͱσϞ
ͪΐͬͱ ελʔ͍ͩ͘͞
J04ͷ $MFBO"SDIJUFDUVSF༻ͷ։ൃπʔϧ,VSJΛ ࡞ͬͨͷͰհ͠·͢ɻ ͜͜Ͱݴ͏$MFBO"SDIJUFDUVSFͪ͜ΒΛࢀߟʹͯ͠ߟ͑·͢ɻ <·ͩ.7$ .71 .77.Ͱফͯ͠ΔͷʁJ04$MFBO"SDIJUFDUVSFʹ͍ͭͯ> IUUQRJJUBDPNLPVUBMPVJUFNTBGDGBEFDED <J04$MFBO"SDIJUFDUVSFͷ͢͢Ί> IUUQTTQFBLFSEFDLDPNLPVUBMPVJPTDMFBOBSDIJUFDUVSFGBMTFTVTVNF
,VSJ
$MFBO"SDIJUFDUVSFͷಛ Λࡉ͔ͨ͘͠"SDIJUFDUVSFɻ ֤ϨΠϠʔͷׂ͕໌֬ʹͳΔɻ 1SPT ϏδωεϩδοΫ͕໌֬ʹͳΔ ϑϨʔϜϫʔΫʹґଘ͠ͳ͍ 6*ʹґଘ͠ͳ͍ %BUB4UPSFʹґଘ͠ͳ͍ ςετͷ༰қੑ $POT
ίʔυྔ͕ଟ͘ͳΔ
None
None
ͳΜ͔ྲྀߦ͍ͬͯΔ͔Βͪΐͬͱॻ͍ͯΈΑ͏ FH6TFSใ͕දࣔ͞Ε͍ͯΔը໘Λ࡞Δɻ ·ͣ"1*ܦ༝ͰใΛऔಘ GFUDI ͢Δ
TUSVDU6TFS&OUJUZʜ TUSVDU6TFS%BUB4UPSF*NQM6TFS%BUB4UPSF\ GVODGFUDI EPOF 6TFS&OUJUZ7PJE \ ʜ'FUDIGSPN8FC"1* ^ ^ TUSVDU6TFS3FQPTJUPSZ*NQM6TFS3FQPTJUPSZ\
MFUEBUB4UPSF6TFS%BUB4UPSF GVODGFUDI EPOF 6TFS&OUJUZ7PJE \ EBUB4UPSFGFUDI EPOF ^ ^ TUSVDU6TFS6TF$BTF*NQM6TFS6TF$BTF\ MFUUSBOTMBUPS6TFS5SBOTMBUPS GVODGFUDI EPOF 6TFS.PEFM7PJE \ SFQPTJUPSZGFUDI\ EPOF USBOTMBUPSUSBOTMBUF ^ ^ ^ TUSVDU6TFS.PEFMʜ TUSVDU6TFS5SBOTMBUPS*NQM6TFS5SBOTMBUPSʜ DMBTT6TFS1SFTFOUFS*NQM6TFS1SFTFOUFSʜ DMBTT6TFS7JFX$POUSPMMFS6TFS7JFXʜ
‧⛺è䡢 `Т` 䡢è⛺‧ ͏Θ͋͋͋͋͋͋͋͋͋͋͋͋͋
͠Β͘ॻ͍ͯΈͯͷؾ͖ͮ ͬͺΓॻ͘ྔ͕ଟ͍ ϑΝΠϧ͍ͬͺ͍/FX͢Δͷਏ͍ɻ ׂ͕ࡉׂ͔͘͞ΕΔ͜ͱʹΑΓಉ͡Α͏ͳॲཧΛॻ͘͜ͱ ͕ଟ͍ɻ
Presenter → DataStore·ͰEntityʹର͢Δ CRUDͷॲཧΛهड़͢Δ͜ͱ͕ଟ͍ Repository → Translator(Entity) → Model
ͪΐͬͱߟ͑ͨ ಉ͡Α͏ͳॲཧΛॻ͘͜ͱ͕ଟ͍ ˠςϯϓϨԽͯ͠ίʔυδΣωϨʔτͪ͠Ό͓͏ɻ ˠ͜ΕͰॻ͘ྔݮΔɻ ϑΝΠϧ͍ͬͺ͍/FX͢Δͷਏ͍ ˠׂ͝ͱʹϑΝΠϧΛ࡞Ζ͏ɻ ˠ͍ͭͰʹ9DPEFϓϩδΣΫτʹJNQPSU͢ΔΑ͏ʹ͠Α͏ɻ ࡞ͬͨˠ,VSJ
,VSJͷಛ ίϚϯυҰൃͰ֤ϨΠϠʔͷϑΝΠϧɾίʔυΛੜͯ͘͠ΕΔɻ͞Βʹ9DPEFϓϩ δΣΫτʹࣗಈͰNQPSU ੜ͢ΔίʔυϑΥʔϚοτʹԊͬͨςϯϓϨʔτΛ༻ҙ͢Δ͜ͱͰϓϩδΣΫτ ͷಛʹΑͬͯมߋՄೳɻ ZBNMϑΝΠϧʹ͍͔ͭ͘ઃఆ߲Λ༻ҙͯ͋͠ΓɺϓϩδΣΫτͷಛʹΑͬͯมߋ Մೳ ඞཁͳϨΠϠʔ͚ͩHFOFSBUF͢Δ͜ͱՄೳɻATPSJAৄ͘͠3&"%.&ݟͯͶ ಋೖ؆୯ ddd
CSFXUBQCBOO[BJIPNFCSFX,VSJ CSFXJOTUBMMLVSJ DE130+&$5@3005@%*3 LVSJTFUVQ MT ,VSJ5FNQMBUF,VSJZNMʜˡZBNMϑΝΠϧͱςϯϓϨʔτ͕Ͱ͖Δɻ ಋೖऴྃ ddd
ΊͬͪΌσϞ
ΊͬͪΌ ελʔ͍ͩ͘͞
ࣗͰ࡞ͬͯͬͯΈͯͷײ νʔϜ։ൃͩͱॻ͖ํͷ౷ҰΛଌΕΔ ϨϏϡʔ͍͢͠ ςϯϓϨͷΑ͏ͳॲཧΓॻ͔ͳ͍͍ͯ͘ͷָ͕ ίʔσΟϯά࣌ؒͷॖ ॻ͖ؒҧ͍͕ͳ͍ʹΑΔόάͩͬͨΓಡΈؒҧ͍ͷݮ
ऴΘΓʹ ࣮ࡍʹ৮͍͍ͬͯͨͩͯ 13 JTTVF 4UBS⭐͍͚ͨͩͨΒخ͍͠Ͱ͢ɻ 044ͳͷͰࣗͰ͖ʹ͍ͬͯ͡ಠࣗHFOFSBUFS࡞Δͷ ໘ന͍ͱࢥ͍·͢ɻ ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ