swift q )b )hscc.cs.nctu.edu.tw/~lincyu/swift/swift02.pdfÜ ) uÀ Ôrg \ êmñxêbÿ ¢rpgÖ ³...
TRANSCRIPT
Swift
Outline• (inheritance) (extension)
• (protocol)
• (generic)
• (automatic reference counting)
• (error handling)
Outline• (inheritance) (extension)
• (protocol)
• (generic)
• (automatic reference counting)
• (error handling)
(1)
(2)
(Override)
• final
is
as as
as? / as! (1)
as? / as! (2)
AnyObject
Any
(Extension)
subscript
Outline• (inheritance) (extension)
• (protocol)
• (generic)
• (automatic reference counting)
• (error handling)
• (adopt)
(conform)
• Java (interface) (implement)
(extension)
Outline• (inheritance) (extension)
• (protocol)
• (generic)
• (automatic reference counting)
• (error handling)
(generic)
• (reuse) (stack)
(generic)
(1)
(2)
(3)
typealias
Outline• (inheritance) (extension)
• (protocol)
• (generic)
• (automatic reference counting)
• (error handling)
• (Automatic Reference Counting, ARC)
Strong Reference Cycle
Weak Reference
Unowned Reference
Outline• (inheritance) (extension)
• (protocol)
• (generic)
• (automatic reference counting)
• (error handling)
do-catch / try / throws / throw (1)
do-catch / try / throws / throw (2)
as?