Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Swift 週報 5/3
Search
Johnlin
May 03, 2016
Programming
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Swift 週報 5/3
Swift 週報 5/3
Johnlin
May 03, 2016
More Decks by Johnlin
See All by Johnlin
用 MLIR 實作 一個 Ruby IR (intermediate representation)
johnlinvc
0
340
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
430
Ruby 型別檢查工具簡介
johnlinvc
0
640
Swift Actor 實作探索
johnlinvc
0
210
用 mruby 來寫跨平台工具
johnlinvc
0
130
Actor model 簡介
johnlinvc
0
250
一起玩 Helm 3
johnlinvc
1
170
為什麼 App 卡卡的
johnlinvc
2
1.3k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
280
Other Decks in Programming
See All in Programming
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
310
wkhtmltopdfの次どうするか問題2026
willnet
2
1.5k
Heart of Swift Concurrency
koher
0
910
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
290
Security issues being discussed on Web Platforms
petamoriken
0
980
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
250
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
370
AI活用は、個人から組織へ|マルチプレイヤーエージェントハーネス「QM」の社内活用事例 / AI use is moving from individuals to orgs
rkaga
1
120
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
190
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
300
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.1k
Are APIs Still Relevant in the AI Era?
soyuka
0
270
Featured
See All Featured
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Claude Code のすすめ
schroneko
67
230k
Accessibility Awareness
sabderemane
1
210
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
600
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
680
Ruling the World: When Life Gets Gamed
codingconduct
0
340
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Mind Mapping
helmedeiros
1
360
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
990
Balancing Empowerment & Direction
lara
6
1.3k
Transcript
Swift पใ 5/3 John Lin @johnlinvc
From the core • ෦ deprecation ܯࠂঋڃࡨޡ
෦ deprecation ܯࠂঋڃࡨ ޡ print(__FILE__) @warn_unused_result(message="oh no") func F1() ->
Int{ return 42 } for var a = 0; a < 3; a+=1 { a } • Ṝࠣࡏ։ᚙ൛తswift ቮៃኺܯࠂঋڃࡨޡɻҎޙ။࿈compile ෆߦɻ
Evolution • SE-0036 Enum ҰఆཁՃ։಄తᴍ • SE-0048 Generic typealias •
SE-0049 ሡ @noescape ᢛ @autoclosure Ҡࢸ type એࠂ • SE-0057 import Obj-C generics
SE-0036 Enum ҰఆཁՃ։಄త ᴍ enum Coin : CustomStringConvertible { case
heads, tails var description: String { switch self { case .heads: return “heads" //༗Ճᴍ case tails: return “tails" //ᔒՃᴍ } } } print(Coin.heads) • ҎޙҰఆཁՃ։಄తᴍɼ֬อҰகੑ
SE-0048 Generic typealias typealias StringDic = Dictionary<String, String> let dic:StringDic
= ["key" : "value"] • typealias ሡ။෦ࢧԉ Generic typealias StringDictionary<T> = Dictionary<String, T> typealias DictionaryOfStrings<T : Hashable> = Dictionary<T, String>
SE-0049 ሡ @noescape ᢛ @autoclosure Ҡࢸ type એࠂ • ݱࡏ
func fn(@noescape f : () -> () ) {} func fa(@autoclosure f : () -> () ) {} • ະိ func fn(f : @noescape () -> () ) {} func fa(f : @autoclosure () -> () ) {} • ᬋ inout త䳾㑊
SE-0057 import Obj-C generics • @interface MySet<T : id<NSCopying>> :
NSObject -(MySet<T> *)unionWithSet:(MySet<T> *)otherSet; @end @interface MySomething : NSObject - (MySet<NSValue *> *)valueSet; @end • ။ҝ • class MySet<T : NSCopying> : NSObject { func unionWithSet(otherSet: MySet<T>) -> MySet<T> } class MySomething : NSObject { func valueSet() -> MySet<NSValue> }
Evolution • SE-0062 Obj-C key path syntax • SE-0063 Swift
PM ܥ౷ module search path • SE-0064 ༻ #selector ိࢦ getter & setter • SE-0065 Collections & Indices ৽ܕ • SE-0068 ༻ Self ိऔ dynamicType
SE-0062 Obj-C key path syntax class Person: NSObject { dynamic
var name:String = "" init(name: String){ self.name = name } } let john = Person(name: "John") john.valueForKey("name") //Optional(John) john.valueForKey(#keypath(Person.name)) //Optional(John) • ᩋฤᩄث㢨ᒾҰ༗ᔒ༗ଧࡨࣈ
SE-0063 Swift PM ܥ౷ module search path • લSwift ՄҎ
import C Libraryɼୠੋधཁፙ౸ include 䈕(*.h) Ґஔ • ະိሡՄҎࣗಈᩇऔ .pc 䈕ိፙ౸ include 䈕Ґஔ • ။ࢧԉܥ౷ package manager( Homebrew & Apt)
SE-0064 ༻ #selector ိࢦ getter & setter • #selector ՄҎ༻ိऔ
Obj-C త @selector ɻୠੋ ؐແ๏ࢧԉ getter & setter • ະိՄҎऔಘgetter & setter త selector • let firstNameGetter = #selector(getter: Person.firstName) let firstNameSetter = #selector(setter: Person.firstName)
SE-0065 Collections & Indices ৽ܕ • Collection ඃॏ৽ઃܭɼIndex( ForwardIndex, BidirectionalIndex,
RandomAccessIndex) ඃফ໓ ྃɻ • Index ૬᮫తޭೳ။ඃҠਐ Collection தɻ૾ੋ idx.successor() ။ඃ collection.index(after: idx) औ • ଖଞෆडӨڹ( index(of:), min(), sort() )
SE-0068 ༻ Self ိऔ dynamicType • ݱࡏ Self ᮫伴ࣈੋڅ Protocol
༻త • protocol Copyable { init(copy:Self) } • ະိՄҎࡏ class ཫᙛ self.dynamicType ༻ • struct MyStruct { static func staticMethod() { ... } func instanceMethod() { self.dynamicType.staticMethod() //ݱࡏ Self.staticMethod() //ະိ } }