---
title: みんなで Swift 復習会 GO! in 福岡 – 8th′ #minna_de_swift
tags:  #カジュアルswift勉強会  
author: [熊谷友宏](https://www.docswell.com/user/es_kumagai)
site: [Docswell](https://www.docswell.com/)
thumbnail: https://bcdn.docswell.com/page/GE8N1RD47D.jpg?width=480
description: 福岡で 2018/04/14 に開催した『みんなで Swift 復習会GO! in 福岡』で使ったオープニングと本編の資料です。  ※ Docswell での公開に移行する直前の Slideshare での閲覧数は 412 でした。
published: April 14, 18
canonical: https://www.docswell.com/s/es_kumagai/KWWVLY-go-180414045315
---
# Page. 1

![Page Image](https://bcdn.docswell.com/page/GE8N1RD47D.jpg)

ΈΜͳͰ
4XJGU ෮शձ
(0JO෱Ԭ rUI⒌
#minna_de_swift
ΧδϡΞϧ 4XJGU ϓϩάϥϛϯά


# Page. 2

![Page Image](https://bcdn.docswell.com/page/LELPQKMV7R.jpg)

‫۽‬୩༑޺
5PNPIJSP,VNBHBJ
⾣
4XJGU‫͕ޠݴ‬େ޷͖Ͱ͢ʂ
⾣
ΈΜͳͰָ͠Ήษ‫ڧ‬ձ͕େ޷͖Ͱ͢ʂ
⾣
ϓϩάϥϛϯάͷָ͠͞Λ఻͍͖͍͑ͯͨɻ
w ωοτϥδΦ
w ษ‫ڧ‬ձͷ஍ํ։࠵
w ಉਓࢽଈചձ


# Page. 3

![Page Image](https://bcdn.docswell.com/page/4JM412YN7W.jpg)

NPPLNPPLSBEJP NPPL
‫۽‬୩ͱ៸໘͕ϓϩάϥϛϯάίʔυͷ಺͔Β
ௌ͑ͯ͘͜Δ੠ʹࣖΛ܏ָ͚ͯ͠ΉϥδΦ
ຖ݄ୈ̎ɾୈ̐ ݄༵೔ ʹ഑৴
IUUQLFQDNPPLNPPLSBEJPDPN
⾣
ୈ࿩ 
ύϥμΠϜ
⾣
ୈ࿩ 
σʔλϕʔε
⾣
ୈ࿩ 
Τϥʔͱ‫ڐࠂܯ‬༰ͷ‫ڥ‬
⾣
ୈ࿩ 
ӈล஋ͱࠨล஋
⾣
ୈ࿩ 
ษ‫ڧ‬ձΛว͘৔ॴʹɻཱྀ͢Δओ࠵ऀɺ‫۽‬୩͞Μͷඳ͘ษ‫ڧ‬ձͷະདྷ
⾣
ୈ࿩ 
ॱ൪୳ఁ
⾣
ୈ࿩ 
0CKFDUJWF$#SJEHF
⾣
ୈ࿩ 
Ϟμϯͳ‫ͳͯͬޠݴ‬ΜͩΖ͏


# Page. 4

![Page Image](https://bcdn.docswell.com/page/PJRWLM9479.jpg)

‫̍گۙ‬


# Page. 5

![Page Image](https://bcdn.docswell.com/page/PEXPWVQZ7X.jpg)

ٕज़‫ܥ‬ಉਓࢽ
ࣗඅग़൛ͱಉਓࢽଈചձ


# Page. 6

![Page Image](https://bcdn.docswell.com/page/3EKDVQ9VJD.jpg)

ٕज़ॻయ̐நબམͪ
ΞΩόɾεΫΤΞ
΋͘΋ࣥ͘චձͷ‫࠵ڞ‬ͷ
ື઒͞Μʹरͬͯ΋Βͬͯ
͓ख఻͍ࢀՃܾఆ ㊗ ʲ͍ʳ


# Page. 7

![Page Image](https://bcdn.docswell.com/page/L73RMP9QJ5.jpg)

ίϛοΫϚʔέοτநબ଴ͪʢ౰མ௨஌ʣ
 ʙ !౦‫ژ‬ϏοάαΠτ


# Page. 8

![Page Image](https://bcdn.docswell.com/page/87DY6LGW7G.jpg)

ίϛοΫϚʔέοτग़ల
౦‫ژ‬ϏοάαΠτ


# Page. 9

![Page Image](https://bcdn.docswell.com/page/VJP6Y23XE8.jpg)

ٕज़ॻయ̎ग़ల
ΞΩόɾεΫΤΞ


# Page. 10

![Page Image](https://bcdn.docswell.com/page/2EV3GD437Q.jpg)

௒ٕज़ॻయग़ల
ઍ༿ɾນுϝοη


# Page. 11

![Page Image](https://bcdn.docswell.com/page/57G38Y1YJL.jpg)

ίϛοΫϚʔέοτग़ల
౦‫ژ‬ϏοάαΠτ


# Page. 12

![Page Image](https://bcdn.docswell.com/page/4EQ59MD6JP.jpg)

J04%$+&quot;1&quot;/ϒʔεग़ల
 ʙ !ૣҴాେֶ


# Page. 13

![Page Image](https://bcdn.docswell.com/page/KJ49XVZM71.jpg)

ٕज़ॻయ̏ग़ల
ΞΩόɾεΫΤΞ


# Page. 14

![Page Image](https://bcdn.docswell.com/page/LE1KN3RYJG.jpg)

ίϛοΫϚʔέοτग़ల
౦‫ژ‬ϏοάαΠτ


# Page. 15

![Page Image](https://bcdn.docswell.com/page/GEWD4P11J2.jpg)

΋͘΋ࣥ͘චձ
ʙٕज़‫ܥ‬ಉਓࢽʗ঎‫ࢽۀ‬ɾൃදࢿྉɾϒϩάʙ
IUUQTUFDICPPLNFFUVQDPOOQBTTDPN
⾣ ˑग़ு൛3&amp;7!౦‫ژ‬࿡ຊ໦
⾣ ˑग़ு൛3&amp;7!ਆాਆอொ


# Page. 16

![Page Image](https://bcdn.docswell.com/page/47ZG2KPXE3.jpg)

‫̎گۙ‬


# Page. 17

![Page Image](https://bcdn.docswell.com/page/YJ6YVQMP7V.jpg)

J04$POJO-POEPO
d


# Page. 18

![Page Image](https://bcdn.docswell.com/page/GJ5GDRZPJ4.jpg)

-POEPO


# Page. 19

![Page Image](https://bcdn.docswell.com/page/LE3RMP9675.jpg)

-POEPOͷ֗ฒΈ


# Page. 20

![Page Image](https://bcdn.docswell.com/page/8EDY6LGMEG.jpg)

#VDLJOHIBN1BMBDF


# Page. 21

![Page Image](https://bcdn.docswell.com/page/V7P6Y23QJ8.jpg)

4U+BNFT`T1BSL


# Page. 22

![Page Image](https://bcdn.docswell.com/page/2JV3GD4PEQ.jpg)

,JOH`T$SPTT4UBUJPO


# Page. 23

![Page Image](https://bcdn.docswell.com/page/5EG38Y1Q7L.jpg)

:PSL
:PSL
-POEPO,JOH`T$SPTT4UBUJPO͔Β
ྻंͰ࣌ؒ΄Ͳ๺ʹ͋Δ֗


# Page. 24

![Page Image](https://bcdn.docswell.com/page/4JQ59MDW7P.jpg)

:PSLJO/PSUI&amp;OHMBOE


# Page. 25

![Page Image](https://bcdn.docswell.com/page/K749XVZ1E1.jpg)

:PSLͷ֗ฒΈ


# Page. 26

![Page Image](https://bcdn.docswell.com/page/LJ1KN3R57G.jpg)

:PSLͷ֗ฒΈ


# Page. 27

![Page Image](https://bcdn.docswell.com/page/GJWD4P1W72.jpg)

:PSL.JOTUFSJO:PSL


# Page. 28

![Page Image](https://bcdn.docswell.com/page/4EZG2KP2J3.jpg)

/BUJPOBM3BJMXBZ.VTFVNJO:PSL


# Page. 29

![Page Image](https://bcdn.docswell.com/page/Y76YVQ46EV.jpg)

4USFFU-JWFJO:PSL


# Page. 30

![Page Image](https://bcdn.docswell.com/page/G75GDRQ574.jpg)

ΈΜͳͰ
4XJGU ෮शձ(0


# Page. 31

![Page Image](https://bcdn.docswell.com/page/9J2Y8DPGJR.jpg)

ΈΜͳͰ4XJGU෮शձ
෮शձ(0ͱ͸
⾣ ΈΜͳͰ4XJGU෮शձ
w ͔ͤͬ͘ͳΒΈΜͳͱҰॹʹ෮श͍ͨ͠
ͦ͏ࢥͬͯ౦‫ژ‬ɾौ୩Ͱ࢝Ίͨษ‫ڧ‬ձ
⾣ ΈΜͳͰ4XJGU෮शձ(0͸ɺͦͷग़ு൛
w ौ୩ͷ֎ʹ΋ษ‫ڧ‬ձͷָ͠͞Λ޿Ί͍ͨ
w ༑ਓͷ఻खΛཔΓʹ೔ຊ֤஍Ͱ։࠵த


# Page. 32

![Page Image](https://bcdn.docswell.com/page/DEYG625GEM.jpg)

ΈΜͳͰ4XJGU෮शձ(0
͜Ε·Ͱͷ։࠵
ʜΈΜͳͰ4XJGU෮शձ(0JOࡳຈr TU⒌
ʜΈΜͳͰ4XJGU෮शձ(0JOԭೄr OE⒌ 4XJGU%BZ 
ʜΈΜͳͰ4XJGU෮शձ(0JOઋ୆r SE⒌
ʜΈΜͳͰ4XJGU෮शձ(0JO෱Ԭr UI⒌
ʜΈΜͳͰ4XJGU෮शձ(0JO෱Ԭr UI⒌
ʜΈΜͳͰ4XJGU෮शձ(0JO‫౎ژ‬r UI⒌
ʜΈΜͳͰ4XJGU෮शձ(0JO௕໺r UI⒌
4XJGU%BZ 


# Page. 33

![Page Image](https://bcdn.docswell.com/page/VJNGZ8N878.jpg)

ΈΜͳͰ4XJGU෮शձ(0
͜Ε͔Βͷ։࠵ʁ
ʜΈΜͳͰ4XJGU෮शձ(0JO‫౎ژ‬r UI⒌
4XJGU%BZ 
ʜΈΜͳͰ4XJGU෮शձ(0JO‫ؠ‬खr UI⒌ 4XJGU%BZ 
͏ͪͷ஍‫Ͱݩ‬΋։͖͍ͨʂΈ͍ͨͳ੠ɺେ‫͢Ͱܴ׻‬
౔஍‫͍ͳ͕צ‬ͷͰɺ։࠵৔ॴͱ͔ॿ͚ͯ΋Β͑Δͱ‫͍͠خ‬


# Page. 34

![Page Image](https://bcdn.docswell.com/page/YE9WZKRXE3.jpg)


ΈΜͳͰ4XJGU෮शձ
(0JO෱Ԭ rUI⒌
ཱ໾ऀాத޹໌͞Μ


# Page. 35

![Page Image](https://bcdn.docswell.com/page/GE8N1RW97D.jpg)

ΈΜͳͰ4XJGU෮शձ
ஊস‫ࣜܗ‬
⾣ ΈΜͳͱ4XJGUΛ෮श͍ͨ͠
⾣ ͔ͤͬ͘ͳͷͰஊস͠ͳ͕Β
⾣ ͍ͭͰ΋࿩͔͚ͯ͘͠Εͯ0,


# Page. 36

![Page Image](https://bcdn.docswell.com/page/LELPQKNM7R.jpg)

ΈΜͳͰ4XJGU෮शձ
৺͕͚
⾣ ΈΜͳ஌ͬͯΔɺ͸ࢥ͍ࠐΈ
⾣ ࣗ৴΍֬ূ͸ɺແͯ͘େৎ෉
⾣ ͳΜͱͳͦ͘͏ࢥ͏ɺେ‫ܴ׻‬


# Page. 37

![Page Image](https://bcdn.docswell.com/page/4JM412X67W.jpg)

ΈΜͳͰ4XJGU෮शձ(0
&quot;4XJGU5PVS

ΈΜͳͰ4XJGU෮शձ
‫۽‬୩༑޺
IUUQF[OFUKQ
4XJGU


# Page. 38

![Page Image](https://bcdn.docswell.com/page/PJRWLMNN79.jpg)

੍‫ߏޚ‬จ


# Page. 39

![Page Image](https://bcdn.docswell.com/page/PEXPWVN87X.jpg)

੍‫ߏޚ‬จ
XIJMF
⾣ ৚͕݅ਅͷؒɺ‫܁‬Γฦ͢
⾣ CSFBLͰ΋ϧʔϓΛൈ͚ΒΕΔ
while condition {
}


# Page. 40

![Page Image](https://bcdn.docswell.com/page/3EKDVQNLJD.jpg)

੍‫ߏޚ‬จ
SFQFBUʜXIJMF
⾣ ৚͕݅ਅͷؒɺ‫܁‬Γฦ͢
⾣ ॲཧΛऴ͑ͨ‫ʹޙ‬৚݅൑ఆ͢Δ
repeat {
} while condition


# Page. 41

![Page Image](https://bcdn.docswell.com/page/L73RMPV6J5.jpg)

੍‫ߏޚ‬จ
෼‫Ͱྩ໋ذ‬ͷύλʔϯϚονϯά
⾣ ஋͕ύλʔϯʹҰக͢Δ͔Λ൑ఆ͢Δ
⾣ DBTFΩʔϫʔυʹଓ͚ͯύλʔϯΛࢦఆ͢Δ
// switch での分岐はパターンマッチを使っている
switch x {
case 1 ..&lt; 10:
}
// if 文でもパターンマッチが使える
if case 1 ..&lt; 10 = x {
}


# Page. 42

![Page Image](https://bcdn.docswell.com/page/87DY6L8M7G.jpg)

੍‫ߏޚ‬จ
‫܁‬ฦ໋ྩͰͷύλʔϯϚονϯά
⾣ Ϛον͢Δ΋ͷ͚ͩΛ‫܁‬Γฦ͠ॲཧ͢Δ
⾣ Ұൠʹɺม਺୅ೖΛ൐͏ύλʔϯϚονΛ࢖͏
// nil を除く全ての値を順番に処理する
for case let x? in optionalValues {
}
// 値が取得できなくなるまで、繰り返す。
while case let x? = iterator.next() {
}


# Page. 43

![Page Image](https://bcdn.docswell.com/page/VJP6Y28QE8.jpg)

੍‫ߏޚ‬จ
෼‫Ͱྩ໋ذ‬ͷ৚݅ࢦఆ
⾣ JG͸ΧϯϚ۠੾ΓͰ৚݅Λ௥ՃͰ͖Δ
⾣ TXJUDI͸XIFSFͰ৚݅Λ௥ՃͰ͖Δ
// if で、オプショナルから値を取って判定
if let number = Int(string), number &gt; 10 {
}
// switch で、オプショナルから値を取って判定
switch Int(string) {
case let number? where number &gt; 10:
}


# Page. 44

![Page Image](https://bcdn.docswell.com/page/2EV3GDNP7Q.jpg)

੍‫ߏޚ‬จ
‫܁‬ฦ໋ྩͰͷ৚݅ࢦఆ
⾣ GPS͸ɺશͯͷཁૉͷ͏ͪ৚݅Λຬͨ͢΋ͷΛॲཧ͢Δ
⾣ XIJMF͸ɺશͯͷ৚͕݅ຬͨ͞Ε͍ͯΔؒ͸ॲཧ͢Δ
// 要素を順番に処理する。ただし条件を満たすものだけ。
for value in values where value &lt; 10 {
}
// 両方の条件が満たされる間、処理する。
while let value = iterator.next(), value &lt; 10 {
}


# Page. 45

![Page Image](https://bcdn.docswell.com/page/57G38YKQJL.jpg)

੍‫ߏޚ‬จ
GPSʜJOͰࣙॻΛॲཧ͢Δ
⾣ ࣙॻͷཁૉ͸ ,FZ 7BMVF ͷλϓϧͰऔಘͰ͖Δ
⾣ GPSจͰλϓϧͷ֤ཁૉΛผม਺ʹऔಘͰ͖Δ
// item は (Key, Value) 型のタプルで取得
for item in dictionary {
}
// Key と Value を、それぞれ key と value に分けて取得
for (key, value) in dictionary {
}


# Page. 46

![Page Image](https://bcdn.docswell.com/page/4EQ59MNWJP.jpg)

&amp;OKPZ4XJGU
5IBOLZPV
ΈΜͳͰ4XJGU෮शձ(0
 &quot;4XJGU5PVS

$POUSPM&#039;MPX &#039;VODUJPOTBOE$MPTVSFT
‫۽‬୩༑޺
IUUQF[OFUKQ
⾣
੍‫ߏޚ‬จ
⾣
0QUJPOBM#JOEJOHT
⾣
/JM݁߹ԋࢉࢠ
⾣
ύλʔϯϚον


