قالب وردپرس درنا توس
Home / IOS Development / Has the default entry in Xcode been changed? : iOSProgramming

Has the default entry in Xcode been changed? : iOSProgramming

I'm still in the early stages of learning Swift / Xcode so apologetic if this is a simple question, but I couldn't find the answer anywhere on the web.

I work through Ray Wenderlich course which gives you playground files that you then add your own code to. I look back at some of my previous work on these edited files, and I have noticed that when there is an open set of curly braces, the following block of code is either indented 2 spaces or 4 spaces. It wasn't initially clear to me what caused some blocks to stretch differently than others.

When I enter my own code, I notice that blocks are automatically framed 4 spaces. This leads me to believe that the Ray Wenderlich source material is what contained the 2-space code block.

Does anyone know why this can be? Was the Xcode standard set by default, and at some point changed to 4? Below is an example of what I am talking about. It is a little trivial question, but it makes me angry that my code looks a little different than yours when I follow and write the examples out myself.

  class exampleCode {

Source link