Tagged: Enum

There are 11 items tagged #Enum.
And there a lots of other tags to explore.

Getting All cases of Enum with Swift CaseIterable

There will be a time when you want to get an array of all enum cases, such as when you want to present them in a list or picker. CaseIterable protocol is what you are looking for.

How to create SwiftUI Picker from Enum

An Enum is one of the data structures that best represents options for the Picker view. Let's learn what we need to do to make an enum usable in a Picker.

How to make Swift Enum conforms to Identifiable protocol

Learn how to make Swift Enum become Identifiable.

How to save enum with associated value in UserDefaults using Swift

Let's learn how to read/write enum with associated value to UserDefaults.

How to save enum in UserDefaults using Swift

Enumeration is a type that I think is perfect for representing options for users, but we can't save it directly to UserDefaults. Let's learn how to read/write enum to UserDefaults.

How to customize automatic synthesizing Codable for enums with associated values

Learn what we can customize when relying on automatic synthesizing Codable for enums with associated values.

Codable synthesis for enums with associated values in Swift 5.5

Swift 5.5 extends the support for the automatic synthesis to enums with associated values. Learn what can be expected from the synthesis code.

How to decode enums ignoring case in Swift Codable

Learn how to make a case insensitive enum.

Does Swift enum retain its associated value

An easy question that you might overlook. Learn this simple fact together in this article.

3 lesser-known ways of using Swift enums

Three language features around Swift enumeration that you might not aware of.

Enum & custom type from primitive JSON type

Swift Codable

See all tags.