Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Swift Weekly 2017-05-02
Search
Johnlin
May 02, 2017
Programming
0
58
Swift Weekly 2017-05-02
Johnlin
May 02, 2017
Tweet
Share
More Decks by Johnlin
See All by Johnlin
用 MLIR 實作 一個 Ruby IR (intermediate representation)
johnlinvc
0
130
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
260
Ruby 型別檢查工具簡介
johnlinvc
0
460
Swift Actor 實作探索
johnlinvc
0
160
用 mruby 來寫跨平台工具
johnlinvc
0
77
Actor model 簡介
johnlinvc
0
190
一起玩 Helm 3
johnlinvc
1
120
為什麼 App 卡卡的
johnlinvc
2
1.2k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
200
Other Decks in Programming
See All in Programming
XP, Testing and ninja testing
m_seki
3
250
git worktree × Claude Code × MCP ~生成AI時代の並列開発フロー~
hisuzuya
1
580
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
270
Deep Dive into ~/.claude/projects
hiragram
14
2.6k
猫と暮らす Google Nest Cam生活🐈 / WebRTC with Google Nest Cam
yutailang0119
0
140
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
560
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
1
6k
Porting a visionOS App to Android XR
akkeylab
0
480
PHPで始める振る舞い駆動開発(Behaviour-Driven Development)
ohmori_yusuke
2
400
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
700
AI時代のソフトウェア開発を考える(2025/07版) / Agentic Software Engineering Findy 2025-07 Edition
twada
PRO
91
30k
「Cursor/Devin全社導入の理想と現実」のその後
saitoryc
0
830
Featured
See All Featured
Bash Introduction
62gerente
613
210k
Docker and Python
trallard
44
3.5k
A Tale of Four Properties
chriscoyier
160
23k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.3k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Faster Mobile Websites
deanohume
307
31k
Scaling GitHub
holman
460
140k
Optimizing for Happiness
mojombo
379
70k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
How to train your dragon (web standard)
notwaldorf
96
6.1k
Transcript
Swift पใ 2017/05/02 John Lin @johnlinvc
From the core • ABI ᜦఆੑّද൘ • ఔࣜᛰ૬༰ੑଌࢼܥ౷
ABI ᜦఆੑّද൘ • ABI ᜦఆදෆಉ൛ຊSwift ฤᩄग़ိతവࣜݿ (.dylib/.framework) ՄҎޓ૬૬༰ɻલؐෆߦɻ • ّද൛ྻग़ୡ
ABI ᜦఆؐधཁ၏తमվɼؐ༗ଞ ၇ݱࡏత㐫گɻ
ఔࣜᛰ૬༰ੑଌࢼܥ౷ • Swift 4 తඪ೭Ұੋཁࡏ Swift 3 ࣜԼԼ૬༰ɼ बੋ㘸Swift 3
తఔࣜᛰෆ༻मվबೳ᠃༻ɻ • ҝྃ֬อԼ૬༰తᜦఆੑɼCI ܥ౷။ࣗಈଌࢼ֤ വࣜݿత૬༰ੑɼแؚ Realm, Alamofire, Perfect, vapor ɻ
Evolution • SE-0155 Enum case දࣔ๏ਖ਼نԽ • SE-0161 ߋతKey Value
Coding • SE-0162 ݅ཧث٬੍Խࢿྉᇄ݁ߏ • SE-0163 վྑࣈ۲ɿࢧԉCollection, C ૬༰ੑ • SE-0164 Protocol extension ෆೳ༻ final
SE-0155 Enum case දࣔ๏ਖ਼ن Խ • ݱࡏ Enum એࠂత case
ଖመੋ༻ᔒ༗ඪតతTuple መ࡞తɼ೭ޙ။վҰൠత class Ұᒬɻ • ॴҎ೭ޙ Enum ՄҎ༗༬ઃᆴɼؐ༗ಉҰݸ ໊ ୠෆಉඪតత൛ຊɻ • ୠੋჩᏐత Void ཁଧग़ိɻ
SE-0155 Enum case දࣔ๏ਖ਼ن Խ
SE-0155 Enum case දࣔ๏ਖ਼ن Խ • ݱࡏ
ະိ
SE-0161 ߋతKey Value Coding • ݱࡏత key value coding ੋ༻
#keypath() ိදࣔɼ جຊबੋᱛᨽաతࣈ۲ɻ༗NSObject ࠽ೳ༻ • ৽⃧Ұݸ \.<path> తදࣔ๏ɼ [keyPath: ] ༻ɻ
SE-0161 ߋతKey Value Coding
SE-0161 ߋతKey Value Coding
SE-0161 ߋతKey Value Coding
SE-0162 ݅ཧث٬੍Խࢿྉ ᇄ݁ߏ • ݱࡏ݅ཧث༻༬ઃత࿏ኸိཧ䈕Ҋɼ Sources ब์ఔࣜᛰɼTests ब์ଌࢼɻ • ሢҊҰେब༻ɻ
• ະိॴ༗ඪతࢿྉᇄඞध໌֬ྻग़ိ
SE-0162 ݅ཧث٬੍Խࢿྉ ᇄ݁ߏ
SE-0163 վྑࣈ۲ɿࢧԉ Collection, C ૬༰ੑ • Swift 2 ࣈ۲ᙛ collection
༻ޭೳ፤ᎃྃɼSwift 4 ။Ճ ճိʂ • ။৽⃧Ұݸ Substring Type ိଘաతࣈ۲ɼෆաෆݐ ٞ༻ိظṶଘɼ༰қ٣ଠଟهԱᱪɻ • ৽⃧Ұݸ Unicode protocol ိᙛ၏ String Substring తجఈɼํศ၏ᔟܕ • ৽⃧زݸኺC ࣈ۲ Swift ࣈ۲తവᏐ
SE-0164 Protocol extension ෆೳ༻ final • Protocol extension ຊိबෆೳඃվሜɼ༗ᔒ༗Ճ final
Ұᒬɻ • ೭ޙՃྃ final ब။༗ࡨޡɼෆա։ swift 3 ࣜత ။༗ܯࠂɻ
Evolution • SE-0165 Ճڧ Dictionary Set • SE-0166 ෧ଘᢛংྻԽ
• SE-0167 ฤᛰث • SE-0168 ଟߦᏐతࣈ۲
SE-0165 Ճڧ Dictionary Set • Dictionary Set ༻ىိෆⴺ༻ɼڧԽྃԼ໘زᴍ
• ኺ Array 㗞ੜ Dictionaryɼ߹ซ Dictionary • औᆴ࣌ՌKey ෆଘࡏՄҎڅ༬ઃᆴ • Dictionary Set త map & filter • ՄҎ౸ Dictionary Set త༰ྔ • ՄҎሣ Array ၏ group by
SE-0165 Ճڧ Dictionary Set • ኺ Array 㗞ੜ Dictionary
• ݱࡏೳखಈ Array Dictionary ɼ೭ޙՄҎࣗ ಈ tuple array Dictionary
SE-0165 Ճڧ Dictionary Set • ߹ซDictionary • ݱࡏೳखಈҰݸҰݸᆴ߹ซɼ೭ޙཁఏڙҰݸ ղܾ
key ॏෳత closure बՄҎࣗಈ߹ซ
SE-0165 Ճڧ Dictionary Set • ᩇሜᆴℭೂݔKey ෆଘࡏՄҎڅ༬ઃᆴ • ݱࡏೳखಈऔҰ࣍ੋෆੋnil,
ੋత࠶څ༬ઃ ᆴɻ೭ޙՄҎࡏsubscript ఏڙ༬ઃᆴɻ
SE-0165 Ճڧ Dictionary Set • Dictionary త mapValues •
ݱࡏೳmap೭ޙ࠶खಈݐཱҰ࣍ Dictionaryɻ೭ ޙՄҎሣValue ၏ mapɻ
SE-0165 Ճڧ Dictionary Set • Dictionary Set త
filter • ݱࡏೳfilter ೭ޙ࠶खಈݐཱҰ࣍ Dictionaryɻ೭ ޙՄҎ၏ filter ɼ။ճၚҰݸ Dictionaryɻ
SE-0165 Ճڧ Dictionary Set • ՄҎ౸ Dictionary Set
త༰ྔ • ՄҎखಈ⃧Ճ༰ྔ
SE-0165 Ճڧ Dictionary Set • ՄҎሣ Array ၏ group
by
SE-0166 ෧ଘᢛংྻԽ • ݱࡏೳᯪ NSCoder ိ၏ংྻԽɼॴҎ Struct Enum ෆೳඃংྻԽɻ
• ။৽⃧ Encoder, Decoder, Encodable Decodable protocolိ႔ཧংྻԽɼࢧԉ Class, Struct Enum • ؐ༗ Codable protocol දՄҎग़ڈ࠶ճိ
SE-0166 ෧ଘᢛংྻԽ
SE-0167 ฤᛰث • ఏڙၷछংྻԽతฤᛰثɼ json plist • 㚎ݐతdata type
collection type ՄҎඃࣗಈ • ؐ༗Ұථ Foundation త class แؚ Date, URL • Codable ။ NSKeyed[Un]Archiver ૬༰
SE-0168 ଟߦᏐతࣈ۲ • ࢧԉލߦతࣈ۲ɼ Python Ұᒬ༻ࡾݸძҾᥒိᙛ ։಄݁ඌ • ။Ҏ݁ඌతॖഉҝج४ɼࣗಈᎃ㑌Ұߦ։಄తۭനɻ
SE-0168 ଟߦᏐతࣈ۲
Evolution • SE-0169 ༏Խ private extension ೭ؒత᮫ • SE-0170
NSNumber ڮվળ • SE-0171 ༻ inout ိ reduce • SE-0172 ༗Ұᬑత Range • SE-0173 ৽⃧ MutableCollection.swapAt(_:_:)
SE-0169 ༏Խ private extension ೭ؒత᮫ • ݱࡏprivate member ༗ࡏఆٛతׅᥒൣᅴ㚎࠽ೳ
ଘऔɼಉҰݸ䈕Ҋ㚎ෆߦɼཁվ༻fileprivate • େՈتᓣ༻extension ိఆٛfunctionɼଟ ෆඞཁత fileprivate • ೭ޙಉҰݸ䈕Ҋ㚎త extension ՄҎଘऔ private member
SE-0170 NSNumber ڮվળ • ݱࡏNSNumber Swift త༗ᴍոոత
SE-0170 NSNumber ڮվળ • ্໘తᆴੋ -1 (0x11111111) • ೭ޙ༻ as?
࣌။ߟྔඪతେখɼݱ༗తኺ NSNumber աိతํ๏။ၷݸ
SE-0171 ༻ inout ိ reduce • ။৽⃧Ұݸ Sequence#reduce(into:_) ိ၏ in-place
త reduceɼ䋯ಘൺֱշ • ෆoverload ݱ༗తreduce, Ҽҝ type checker ။่ ௵
SE-0172 ༗Ұᬑత Range • ݱࡏ • ະိ
SE-0173 ৽⃧ MutableCollection.swapAt(_:_:) • ݱ༗త swap ༗ၷݸ inout ჩᏐɼᔒ༗ූ߹ Ownership
తنଇ • ৽⃧Ұݸ༻index ိަత swapAt(indexA, indexB)