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
jollyjoester
August 08, 2015
Education
2
620
Swiftのポイントかいつまみ!
個人的に大事だと思うSwiftのポイントかいつまみます。
jollyjoester
August 08, 2015
Tweet
Share
More Decks by jollyjoester
See All by jollyjoester
コミュニティMTG in WWDC24
jollyjoester
0
210
BengaluruでLTしてきた
jollyjoester
0
260
try! Swift Tokyo 2024
jollyjoester
0
220
エンジニアが直接会う場の価値について
jollyjoester
8
4k
来年Proposalを出すつもりで参加するときっともっと楽しい!
jollyjoester
0
280
My favorite sessions in WWDC 23
jollyjoester
0
570
みんなでAIと戯れよう
jollyjoester
0
97
続く勉強会の作り方
jollyjoester
2
800
Code for INZAIの歩み
jollyjoester
0
350
Other Decks in Education
See All in Education
Image Processing 1 : 1.Introduction
hachama
0
260
"数学" をプログラミングしてもらう際に気をつけていること / Key Considerations When Programming "Mathematics"
guvalif
0
560
コンセプトシェアハウス講演資料
uchinomasahiro
0
390
小学生にスクラムを試してみた件~中学受検までの100週間の舞台裏~
ukky86
0
340
開発終了後こそ成長のチャンス!プロダクト運用を見送った先のアクションプラン
ohmori_yusuke
2
160
H5P-työkalut
matleenalaakso
4
36k
Web Application Frameworks - Lecture 4 - Web Technologies (1019888BNR)
signer
PRO
0
2.6k
学習指導要領から職場の学びを考えてみる / Thinking about workplace learning from learning guidelines
aki_moon
1
710
Os pápeis do UX Design
wagnerbeethoven
0
360
Design Guidelines and Models - Lecture 5 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
680
情報処理工学問題集 /infoeng_practices
kfujita
0
120
construindo uma carreira com opensource
caarlos0
0
240
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
65
11k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Raft: Consensus for Rubyists
vanstee
136
6.6k
We Have a Design System, Now What?
morganepeng
50
7.2k
Six Lessons from altMBA
skipperchong
27
3.5k
Building Your Own Lightsaber
phodgson
103
6.1k
GraphQLとの向き合い方2022年版
quramy
43
13k
Typedesign – Prime Four
hannesfritz
40
2.4k
Transcript
Swift2.0͕ग़Δલʹ SwiftͷϙΠϯτ͔͍ͭ·Έʂ SwiftϏΪφʔζษڧձ ୈ̕ճ 2015/08/08 jollyjoester
• ࣣౡҒ೭ʢͳͳ͠·ͻͰΏ͖ʣ • Repro.Inc / ྑΤϯδχΞ • iPhone / Android
• Java -> Objective-C -> Swift • ੜ·Εਆಸɺݩઍ༿ɺ ࣗࢁޱ
https://repro.io/
Repro
ࣥචʹࢀՃ͠·ͨ͠ʂ • 2015/04/10ɹٕज़ධ͔ࣾΒൃച ೦ͳ͕ΒSwift1.1࣌ Ͱਖ਼ޡදͱαϯϓϧϓϩάϥϜSwift1.2ରԠ
Introduction • ݸਓతʹେࣄͩͱࢥ͏SwiftͷϙΠϯτ͔͍ͭ·Έ·͢ɻ
TɾOɾC • Constants and Variables • Struct and Class •
Optionals • Type Constraint • ͓·͚ : Tuples
Constants and Variables • let : immutableʢఆɺ࠶ೖෆՄʣ • var :
mutableʢมɺ࠶ೖՄʣ let : Կ͕خ͍͠ʁ
Constants and Variables let : خ͍͠ͱ͜Ζ • ແବʹՄมͳ෦Λগͳ͘͢Δ͜ͱ͕Ͱ͖Δʂ ʢແବʹՄมͳ෦͕͋Δͱෳࡶ͕͞૿ͯ͠ෆ۩߹ͷݩʣ ->جຊletͰએݴɻ࠶ೖͷඞཁੑ͕ग़͖ͯͨΒvarʹɻ
ҙ • letͰએݴͨ͠มʹΦϒδΣΫτ͕ೖ͞Ε͍ͯΔ߹ɺΦϒδΣ ΫτͷϓϩύςΟมߋͰ͖ͯ͠·͏Αɻ
Struct and Class • struct : ͠ɺclass : ࢀর͠ •
structܧঝෆՄ struct : Կ͕خ͍͠ʁ
Struct and Class struct : خ͍͠ͱ͜Ζ • ແବʹՄมͳ෦Λগͳ͘͢Δ͜ͱ͕Ͱ͖Δʂ ʢແବʹՄมͳ෦͕͋Δͱෳࡶ͕͞૿ͯ͠ෆ۩߹ͷݩʣ ->جຊstructͰɻঢ়ଶΛ࣋ͨ͟ΔΛಘͳ͔ͬͨΓܧঝ͕ඞཁͳ߹
classͰɻʢܧঝprotocolΛ͑༻Մೳͳ߹͋ΔΑʣ ҙ • ͠ͳͷͰͰ͔͍σʔλͷίϐʔཁҙ͔ʢ࠷దԽ͞ΕͯΔͱ ฉ͘ʣ
Optionals • There is a value, and it equals x
or • There isn’t value at all Optionals : Կ͕خ͍͠ʁ
Optionals Optionals : خ͍͠ͱ͜Ζ • ແବʹՄมͳ෦Λ(ry ->جຊnot OptionalͰɻOptionalͰͳ͚Εͬͯ͜͜nil ೖΔ͔ɺɺɺΈ͍ͨͳ͍ٙෆཁ ҙ
• Optionalͷཚ༻͢Δͱ
Type Constraint ܕ੍͕ڧ͍->҉ͷܕมݪଇͰ͖ͳ͍ʂ Type Constraint: خ͍͠ͱ͜Ζ • ແବʹՄม(ry
͓·͚ɿTuples ෳͷΛͻͱ·ͱΊʹͰ͖Δ ArrayDictionaryͱͷҧ͍ • ҟͳΔܕΛೖΕΒΕΔ • ϧʔϓॲཧ͕Ͱ͖ͳ͍ • ͷՃআ͕Ͱ͖ͳ͍
͓·͚ɿTuples ͳΜͰTupleʁ • ࣮Swiftͷશ෦Tuple • SwiftͷؔҾฦΓෳऔΕΔ->࣮྆ํ Tupleͳ͚ͩ
Have a nice Dev!