Swift: Difference between rawValue and associated value in enumeration

Associated values allows as to store additional custom information along with case values which can be altered every time when we use that case in our code. Each case can have different combination of associated values. Enumeration cases can be pre-populated with default values called rawValues which must be of same type. Raw value for a particular enumeration case is always the same.

Leave a Reply