Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Fizz Buzz問題で(ちょっと) わかる気がするSwift
Search
itaru
December 09, 2019
Programming
490
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Fizz Buzz問題で(ちょっと) わかる気がするSwift
Fukuoka.LT
福岡のいろんなコミュニティを集められるだけ集めて合同忘年LT大会
itaru
December 09, 2019
More Decks by itaru
See All by itaru
Swiftでswizzling
itaru0724
0
490
Other Decks in Programming
See All in Programming
sbt 2.0: takeoff
eed3si9n
0
160
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
300
Performance Optimization With LLMs
xleitix
0
150
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
180
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
230
ジョジョの世界をXRで再現する
mofurune
0
170
Next.js: The final boss of Web Performance
guaca
0
280
The Rails Doctrine Decade
koic
2
600
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
520
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
260
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
41k
The SEO identity crisis: Don't let AI make you average
varn
0
590
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
360
Six Lessons from altMBA
skipperchong
29
4.5k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
220
We Have a Design System, Now What?
morganepeng
55
8.4k
Become a Pro
speakerdeck
PRO
31
6.3k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
The Curious Case for Waylosing
cassininazir
1
570
Building AI with AI
inesmontani
PRO
1
1.3k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
730
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
540
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