Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Fizz Buzz問題で(ちょっと) わかる気がするSwift
Search
itaru
December 09, 2019
Programming
0
460
Fizz Buzz問題で(ちょっと) わかる気がするSwift
Fukuoka.LT
福岡のいろんなコミュニティを集められるだけ集めて合同忘年LT大会
itaru
December 09, 2019
Tweet
Share
More Decks by itaru
See All by itaru
Swiftでswizzling
itaru0724
0
460
Other Decks in Programming
See All in Programming
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
300
ソフトウェア設計の課題・原則・実践技法
masuda220
PRO
24
19k
AIの弱点、やっぱりプログラミングは人間が(も)勉強しよう / YAPC AI and Programming
kishida
13
5.5k
React Native New Architecture 移行実践報告
taminif
1
120
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
150
JEP 496 と JEP 497 から学ぶ耐量子計算機暗号入門 / Learning Post-Quantum Crypto Basics from JEP 496 & 497
mackey0225
2
510
Level up your Gemini CLI - D&D Style!
palladius
1
140
しっかり学ぶ java.lang.*
nagise
1
460
Why Kotlin? 電子カルテを Kotlin で開発する理由 / Why Kotlin? at Henry
agatan
2
650
AWS CDKの推しポイントN選
akihisaikeda
1
220
モデル駆動設計をやってみよう Modeling Forum2025ワークショップ/Let’s Try Model-Driven Design
haru860
0
210
レイトレZ世代に捧ぐ、今からレイトレを始めるための小径
ichi_raven
0
480
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
40k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
1
63
Statistics for Hackers
jakevdp
799
230k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Agile that works and the tools we love
rasmusluckow
331
21k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Transcript
Fukuoka.LT Ԭͷ͍ΖΜͳίϛϡχςΟΛूΊΒΕΔ͚ͩूΊͯ߹ಉLTେձ HAKATA.swift ͍ͨΔ Fizz BuzzͰ (ͪΐͬͱ) Θ͔Δؾ͕͢ΔSwift
ࠂ
Swift Days Fukuoka 1݄24(ۚ)~26()
ͳʹͦΕʁ
Swift iOS ίϛϡχςΟ ߹ಉษڧձ
5ίϛϡχςΟ ࢀՃ
HAKATA Test Night
HAKATA TEST NIGHT
Swift ෮शձ
Swift Ѫձ
Mr.סഋʔࣣౡ͞Μ
Θ͍Θ͍swiftc
1݄24(ۚ)~26()
1݄24(ۚ)~26()
ॴ
͜͜ LINE Fukuoka
͝ࢀՃ͍ͩ͘͞
͞Βʹ
None
try! Swift 2020 Tokyo
try! Swift 2020 Tokyo
ࣗݾհ
͗͢ͱ ͍ͨΔ @itaru_sugimoto ͍ͨΔΜ Money Forward, Inc. υϧϮλ ίϯΧϑΣ
ͬͱຊฤ
Fizz BuzzͰ (ͪΐͬͱ) Θ͔Δؾ͕͢ΔSwift
None
FizzBuzz?
3ͰׂΓΕΔ߹ʮFizzʯ 5ͰׂΓΕΔ߹ʮBuzzʯ ྆ऀͰׂΓΕΔ߹ʢ͢ͳΘͪ15 ͰׂΓΕΔ߹ʣʮFizz Buzzʯ Λग़ྗ FizzBuzz ࢀߟ:https://ja.wikipedia.org/wiki/Fizz_Buzz
͍ͨΔΜ FizzBuzz ͬͯΈͨ
ॳڃฤ
None
let Ͱએݴ͞Εͨม ॻ͖ࠐΊΔͷ1͚ͩ
CountableClosedRangeܕ ͷൣғࢦఆ
Ҿ໊ͷলུ // value inলུ
தڃฤ
None
map Ͱ֤ཁૉʹରͯ͠FizzBuzzͷఆΛߦ͍ ݁ՌΛStringͰฦ͢
reduce ɺྻͷ݁ՌΛ݁߹Ͱ͖Δ
Computed Properties ฤ
ܾ·ͬͨΛอ͓࣋ͯ͠ΒͣϓϩύςΟ͕ ݺͼग़͞ΕΔʹܭࢉ͞ΕͯΛऔಘͰ͖Δ
Tuple ฤ
ෳͷܕ͔ΒҰͭͷܕΛ࡞Δ͜ͱ͕Ͱ͖Δ ҟͳΔܕΛ·ͱΊΒΕΔͷ͕ྻͱҟͳΔ
ऴΘΓ
Summary • Property ͍ํ৭ʑʂʂ • map tuple , enum
ͳͲศརͳੑ࣭͕͍ͬͺ͍ʂ • ଞʹ compactMap, flatMap ʂʂ • SwiftyͱԿ͔ʁʁʁ • ͬͱΓ͍ͨͱࢥͬͨํɾɾɾ
Swift Days Fukuoka 1݄24(ۚ)~26()
͝ࢀՃ͍ͩ͘͞
Thank you