The Big Nerd Ranch Swift - End of chapter 21
Summary
- Extension I think it would be good to read the offical document instead of this chpater of this book.
Extensions add new functionality to an existing class, structure, enumeration, or protocol type.
Extensions in Swift can:
Add computed instance properties and computed type properties Define instance methods and type methods Provide new initializers Define subscripts Define and use new nested types Make an existing type conform to a protocol
Syntax? See the offical document link
Leave a comment