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
How to read Swift
Search
Yusuke Hosonuma
February 14, 2015
Programming
310
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
How to read Swift
声に出して読みたいSwift
Yusuke Hosonuma
February 14, 2015
More Decks by Yusuke Hosonuma
See All by Yusuke Hosonuma
KotlinTest で始める Property-based Testing/kotlintest-property-based-testing
yusukehosonuma
2
1.6k
Marzipan の正体は何だったのか そして SwiftUI の衝撃/wwdc19_marzipan_swiftui
yusukehosonuma
2
990
標準パッケージにおけるテストでの利用例から学ぶ testing / quick パッケージ/golang-testing-quick
yusukehosonuma
4
12k
Swift で ParameterizedTest をやってみた話/swift-parameterized-test
yusukehosonuma
4
2.3k
Property-based test beginning with SwiftCheck
yusukehosonuma
1
6.3k
XCTest(再)入門/reintroduction-to-xctest
yusukehosonuma
0
660
ソースコードから読み解く - Quick はどのように実装されているのか?/quick-code-reading
yusukehosonuma
7
11k
Swift 4.2 はどのような進化をしているのか/whats-new-swift42
yusukehosonuma
16
15k
HTTPモックライブラリ「Mockingjay」を使ってみた話/swift-mockingjay
yusukehosonuma
5
4.4k
Other Decks in Programming
See All in Programming
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.7k
Go のフラットな パッケージに 「ファイル単位の private」を 〜Linter “declscope” を作った話〜
mpyw
0
310
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
250
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
780
cdk deploy JawsSonic #MARATHONしながらAWSリソースをデプロイしてみよう
akihisaikeda
2
130
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
110
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2.2k
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
6
1.9k
Webの地図
yosuke_furukawa
PRO
6
4.5k
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
870
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
270
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
130
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
77
5.5k
Code Reviewing Like a Champion
maltzj
528
40k
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
520
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.9k
The Curious Case for Waylosing
cassininazir
1
510
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
320
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Become a Pro
speakerdeck
PRO
31
6.3k
Product Roadmaps are Hard
iamctodd
55
13k
Transcript
SwiftͷಡΈํ ʹग़ͯ͠ಡΈ͍ͨSwift
ࣗݾհ • Yusuke Hosonuma • ͖ͳݴޠɿJavaɺScalaɺSwiftʁ • Qiitaɿqiita.com/YusukeHosonuma • झຯɿΞχϝͱ͔ݟ·͢ɻ߈֪ػಈୂͱ͔ɻ
ࠓͷςʔϚ
Swiftͬͯ ຊʹಡΈ͍͢ʁ
ຊʹʁ var name: String? var name: String! var name: String
= userName ?? "Guest" func sum(number1 a:Int, number2 b:Int) -> Int { return a + b } fruits.sort({ (s1: String, s2: String) -> Bool in return s1 < s2 }) func say(greet: String) -> (String -> String) { func greet(name: String) -> String { return "\(greet), \(name)!" } return greet }
׳ΕΔ·Ͱਏ͍ ʢݸਓͷײͰ͢ʣ
ͦΕͳΒ ʹग़ͯ͠ಡΜͰΈΑ͏ʂ
ʹग़ͯ͠ಡΈ͍ͨ Swiftʢ͢͏͌;ͱʣ
Lesson1: ม var name: String
Lesson1: ͜͏ಡΈ·͢ var name: String ᶃม ᶄname ᶅStringܕͰఆٛ͞ΕΔ ৭ΜͳॴͰΘΕΔ جຊܗʂ
Lesson2: Optional var name: String?
Lesson2: ͜͏ಡΈ·͢ var name: String? ᶃม ᶄname ᶅStringܕ ᶆͷOptionalܕͰఆٛ͞ΕΔ
Lesson3: ڧ੍Ξϯϥοϓܕ var name: String!
Lesson3: ͜͏ಡΈ·͢ var name: String! ᶃม ᶄname ᶅStringܕ ᶆͷOptionalܕ ᶇ͚ͩͲʂ
ڧ੍తʹUnwrap͞ΕΔʂʂ
Lesson4: Nil Coalescing Operator var name: String = userName ??
"Guest"
Lesson4: ͜͏ಡΈ·͢ var name: String = userName ?? "Guest" ᶃมnameʹ
ᶄuserNameʹ͕ೖͬͯͨΒ ᶅͦͷத ᶆೖͬͯͳ͚Ε͜Ε ᶇΛೖ͢Δ
Lesson5: ϝιου func sayHello(name s:String) -> String { return “Hello,
\(s)!” } sayHello(name: "Yusuke")
Lesson5: ͜͏ಡΈ·͢ func sayHello(name s:String) -> String { return “Hello,
\(s)!” } sayHello(name: "Yusuke") ᶃϝιου ᶅStringܕͰఆٛ͞Εͨ ᶄsayHello ᶆsͱ͍͏ҾΛड͚औΓ ᶇStringܕͷ݁ՌΛฦ͢ ᶈͪͳΈʹݺͼग़͢ͱ͖ʹ nameͰࢦఆͯ͠Β͏
Lesson6: Ϋϩʔδϟ fruits.sort({ (s1: String, s2: String) -> Bool in
return s1 < s2 })
Lesson6: ͜͏ಡΈ·͢ fruits.sort({ (s1: String, s2: String) -> Bool in
return s1 < s2 }) ᶃsortʹ༩͑ΔΫϩʔδϟ{} ᶄStringܕͷ(s1, s2)ΛҾʹड͚औΓ ᶅBoolܕΛฦ͢ ᶆͦͯ͠ ᶇ࣮ࡍͷॲཧ͜͏ͳΔ
॓: ؔΛฦؔ͢ func say(greet: String) -> (String -> String) {
func greet(name: String) -> String { return "\(greet), \(name)!" } return greet } let sayHello = say("Hello") sayHello(name: "Hosonuma") sayHello(name: "Yusuke")
5ճ͘Β͍ʹग़ͯ͠ ಡΜͰΈΕ
͖ͬͱ͋ͳͨSwift͕ ͖ʹͳͬͯ͘Δͣʂ
Let’s say Swift.
͝੩ௌ͋Γ͕ͱ͏ ͍͟͝·ͨ͠ɻ