Jonny
Jonny

Reputation: 430

Enum with .default Option

This question is basically to study, there is no "why?" or "instead of ..."

In Swift 3 it is very common to use the .default, exemplifying:


    UIApplication.shared.statusBarStyle = .default
    // from UIStatusBarStyle.default

And I was thinking, how? In my tests I did not succeed, I try something like:


    class Test {
        enum Options {
            case light, default // bad world
        }
    }

Thank you :)

Upvotes: 1

Views: 185

Answers (1)

Muzahid
Muzahid

Reputation: 5186

Do like this:

class Test {
  enum Options:Int {
    case `default`
    case lightContent

  }
}

Upvotes: 6

Related Questions