Custom subscripts were added to Objective-C in 2012. At that time, Chris Lattner was already 2 years into developing Swift and like other good features of Objective-C, subscripts became a part of the Swift language. I did not frequently use custom subscripts in Objective-C, but I did know that they were a part of the language when I needed them. Subscripts in Swift seem, to me, to be a more natural part of the language, possibly because they were part of the language when it was released and not added in later.
In this chapter, you will learn the following topics:
What are custom subscripts
How to add custom subscripts to classes, structures, or enums
How to create read/write and read-only subscripts
How to use external names without custom subscripts
How to use multidimensional subscripts