In the same way, they can define attributes to store values, and they can also define functions. They can define subscripts to provide access to values. Subscript Syntax. They can define initializers to set their initial states. Using init(), they can extend (Extensions in Swif