Re:On Apple's Love Affair with Swift
by valuearb on Saturday August 11, 2018 @06:43PM
(#17741943)
Your array of NSString example has little to do with generics. Instead think of a class that contains an NSArray, and has methods to do specific things to the array items, for example a sort() method. Using generics you can define the array values to match the type given when the class is created. So the same class could contain NSStrings, UImages, UIControls, etc, etc, and sort accordingly.
[ Parent
| on HN ]
There are no comments on this comment yet.