Jonny Jonny - 1 year ago 111
Swift Question

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 :)

Answer Source

Do like this:

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download