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
55
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
120
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
250
Ruby 型別檢查工具簡介
johnlinvc
0
460
Swift Actor 實作探索
johnlinvc
0
160
用 mruby 來寫跨平台工具
johnlinvc
0
71
Actor model 簡介
johnlinvc
0
190
一起玩 Helm 3
johnlinvc
1
110
為什麼 App 卡卡的
johnlinvc
2
1.2k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
200
Other Decks in Programming
See All in Programming
Passkeys for Java Developers
ynojima
3
860
関数型まつりレポート for JuliaTokai #22
antimon2
0
100
人には人それぞれのサービス層がある
shimabox
3
670
Javaに鉄道指向プログラミング (Railway Oriented Pro gramming) のエッセンスを取り入れる/Bringing the Essence of Railway-Oriented Programming to Java
cocet33000
2
550
GraphRAGの仕組みまるわかり
tosuri13
2
140
「ElixirでIoT!!」のこれまでとこれから
takasehideki
0
360
Spring gRPC で始める gRPC 入門 / Introduction to gRPC with Spring gRPC
mackey0225
2
490
Prism.parseで 300本以上あるエンドポイントに 接続できる権限の一覧表を作ってみた
hatsu38
1
110
Practical Tips and Tricks for Working with Compose Multiplatform Previews (mDevCamp 2025)
stewemetal
0
120
ktr0731/go-mcpでMCPサーバー作ってみた
takak2166
0
160
Go1.25からのGOMAXPROCS
kuro_kurorrr
1
600
GoのWebAssembly活用パターン紹介
syumai
3
10k
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.4k
Producing Creativity
orderedlist
PRO
346
40k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
228
22k
How GitHub (no longer) Works
holman
314
140k
The Pragmatic Product Professional
lauravandoore
35
6.7k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
650
The Cost Of JavaScript in 2023
addyosmani
50
8.4k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
22k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Being A Developer After 40
akosma
90
590k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
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)