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
未来大LT_2025.pdf
Search
Kaito Kudo
May 17, 2025
Technology
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
未来大LT_2025.pdf
Kaito Kudo
May 17, 2025
Transcript
42 slides
SwiftͬͯεϚϗΞϓϦ։ൃઐ༻ʁ ͍͍͑ɺαʔόʔॻ͚·͢ʂ 2025/05/17 ͩͯ͜ະདྷେ×اۀΤϯδχΞ େLT2025 ͘Ͳ͔͍ 1
ࣗݾհ גࣜձࣾΏΊΈ/͘Ͳ͔͍ 2022/04ʹiOSΤϯδχΞͱͯ͠৽ଔೖࣾɻ ෭ۀͰFlutterΛͪΐͬͱͬͨΓɻ ݸਓ։ൃ ݮञࢧԉΞϓϦʮAlconʯ https://apps.apple.com/jp/app/alcon/id1571071417 ࡔಓάϧʔϓͷ८ྱΞϓϦʮͷ͗ϥϦʔʯ https://apps.apple.com/jp/app/ͷ͗ϥϦʔ/id6501994754 @kudokai00
@KaitoKudou 2
3
࣮SwiftͰ αʔόʔॻ͚ΔΜͰ͢ʂ 4
Ϟνϕʔγϣϯ • ͍׳Ε͍ͯΔ Swift ͰαʔόʔαΠυ։ൃͰ͖ͨΒ͍͍ΑͶ • Swift ͚ͩͰΞϓϦέʔγϣϯΛࣗྗͰ࡞Δ͜ͱ͕Մೳ • ձࣾͷઌഐ͕ॻ͍ͨ
Server Side Swift ͷهࣄΛಡΜͰڵຯ͕ग़ͨ 5
https://techbookfest.org/product/kdUdfz8a1KZQJZvJxRVu8V?productVariantID=3PtDPisanjt1xTD47yyVYK 6
https://techbookfest.org/product/kdUdfz8a1KZQJZvJxRVu8V?productVariantID=3PtDPisanjt1xTD47yyVYK 7
https://techbookfest.org/product/kdUdfz8a1KZQJZvJxRVu8V?productVariantID=3PtDPisanjt1xTD47yyVYK ॻ͍ͯ·͢ʂʂ 8
Server Side Swiftͱ • Swift ΛαʔόʔαΠυ։ൃʹ༻͢Δ͜ͱ • Vapor Hummingbird
ͷΑ͏ͳ Web ϑϨʔϜϫʔΫ͕ར༻͞ΕΔ • ϧʔςΟϯάɺσʔλϕʔε౷߹ɺϦΫΤετॲཧͳͲͷॏཁͳػೳ ͕ఏڙ͞ΕɺϏδωεϩδοΫͷ࣮ʹूதͰ͖Δ 9
10
Vaporͱ • Server Side SwiftͷදతͳϑϨʔϜϫʔΫ • Swift Ͱ Web ΞϓϦͷ
API ɺ HTTP αʔόʔͷߏங͕Մೳ • पลϥΠϒϥϦ͕͔ͳΓॆ࣮ - ORMʢFluentʣɺೝূʢJWTɾOAuthʣɺWebSocketͳͲ 11
ͳͥVaporͳͷ͔ • ݱࡏͰ։ൃ͕ΜʹߦΘΕ͍ͯΔ • Server Side SwiftͷϑϨʔϜϫʔΫͰελʔ͕ଟ͍ • υΩϡϝϯτ͕ॆ࣮ •
Swift Concurrencyʹ͔ͬ͠Γै 12
13
͔͜͜Β։ൃͷ͓ 14
Πϯετʔϧํ๏ • HomebrewͰΠϯετʔϧ • versionͷ֬ೝ 15
ϓϩδΣΫτͷ࡞ • ࠷খߏͰϓϩδΣΫτΛ࡞ • APIαʔόʔΛىಈ 16
ϓϩδΣΫτͷ࡞ XcodeͰϏϧυޙɺhttp://127.0.0.1:8080 ͰWebαʔόʔ͕ىಈ͢Δʂ 17
ϑΥϧμߏ 18
ϑΥϧμߏ ը૾ελΠϧγʔτͳͲͷ ֎෦ʹެ։͢ΔϑΝΠϧΛ ֨ೲ͢Δɻ FileMiddlewareΛ༗ޮʹ͢Δ ඞཁ͕͋Δɻ 19
ϑΥϧμߏ શͯͷιʔεϑΝΠϧ͕֨ೲ͞ΕΔɻ શͯͷϩδοΫ͕Sources/App ҎԼʹೖΔɻ 20
ϑΥϧμߏ ΞϓϦέʔγϣϯͷϩδοΫΛ·ͱΊ Δͷʹద͍ͯ͠Δɻ ϦΫΤετΛड͚औΓɺԿΒ͔ͷܗͰ ϨεϙϯεΛฦ͕ؔ͢ఆٛ͞ΕΔɻ 21
ϑΥϧμߏ ͜ͷϑΝΠϧʹɺroutes(_:) ؚ͕ؔ ·Ε͍ͯΔɻ ϧʔςΟϯάΛఆٛ͢Δɻ 22
JSONΛฦͯ͠ΈΔ 23
JSONΛฦͯ͠ΈΔ HTTPϝιου 24
JSONΛฦͯ͠ΈΔ ΤϯυϙΠϯτ 25
JSONΛฦͯ͠ΈΔ JSONͷkey/valueΛࣙॻͰఆٛ 26
JSONΛฦͯ͠ΈΔ εςʔλείʔυ200Ͱฦ٫͢ΔΑ͏ʹɺ Τϯίʔυ 27
JSONΛฦͯ͠ΈΔ JSONΛฦ͢ 28
JSONΛฦͯ͠ΈΔ XcodeͰϏϧυޙɺhttp://127.0.0.1:8080/json ͰҎԼ͕ग़ྗ͞ΕΔ🎉 29
ͨͬͨ͜Ε͚ͩʂ 30
͕ॻ͍ͨίʔυΛோΊͯΈΔ 31
ເͷࠃͷΞτϥΫγϣϯͪ࣌ؒAPI • ެࣜΞϓϦͷಈ࡞͕͍ʂʂ Ϟνϕʔγϣϯ Έ • ެࣜαΠτΛεΫϨΠϐϯά • ֎෦APIΛ༻ •
Ϩεϙϯε5ؒΩϟογϡʹ٧ΊΔ 1ͭͷAPIʹ·ͱΊΔ 32
ເͷࠃͷΞτϥΫγϣϯͪ࣌ؒAPI εΫϨΠϐϯά͢Δσʔλ ֎෦API͔Βऔಘ͢Δσʔλ 33
ເͷࠃͷΞτϥΫγϣϯͪ࣌ؒAPI ΫϥΠΞϯτʹฦ͢σʔλ 34 AttractionBasicInfo + AttractionOperatingStatus Attraction
ເͷࠃͷΞτϥΫγϣϯͪ࣌ؒAPI εΫϨΠϐϯάͰऔಘͨ͠σʔλΛ[AttractionBasicInfo]ʹม 35
ເͷࠃͷΞτϥΫγϣϯͪ࣌ؒAPI ֎෦API͔Βऔಘͨ͠σʔλΛ[AttractionOperatingStatus]ʹม 36
ເͷࠃͷΞτϥΫγϣϯͪ࣌ؒAPI σʔλΛ[Attraction]ʹ౷߹ 37
ເͷࠃͷΞτϥΫγϣϯͪ࣌ؒAPI [Attraction]ΛΤϯίʔυ 38
ເͷࠃͷΞτϥΫγϣϯͪ࣌ؒAPI ࣮ߦ݁Ռ🎉 39 http://127.0.0.1:8080/tokyo_disney_resort/tdl/attraction Ͱ࣮ߦ
ເͷࠃͷΞτϥΫγϣϯͪ࣌ؒAPI 40 ίʔυͷஔ͖ॴ https://github.com/KaitoKudou/TokyoDisneyResortAPI
·ͱΊ Vapor ͱ • Server Side Swift ͷදతͳϑϨʔϜϫʔΫ • ORM
ೝূͳͲͷपลϥΠϒϥϦॆ࣮ • Swift Concurrency ʹରԠ͍ͯ͠ΔͷͰɺΫϩʔδϟͰඇಉظॲཧΛॻ͘ඞཁͳ͠ Server Side Swift ͱ • Swift ΛαʔόʔαΠυͷ։ൃͰ༻͢Δ͜ͱ • Vapor Hummingbird ͷΑ͏ͳ Web ϑϨʔϜϫʔΫ͕ར༻͞ΕΔ 41
ࢀߟจݙ • https://techbookfest.org/product/kdUdfz8a1KZQJZvJxRVu8V? productVariantID=3PtDPisanjt1xTD47yyVYK • https://docs.vapor.codes/ja/getting-started/folder-structure/ • https://zenn.dev/yusuga/articles/dc601e1f67a0b7 • https://speakerdeck.com/satotakeshi/5fen-dewakaruserver-side-
swift-vaporfalsemei-li • https://www.swift.org/documentation/server/ 42
More Decks by Kaito Kudo
See All by Kaito Kudo
5分でわかる! VaporでAPI+DB構築
kaitokudou
0
160
Universal Linksの実装方法と陥りがちな罠
kaitokudou
1
560
iOSDC Japan 2022 スポンサーセッション
kaitokudou
0
2.2k
iOS勉強会資料
kaitokudou
0
150
App Storeにアプリをリリースした話
kaitokudou
0
61
Other Decks in Technology
See All in Technology
属人化したISMS運用をGitHubとAIで仕組み化した1年間の記録
sioncojp
4
2.6k
思考過程から秘密が漏れる:Amazon Bedrock上のKimi K3を5つの方法で攻めたら、25回中22回漏洩した話
yama3133
1
160
Agent Harnessはどう作る?事例から学ぶAI Agentの設計思想
sergicalsix
0
300
JAWS_FESTA2026_オンプレ-AWS間プロキシサーバの移行_性能_障害対応で得た実践ノウハウ_高島一晃.pdf
tkazuaki0820
1
120
ライフワーク「猫でもわかるDirectConnect」
kentapapa
0
330
_マネジメントする人される人ナイト_2026__良いチームを作っていきたい_お気持ち_.pdf
xkxaxkx
0
430
速くなった開発の効果をどう推し量るのか
bulbulpaul
0
110
AWS Emulator を評価する: 手元で動く AWS の API の仕組み、始め方、確かめ方
inariku
PRO
1
580
The Author Pays
hiccupps
0
220
Quick Automate | 目指せ Quick マスター 12
inariku
PRO
1
110
Frontier Teams — Amazon は AI で「開発のやり方」をどう変えたのか
kmotohas
0
260
アラートを見直していたら営業組織への理解にちょっとだけ繋がった話
z63d
1
200
Featured
See All Featured
Utilizing Notion as your number one productivity tool
mfonobong
4
640
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
GraphQLとの向き合い方2022年版
quramy
50
15k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
330
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
660
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
320
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Evolving SEO for Evolving Search Engines
ryanjones
0
360
Being A Developer After 40
akosma
PRO
92
590k
Optimising Largest Contentful Paint
csswizardry
37
4k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
640