$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mobile Programming Closure
Search
yuichiro_takahashi
October 22, 2018
Technology
0
110
Mobile Programming Closure
Mobile Programmingの授業のスライドです
yuichiro_takahashi
October 22, 2018
Tweet
Share
More Decks by yuichiro_takahashi
See All by yuichiro_takahashi
App Clip - in a nutshell
yuichirokato
0
360
巨大な機能を VIPER + MicroViewController でいい感じに実装した話
yuichirokato
1
820
Mobile Programming Protocol Extension
yuichirokato
0
84
Mobile Programming Protocol
yuichirokato
0
90
Mobile Programming enum
yuichirokato
0
170
Mobile Programming Optional
yuichirokato
0
140
Mobile Programming Struct
yuichirokato
0
130
Mobile Programming Initializer Beta
yuichirokato
0
130
Mobile Programming Inheritance
yuichirokato
0
160
Other Decks in Technology
See All in Technology
TED_modeki_共創ラボ_20251203.pdf
iotcomjpadmin
0
150
Knowledge Work の AI Backend
kworkdev
PRO
0
280
Strands Agents × インタリーブ思考 で変わるAIエージェント設計 / Strands Agents x Interleaved Thinking AI Agents
takanorig
5
2.1k
事業の財務責任に向き合うリクルートデータプラットフォームのFinOps
recruitengineers
PRO
2
230
株式会社ビザスク_AI__Engineering_Summit_Tokyo_2025_登壇資料.pdf
eikohashiba
1
120
LayerX QA Night#1
koyaman2
0
270
ハッカソンから社内プロダクトへ AIエージェント「ko☆shi」開発で学んだ4つの重要要素
sonoda_mj
6
1.7k
マイクロサービスへの5年間 ぶっちゃけ何をしてどうなったか
joker1007
21
8.3k
Agent Skillsがハーネスの垣根を超える日
gotalab555
6
4.5k
Identity Management for Agentic AI 解説
fujie
0
480
AI with TiDD
shiraji
1
300
202512_AIoT.pdf
iotcomjpadmin
0
150
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
51
46k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
680
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
320
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
51
The Pragmatic Product Professional
lauravandoore
37
7.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Prompt Engineering for Job Search
mfonobong
0
130
Product Roadmaps are Hard
iamctodd
PRO
55
12k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
2.8k
Building Applications with DynamoDB
mza
96
6.8k
Transcript
Ϋϩʔδϟ .PCJMF1SPHSBNNJOH0DU UI
ແ໊ؔ Ϋϩʔδϟ
ແ໊ؔ Ϋϩʔδϟ ͱʁ w ໊લͷ௨Γ໊લͷͳ͍ؔ w ໊લ͖ͭؔͱେ͖͘ҧ͏ͱ͜Ζ w มʹೖΕΒΕΔ w
ͱͯ͠ѻ͑Δͱ͍͏ͱ͜Ζ w ߏจएׯมΘΓ·͢ w ϥϜμࣜͳΜͯݺͼํ
ΫϩʔδϟΫοΩϯά { } w ೋͭͷΛड͚औͬͯ͠߹ΘͤΔؔΛߟ͑·͢ w ·ͣΫϩʔδϟͷ࢝·ΓͰ͋Δ\^Λهड़ ·ͣ͜Εʂ
ΫϩʔδϟΫοΩϯά { (number1: Int, number2: Int) -> Int in }
w ࣍ʹΫϩʔδϟ͕ड͚औΔҾΛઃఆ͍͖ͯ͠·͢ w ࠓճ͠ࢉͷؔͳͷͰҾೋͭʹͳΓ·͢ w ؔͱಉ͡Α͏ʹҾ໊લܕͱ͍͏ܗͰఆٛ͞Ε w ෳ͋Δ߹ΧϯϚͰ۠Γ·͢ Ҿ Ҿ Ҿಉ࢜ΧϯϚͰ۠Δ
ΫϩʔδϟΫοΩϯά w ࣍ʹΓΛܾΊ·͢ w ྫ͑ࠓճ͠ࢉͷؔͳͷͰ*OUܕΛҰͭฦ͠·͢ w Կฦ͢ͷ͕ͳ͍߹লུՄೳͰ͢ w ͪͳΈʹฦΓͱݴͬͨΓ͠·͕͢৭ʑΞϨͳͷͰࠓճΓͱݺͼ·͢ w
ΫϩʔδϟͰΓͷޙʹJOͱ͍͏Ωʔϫʔυ͕ඞཁʹͳΓ·͢ ͜ͷ෦͕Γ { (number1: Int, number2: Int) -> Int in } Εͣʹʂ
ΫϩʔδϟΫοΩϯά { (number1: Int, number2: Int) -> Int in let
result = number1 + number2 return result } w ࠷ޙʹΫϩʔδϟͷதΛهड़͍͖ͯ͠·͢ w Γ͕͋Δؔͷ߹ඞͣ࠷ޙʹ w SFUVSOΛ༻ͯ͠Λฦ͢ඞཁ͕͋Γ·͢ ΓΛฦ͢ ؔͰߦ͏ॲཧ
Ϋϩʔδϟͷݺͼग़͠ w ؔͱಉ༷ʹΫϩʔδϟݺͼग़͞ΕΔ·Ͱ࣮ߦ͞Εͳ͍ w ͦͷͨΊఆٛͨ͠ޙʹඞͣݺͼग़͢ඞཁ͕͋Δ w ΫϩʔδϟΛݺͼग़͢߹جຊతʹҰมʹೖΕΔඞཁ͕͋Δ // Ϋϩʔδϟͷఆٛ let
closure = { (number1: Int, number2: Int) -> Int in let result = number1 + number2 return result } // Ϋϩʔδϟͷݺͼग़͠ let added = closure(10, 10) print("result is: \(added)") // 20
ؔܕҾ ճ
ؔܕҾʁ w ઌ΄Ͳઆ໌ͨ͠ΫϩʔδϟΛҾʹͨ͠ͱ͖ͷ໊લ w Ϋϩʔδϟͱͯ͠ѻ͑ΔͨΊؔͷҾʹ͢͜ͱ ͕Ͱ͖Δ w ܁Γฦ͠ͷ࣌ʹग़͖ͯͨNBQΫϩʔδϟΛҾʹͱΔ ؔͰ͋Δ
ؔܕҾʁ // ΫϩʔδϟΛҾʹؚΉؔఆٛ func calculate(number1: Int, number2: Int, calc: ((Int,
Int) -> Int)) -> Int { return calc(number1, number2) } // ؔݺͼग़͠(ΫϩʔδϟҎ֎ͷҾΛຒΊΔ) calculate(number1: 10, number2: 10, calc:)
ؔܕҾʁ // ΫϩʔδϟΛҾʹؚΉؔఆٛ func calculate(number1: Int, number2: Int, calc: ((Int,
Int) -> Int)) -> Int { return calc(number1, number2) } // ؔݺͼग़͠(Ϋϩʔδϟͷ࢝·ΓͷΧοίΛॻ͍ͯɾɾɾ)͘ calculate(number1: 10, number2: 10, calc: { })
ؔܕҾʁ // ΫϩʔδϟΛҾʹؚΉؔఆٛ func calculate(number1: Int, number2: Int, calc: ((Int,
Int) -> Int)) -> Int { return calc(number1, number2) } // ؔݺͼग़͠(Ҿͷ໊લͱܕͱΓͷܕΛॻ͍ͯɾɾɾɾ) calculate(number1: 10, number2: 10, calc: { (num1: Int, num2: Int) -> Int })
ؔܕҾʁ // ΫϩʔδϟΛҾʹؚΉؔఆٛ func calculate(number1: Int, number2: Int, calc: ((Int,
Int) -> Int)) -> Int { return calc(number1, number2) } // ؔݺͼग़͠(in ΩʔϫʔυΛॻ͍ͯɾɾɾ) calculate(number1: 10, number2: 10, calc: { (num1: Int, num2: Int) -> Int in })
ؔܕҾʁ // ΫϩʔδϟΛҾʹؚΉؔఆٛ func calculate(number1: Int, number2: Int, calc: ((Int,
Int) -> Int)) -> Int { return calc(number1, number2) } // ؔݺͼग़͠(࠷ޙʹॲཧΛॻ͘ɾɾɾ) calculate(number1: 10, number2: 10, calc: { (num1: Int, num2: Int) -> Int in return num1 + num2 })
0I.Z (PPPPPPPPPPPPPPPPPPPPPPPPP
ྲྀੴʹΊΜͲ͍͘͞
Ϋϩʔδϟͷলུه๏
͖ͬ͞ͷྫΛ͏Ұ // ͬͪ͜লུͰ͖ͳ͍͕ɾɾɾ func calculate(number1: Int, number2: Int, calc: ((Int,
Int) -> Int)) -> Int { return calc(number1, number2) } // ͬͪ͜লུ͢Δͱɾɾɾ calculate(number1: 10, number2: 10, calc: { (num1: Int, num2: Int) -> Int return num1 + num2 }) ͜ͷ͍Ϋϩʔδϟ͕͋Δ͡ΌΖʁ
͖ͬ͞ͷྫΛ͏Ұ // ͬͪ͜লུͰ͖ͳ͍͕ɾɾɾ func calculate(number1: Int, number2: Int, calc: ((Int,
Int) -> Int)) -> Int { return calc(number1, number2) } // ͬͪ͜লུ͢Δͱɾɾɾ calculate(number1: 10, number2: 10) { (num1, num2) in return num1 + num2 } ͜ΕΛ͜͏ͯ͠ɾɾɾ
͖ͬ͞ͷྫΛ͏Ұ // ͬͪ͜লུͰ͖ͳ͍͕ɾɾɾ func calculate(number1: Int, number2: Int, calc: ((Int,
Int) -> Int)) -> Int { return calc(number1, number2) } // ͬͪ͜লུ͢Δͱɾɾɾ calculate(number1: 10, number2: 10ʣ{ $0 + $1 } ͜͏͡Όʂ
None
ॱΛͬͯઆ໌͠·͢
Ϋϩʔδϟͷޙஔه๏
Ϋϩʔδϟͷޙஔه๏ w ؔͷҾͷ࠷ޙ͕Ϋϩʔδϟͷ߹ͦͷΫϩʔδϟΛҾ Ϧετͷ֎ʹग़͢͜ͱ͕Ͱ͖·͢ w ͜ΕΛΫϩʔδϟͷޙஔه๏ 5SBJMMJOH$MPTVSF ͱݺͼ· ͢ calculate(number1:
10, number2: 10) { (num1: Int, num2: Int) -> Int in return num1 + num2 } calculate(number1: 10, number2: 10, calc: { (num1: Int, num2: Int) -> Int return num1 + num2 }) #FGPSF "GUFS
Ϋϩʔδϟͷܕͷলུ
Ϋϩʔδϟͷܕͷলུ w 4XJGUʹܕਪ͕͋ΔͨΊΫϩʔδϟͷҾͱΓͷ ܕΛলུͰ͖Δ߹͕͋Γ·͢ calculate(number1: 10, number2: 10) { (num1,
num2) in return num1 + num2 } calculate(number1: 10, number2: 10) { (num1: Int, num2: Int) -> Int in return num1 + num2 } #FGPSF "GUFS
Ϋϩʔδϟͷม໊ͷ লུ
Ϋϩʔδϟͷม໊ͷলུ w Ϋϩʔδϟͷॲཧ͕ߦͰࡁΉ߹มͷ໊લলུ͢Δ͜ͱ͕ Ͱ͖·͢ w ΘΓʹOͱ͍͏දهΛ͍·͢ w Ҿ͕ෳ͋Δ߹ࠨ͔Β ʜͱ͍͏ܗʹͳΓ·͢ w
·ͨɺSFUVSOলུՄೳͰ͢ calculate(number1: 10, number2: 10) { $0 + $1 } calculate(number1: 10, number2: 10) { (num1, num2) in return num1 + num2 } #FGPSF "GUFS