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
51
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
49
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
200
Ruby 型別檢查工具簡介
johnlinvc
0
400
Swift Actor 實作探索
johnlinvc
0
130
用 mruby 來寫跨平台工具
johnlinvc
0
56
Actor model 簡介
johnlinvc
0
160
一起玩 Helm 3
johnlinvc
1
100
為什麼 App 卡卡的
johnlinvc
2
1.1k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
160
Other Decks in Programming
See All in Programming
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
170
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
210
Better Code Design in PHP
afilina
PRO
0
120
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
330
Click-free releases & the making of a CLI app
oheyadam
2
110
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
290
Arm移行タイムアタック
qnighy
0
320
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1030
460k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
A designer walks into a library…
pauljervisheath
204
24k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Site-Speed That Sticks
csswizardry
0
24
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Practical Orchestrator
shlominoach
186
10k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Designing for humans not robots
tammielis
250
25k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
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)