The Big Nerd Ranch Swift - End of chapter 21

less than 1 minute read

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

source code

Leave a comment