An enumeration defines a common type for a group of related values and enables you to work with those values in a type-safe way within your code. If you are familiar with C, you will know that C enumerations assign related names to a set of integer values. Enumerations in Swift are much more flexible, and do not have to provide a value for each case of the enumeration. If a value (known as a “raw” value) is provided for each enumeration case, the value can be a string, a character, or a value of any integer or floating-point type. Enumeration Syntax You introduce enumerations with the enum keyword and place their entire definition within a pair of braces: enum SomeEnumeration { // enumeration definition goes here } Here’s an example for the four main points of a compass: enum CompassPoint { case north case south case east case west } The values defined in an enumeration (such as no...
Learn ios programming with us. Topics we will learn: Delegates design patterns Remote notification push notification MVC Mobile app development ios app development apple technology discussion singleton nsurl connection nsurl session blocks functions datatype