Search code examples
swiftxcode

Xcode 16.2 text indentation


For some reason my indentation isn't working as expected. I have set it to indent using 4 spaces but for some reason it indents with 2 spaces everywhere in the project. I've tried going on Xcode > System Settings > Text Editing > Indentation Tab. I've also quit Xcode and deleted derived data to no success. I have swiftlint, but nothing in it is about indentation.

I'm stuck. Would love some help.

Screenshot of my text settings in file:

enter image description here

Screenshot of Text Editing > Indentation Tab: enter image description here


Solution

  • Locate the .editorConfig file and ensure your indent value is correctly set there. Make sure that you check root of your project directory.