Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added 2 characters in body; edited title
Source Link
nhgrif
  • 62.2k
  • 25
  • 136
  • 174

swift nonfailable Nonfailable enum initializer with default value

Is there a way to define an enum, when initialized from rawValuerawValue will default to some value instead of failing? Useful in cases where the value may be unexpected (i.e. server API errors)

swift nonfailable enum with default value

Is there a way to define an enum, when initialized from rawValue will default to some value instead of failing? Useful in cases where the value may be unexpected (i.e. server API errors)

Nonfailable enum initializer with default value

Is there a way to define an enum, when initialized from rawValue will default to some value instead of failing? Useful in cases where the value may be unexpected (i.e. server API errors)

Source Link
Morrowless
  • 7k
  • 11
  • 53
  • 85

swift nonfailable enum with default value

Is there a way to define an enum, when initialized from rawValue will default to some value instead of failing? Useful in cases where the value may be unexpected (i.e. server API errors)