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
52
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
82
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
220
Ruby 型別檢查工具簡介
johnlinvc
0
420
Swift Actor 實作探索
johnlinvc
0
140
用 mruby 來寫跨平台工具
johnlinvc
0
66
Actor model 簡介
johnlinvc
0
170
一起玩 Helm 3
johnlinvc
1
110
為什麼 App 卡卡的
johnlinvc
2
1.1k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
180
Other Decks in Programming
See All in Programming
Datadog DBMでなにができる? JDDUG Meetup#7
nealle
0
160
Your Architecture as a Crime Scene:Forensic Analysis @bastacon 2025 in Frankfurt
manfredsteyer
PRO
0
100
Lambdaの監視、できてますか?Datadogを用いてLambdaを見守ろう
nealle
2
790
5分で理解する SOLID 原則 #phpcon_nagoya
shogogg
1
410
The Clean ArchitectureがWebフロントエンドでしっくりこないのは何故か / Why The Clean Architecture does not fit with Web Frontend
twada
PRO
56
18k
Rails 1.0 のコードで学ぶ find_by* と method_missing の仕組み / Learn how find_by_* and method_missing work in Rails 1.0 code
maimux2x
1
260
Introduction to C Extensions
sylph01
3
120
Duke on CRaC with Jakarta EE
ivargrimstad
0
180
「個人開発マネタイズ大全」が教えてくれたこと
bani24884
1
300
.NET Frameworkでも汎用ホストが使いたい!
tomokusaba
0
210
CDK開発におけるコーディング規約の運用
yamanashi_ren01
2
260
PHPカンファレンス名古屋2025 タスク分解の試行錯誤〜レビュー負荷を下げるために〜
soichi
1
760
Featured
See All Featured
Making Projects Easy
brettharned
116
6k
A Philosophy of Restraint
colly
203
16k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
260
Code Review Best Practice
trishagee
67
18k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
Statistics for Hackers
jakevdp
797
220k
Bash Introduction
62gerente
611
210k
What's in a price? How to price your products and services
michaelherold
244
12k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
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)