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-04-11
Search
Johnlin
April 11, 2017
Programming
0
110
Swift Weekly 2017-04-11
Johnlin
April 11, 2017
Tweet
Share
More Decks by Johnlin
See All by Johnlin
用 MLIR 實作 一個 Ruby IR (intermediate representation)
johnlinvc
0
220
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
320
Ruby 型別檢查工具簡介
johnlinvc
0
540
Swift Actor 實作探索
johnlinvc
0
180
用 mruby 來寫跨平台工具
johnlinvc
0
100
Actor model 簡介
johnlinvc
0
220
一起玩 Helm 3
johnlinvc
1
140
為什麼 App 卡卡的
johnlinvc
2
1.2k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
230
Other Decks in Programming
See All in Programming
2026年 エンジニアリング自己学習法
yumechi
0
140
Implementation Patterns
denyspoltorak
0
290
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
240
AI巻き込み型コードレビューのススメ
nealle
2
370
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
200
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.2k
Fluid Templating in TYPO3 14
s2b
0
130
AI時代の認知負荷との向き合い方
optfit
0
160
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
590
dchart: charts from deck markup
ajstarks
3
990
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
740
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.4k
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
260
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
190
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
140
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
180
The Spectacular Lies of Maps
axbom
PRO
1
520
Docker and Python
trallard
47
3.7k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
83
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
250
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
120
Transcript
Swift पใ 2017/04/11 John Lin @johnlinvc
From the core • Xcode 8.3 & Swift 3.1
Xcode 8.3 & Swift 3.1 • Swift 3.1 Լࢧԉ Swift
3.0 ఔࣜᛰ • ৽⃧ྃڐଟ৽ޭೳ • ཁঋڃܥ౷౸ Sierra ࠽ೳ Xcode 8.3
Xcode 8.3 & Swift 3.1 • Sequence ৽⃧ྃ drop(while:) &
prefix(while:) • @available(swift, obsoleted: 3.1) • Int(exactly: 3.14) • ݅ཧث။ࣗಈ㗞ੜ Package.pins ိه㑚መࡍ ༻త൛ຊ
Xcode 8.3 & Swift 3.1 • ެࠂ্ᔒሜత৽ޭೳ, ՄҎሣextension ࢦఆ associated
type • 1> extension Array where Element == Int { 2. var sum: Int { 3. return self.reduce(0){$0 + $1} 4. } 5. } 6> [1,2,3].sum $R0: Int = 6
Evolution • SE-0104 Ꮠ Protocol • SE-0156 Class existential •
SE-0157 ᬇ associated type • SE-0158 Swift ݅ཧثඳड़䈕֨ࣜमվ
SE-0104 Ꮠ Protocol • ᩋෆಉେখతIntɼൺํ㘸 Int8 Int32 ՄҎޓ૬ൺ େখ
• ୠੋؐෆೳᩋෆಉେখతIntɼൺํ㘸 Int8 Int32 Ұى၏Ճݮငআ
SE-0156 Class existential • ݱࡏՄҎࢦఆҰݸ݅ූ߹ଟݸProtocol • ະိ။ Obj-C ҰᒬؐՄҎࢦఆBase Class
• ෆաᷮݶԙ Class, ෆೳࢦఆBase Structɻ
SE-0156 Class existential • protocol ။ڣ{} protocol ။ಈ{} class ಈ
: ။ಈ {} class יࢠ : ಈ, ။ڣ {} class ӊᴰ : ಈ {} class ి෩ઔ : ။ಈ, ။ڣ {} • let : ಈ & ။ڣ & ။ಈ = יࢠ() //OK let : ಈ & ။ڣ & ။ಈ = ӊᴰ() //X ӊᴰෆ။ڣ let : ಈ & ။ڣ & ။ಈ = ి෩ઔ() //X ి෩ઔෆੋಈ
SE-0157 ᬇ associated type • ݱࡏత protocol తՄҎࢦఆ associated type
త protocol protocol Tree { associatedtype Subtree:Hashable } • ୠੋෆೳࢦఆࣗݾ
SE-0157 ᬇ associated type • ೭ޙprotocol ՄҎࢦఆ associated type ੋࣗݾɻ
• ။༻Ṝݸ৽ޠ๏ိվඪ४വࣜݿɼൺํ㘸 Collection త Subsequence ཁੋ Collectionɼؐඞਢཁ༗Ұ ᒬత Indexɻ
SE-0158 Swift ݅ཧثඳड़ 䈕֨ࣜमվ • վྃҰࠣେখሜɻ • Dependency తሜ๏Ꮣྃɻ༬ઃతঋڃൣᅴᏓኍྃɼ رେՈೳଟঋڃ
SE-0158 Swift ݅ཧثඳड़ 䈕֨ࣜमվ • //1.x.x ൛ՄҎ ݱࡏ: .Package(url: "/SwiftyJSON",
majorVersion: 1) ະိ: .package(url: "/SwiftyJSON", from: "1.0.0") ҃ੋ .package(url: "/SwiftyJSON", .upToNextMajor(from: "1.0.0"))
SE-0158 Swift ݅ཧثඳड़ 䈕֨ࣜमվ • //1.1.x ൛ՄҎ ݱࡏ: .Package(url: "/SwiftyJSON",
majorVersion: 1, minorVersion: 1) ະိ: .package(url: "/ SwiftyJSON", .upToNextMinor(from: "1.1.0"))
SE-0158 Swift ݅ཧثඳड़ 䈕֨ࣜमվ • .package(url: "/SwiftyJSON", .exact("1.1.6")) //ೳ ༻
1.1.6 ൛ • .package(url: "/SwiftyJSON", "1.2.3"..<"1.2.6"), // 1.2.3 ൛ ౸ 1.2.6 ೭ؒՄҎɼෆแؚ 1.2.6 • .package(url: "/SwiftyJSON", "1.2.3"..."1.2.6"), //1.2.3 ൛ ౸ 1.2.6 ೭ؒՄҎɼแؚ 1.2.6
SE-0158 Swift ݅ཧثඳड़ 䈕֨ࣜमվ • .package(url: "/SwiftyJSON", .branch("develop")) // ༻
develop branch • .package(url: "/ SwiftyJSON", .revision("e74b07278b926c9ec6f9643 455ea00d1ce04a021")) //༻ಛఆ commit
Evolution • SE-0160 䫐ݶᯅత @objc ඪḼ
SE-0160 䫐ݶᯅత @objc ඪḼ • ݱࡏཁ class ঝ NSObject ɼԼ໘త
method ब ။ࣗಈ㚎ݐ @objc • ະိཁࣗݾखଧ @objc
SE-0160 䫐ݶᯅత @objc ඪḼ • dynamic ཁखଧ @objc
SE-0160 䫐ݶᯅత @objc ඪḼ • 㑌ݸखଧྦྷతՄҎ༻ @objcMembers ိᩋ class ཫతMethod
༗ @objc
SE-0160 䫐ݶᯅత @objc ඪḼ • େ෦త @objc ཁࣗݾଧɼୠؐੋ༗Ұࠣ။㚎ݐ @objc తྫ֎
• override method • መ࡞ @objc త protocol ࣌ • @IBOutlet @IBAction @NSManaged
SE-0160 䫐ݶᯅత @objc ඪḼ • Ṝࠣ။ࡏ Swift 4.0 త࣌ީመɻ •
။Լ૬༰ • ฤᩄత࣌ީબ swift 3 ࣜबՄҎෆ༻ଧɼୠੋ။༗ warning ܯࠂ೭ޙෆೳ༻ɼؐ༗fixit 㢨ॿࣗಈɼ