๐Ÿ”ฐExtensions

Extensions in Swift can:

  • Add computed instance/type properties.

  • Define instance/type methods.

  • Provide new initializers.

  • Define subscripts.

  • Define and use new nested types.

  • Make an existing type conform to a protocol.

  • (Protocol Extensions) provide default implementations or add additional functionality.

Last updated