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 2018/09/04
Search
Johnlin
September 04, 2018
Programming
0
64
Swift weekly 2018/09/04
Johnlin
September 04, 2018
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
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
670
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
220
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
Macとオーディオ再生 2024/11/02
yusukeito
0
370
受け取る人から提供する人になるということ
little_rubyist
0
230
CSC509 Lecture 09
javiergs
PRO
0
140
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
130
as(型アサーション)を書く前にできること
marokanatani
10
2.7k
Quine, Polyglot, 良いコード
qnighy
4
640
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
The Invisible Side of Design
smashingmag
298
50k
BBQ
matthewcrist
85
9.3k
Statistics for Hackers
jakevdp
796
220k
What's in a price? How to price your products and services
michaelherold
243
12k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Typedesign – Prime Four
hannesfritz
40
2.4k
Code Review Best Practice
trishagee
64
17k
Transcript
Swift पใ 2018/09/04 John Lin @johnlinvc
From the core • Swift 5: Start your engines
Swift 5: Start your engines • Release date: Late 2018
• ඪ: ABI stability (again) ɼแؚ generic, API resilience, memory ownership model • ။Լ૬༰ 4
Evolution • [SE-0220] count(where:) • [SE-0224] Support 'less than' operator
in compilation conditions • [SE-0225] isEven, isOdd, isMultiple • [SE-0226] Package Manager Target Based Dependency Resolution
[SE-0220] count(where:) • ཁዎᒬᏐ [1,2,3,4,5,6,7] ཫ໘༗ଟগۮᏐ䏆ʁ [1,2,3,4,5,6,7].filter { $0 %
2 == 0 }.count • Ṝᒬతሜ๏ଖመ䋯తൺֱຫɼfilter ။ઌ䋯Ұ࣍ ᅲɼ count ။࠶䋯Ұ࣍
[SE-0220] count(where:) [1,2,3,4,5,6,7].reduce(0) { $0 + ($1 % 2 ==
0 ? 1 : 0) } • Ṝᒬతሜ๏䋯తൺֱշɼୠੋ䔟㣛ੋࡏ၏ॄኄɻ
[SE-0220] count(where:) var count = 0 for n in [1,2,3,4,5,6,7]
{ count += n % 2 == 0 ? 1 : 0 } • reduce Ұᒬշɼෆաɻ
[SE-0220] count(where:) [1,2,3,4,5,6,7].count{$0 % 2 == 0} • ৽⃧ Sequence#countɼ䋯ىိ
reduce Ұᒬշɼ ෆաൺֱ໌֬ɻ
[SE-0224] Support 'less than' operator in compilation conditions #if swift(>=5.0)
print("this is 5.0") #endif • ݱࡏՄҎ༻্໘తํ๏ိᏗ Swift ൛ຊ • ෆաೳ༻ >=ɼཁখԙೳ༻ ! ိᒾҰෆੋ >= #if !swift(>=5.0) print("this is not 5.0") #endif
[SE-0224] Support 'less than' operator in compilation conditions #if swift(<5.0)
print("this is not 5.0") #endif • ೭ޙՄҎ༻ < ိᏗ Swift ൛ຊ
[SE-0225] isEven, isOdd, isMultiple • ᧷ಘ㑌࣍ཁሜ n % 2 ==
0 䆩ʁ • େՈ᧷ಘ -3 % 2 ੋଟগ䏆ʁ
[SE-0225] isEven, isOdd, isMultiple • ༗ਓఏҊཁՃ n.isEven, n.isOdd, n.isMultiple(of:) •
࠷ޙ༗ n.isMultiple(of:) ௨աɼ။Ճ౸ Swift 5 ཫɻ • ֩৺ᅶୂ᧷ಘ isEven Ṝछ؆ᄸతେՈࣗݾሜबɻ رೳޠݴతද໘ੵେখ߇੍ɻ
[SE-0226] Package Manager Target Based Dependency Resolution • Ұݸ Package
ཫ໘ৗৗ༗ଟෆಉ target, 㑌ݸ target ༗֤ࣗత dependencyɻݱࡏ༻ྃҰݸ Package ब။ॴ༗త dependency ਐိɼ೭ ޙ။༗༻౸త targetɻ
ྛ [SE-0226] Package Manager Target Based Dependency Resolution ߳া ᘈᘈ
ᘆࢠ थ
ྛ [SE-0226] Package Manager Target Based Dependency Resolution ߳া ᘈᘈ
ᘆࢠ थ
Community • 㟬ঋڃ iOS beta ྃ䆩ʁ • 㟬ใ໊ iplayground ྃ䆩ʁ
iOS 12 beta upgrade •
iPlayground • https://iplayground.io 10/20()-21(ʣ • ݱਖ਼ᄧථɼ㐸ߘதɻ