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
Swiftのクロージャーで苦労じゃ〜
Search
柿本匡章 Masaaki Kakimoto@kara_mage
July 01, 2016
Programming
1
1.1k
Swiftのクロージャーで苦労じゃ〜
Swiftのクロージャーについての説明資料です
柿本匡章 Masaaki Kakimoto@kara_mage
July 01, 2016
Tweet
Share
More Decks by 柿本匡章 Masaaki Kakimoto@kara_mage
See All by 柿本匡章 Masaaki Kakimoto@kara_mage
個人開発とANDPAD開発との相乗効果
karamage
1
160
何者にもなれなかった自分のための「個人開発のすすめ」
karamage
7
51k
Jest を使って VueコンポーネントとVuexストアの テストコードを書いてみよう!
karamage
3
1.5k
ドラクエとFFで学ぶRxSwiftのすすめ
karamage
2
640
Other Decks in Programming
See All in Programming
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
100
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.9k
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Contemporary Test Cases
maaretp
0
140
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
330
cmp.Or に感動した
otakakot
2
150
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
KATA
mclloyd
29
14k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
GitHub's CSS Performance
jonrohan
1030
460k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
89
GraphQLとの向き合い方2022年版
quramy
43
13k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
A better future with KSS
kneath
238
17k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Transcript
SwiftͷΫϩʔδϟʔͰ ۤ࿑͡Όʙ ͔Β·͛ˏ͏·͏·ͩΑΜ
ࣗݾհ ໊લɹ֟ຊڡষˏ͔Β·͛ ৬ۀɹϑϦʔϥϯεɾΤϯδχΞ WebΞϓϦiOSΞϓϦΛ࡞ΔࣄΛ͍ͯ͠·͢ɻ ग़ɹԬ Swift, Ruby,JS, AWS Lambda https://www.facebook.com/karamage.umauma
ࣗ༝ͳελΠϧͰࣄͯ͠·͢ ;;͠ͳ͕Βϓϩάϥϛϯά
Swift ͍͠ ࢛ఱԦ Ẃࠈͷ$MPTVSF మนͷHVBSE ࠞಱͷ0QUJPOBM ັͷQSPUPDPM
Ϋϩʔδϟʔͬͯ·͔͢ʁ 8JLJQFEJBΑΓ ΫϩʔδϟʢΫϩʔδϟʔɺӳDMPTVSFʣ ؔดแϓϩάϥϛϯάݴޠʹ͓͚ΔؔΦϒδΣΫτͷҰछɻ ͍͔ͭ͘ͷݴޠͰϥϜμࣜແ໊ؔͰ࣮ݱ͍ͯ͠Δɻ
ʂʁ
ΫϩʔδϟʔͱؔͰ͋Δɻ
Ϋϩʔδϟʔʹ໊લ͕ͳ͍
Ϋϩʔδϟʔ = ໊ແ͠ͷؔ
อଘ֬ೝΞϥʔτදࣔ
Ϋϩʔδϟʔͬͯ·͔͢ʁ MFUEFGBVMU"DUJPO6*"MFSU"DUJPO 6*"MFSU"DUJPO UJUMF0, TUZMF6*"MFSU"DUJPO4UZMF%FGBVMU IBOEMFS\ Ϙλϯ͕ԡ͞Εͨ࣌ͷॲཧΛॻ͘ʢΫϩʔδϟ࣮ʣ BDUJPO6*"MFSU"DUJPO
7PJEJO QSJOU 0, ^
͜Ε͕Ϋϩʔδϟʔͩʂ MFUEFGBVMU"DUJPO6*"MFSU"DUJPO 6*"MFSU"DUJPO UJUMF0, TUZMF6*"MFSU"DUJPO4UZMF%FGBVMU IBOEMFS\ Ϙλϯ͕ԡ͞Εͨ࣌ͷॲཧΛॻ͘ʢΫϩʔδϟ࣮ʣ BDUJPO6*"MFSU"DUJPO
7PJEJO QSJOU 0, ^
{ -> in }ΛݟͨΒ Ϋϩʔδϟʔͩͱࢥ͑ MFUEFGBVMU"DUJPO6*"MFSU"DUJPO 6*"MFSU"DUJPO UJUMF0, TUZMF6*"MFSU"DUJPO4UZMF%FGBVMU
IBOEMFS\ Ϙλϯ͕ԡ͞Εͨ࣌ͷॲཧΛॻ͘ʢΫϩʔδϟ࣮ʣ BDUJPO6*"MFSU"DUJPO 7PJEJO QSJOU 0, ^
Ϋϩʔδϟʔͷॻ͖ํجຊ \ QBSBNFUFST SFUVSOUZQFJO TUBUFNFOUT ^
Ϋϩʔδϟͷॻ͖ํ \ ҾҾͷܕ Γͷܕ JO ॲཧ SFUVSOΓ ^
ΫϩʔδϟʔͰHelloWorld Ϋϩʔδϟ WBSIFMMP8PSME$MPTVSF\ JO QSJOU l)FMMP8PSME ^
IFMMP8PSME$MPTVSF
ΫϩʔδϟʔͰɺ͠ࢉ B CΛͨ݁͠ՌΛฦ͢ΫϩʔδϟΛBEE'VODʹೖ MFUBEE'VOD\ B*OU C*OU *OUJO SFUVSOB C ^
MFUSFTVMUBEE'VOD QSJOUMO SFTVMU
Ϋϩʔδϟʔͷলུه๏ WBSD\ JOQSJOU l)FMMPz ^লུͳ͠ WBSD\ 7PJEJOQSJOU l)FMMPz ^
ͱ7PJEಉ͡ WBSD\ JOQSJOU l)FMMPz ^ฦΓͷܕলུ WBSD\QSJOU l)FMMPz ^Ҿলུ
͍͠ɻɻɻʼʻ
Ϋϩʔδϟʔͷ͍υίϩ ɾίʔϧόοΫ/ඇಉظॲཧ - Alamofire ɾϦΞΫςΟϒϓϩάϥϛϯά RxSwift/SwiftBond ɾmap/filter/reduce
ΫϩʔδϟʔͰඇಉظॲཧ ɾඇಉظॲཧͱ͔ͰΑ͘͏ "MBNPpSFSFRVFTU (&5 IUUQTRJJUBDPNBQJWJUFNT SFTQPOTF+40/\SFTQPOTFJO ͜͜ʹॲཧΛهड़͍ͯ͘͠ ^
ඌΫϩʔδϟʔ(Trailing Closure) ඌҾʹΫϩʔδϟΛࢦఆͨؔ͠Λݺͼग़͢ࡍɺ Χοίॻ͖ΛলུͰ͖·͢ɻ ΧοίΛলུ͠ͳ͍߹ɺϝιουͷΧοί ͷ֎ʹΫϩʔδϟΛॻ͚Δ
ඌΫϩʔδϟʔͰsort OVNCFSTTPSUFE \ OVN*OU OVN*OU #PPMJO SFUVSOOVNOVN ^
·ͱΊ ɾΫϩʔδϟʔ໊ແ͠ͷؔ ɾΫϩʔδϟʔΛ͏ͱඇಉظॲཧͳͲ͕ॻ ͖͍͢ ɾඌΫϩʔδϟʔΧοίͷ֎ʹॻ͚Δ
ΫϩʔδϟʔͷมΩϟϓνϟ to be continued…
͝੩ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠