kodecocodes/swift-style-guide

how to write switch statement

GregDeveaux opened this issue · 1 comments

Hello,
how to write switch statement?

because in the Xcode indentation :

switch example {
    case 1 :
         add code
    case 2 :
         add code
    default :
         add code
}

on the website dev :

switch example {
case 1 :
   add code
case 2 :
    add code
default :
    add code
}

Thanks

Your first example doesn't use this default setting, in the Text Editing preferences.

Screen Shot 2022-05-26 at 6 26 27 PM

Lack of indentation felt weird to me, 8 years ago, but I got used to it and now appreciate it.