Reputation: 64906
I have a project with a large codebase, where newer modules are being added in Swift 3, but most of the code is in Objective C. Like many projects, our Swift style uses 2 spaces for indentation. The legacy Objective C codebase, however, uses 4 spaces.
Is there any way in Xcode 8+ to configure indentation on a per file type basis? If not, is there a better alternative to:
Both of the above seem like bad ideas, but without Xcode support for per file type configuration, there seems to be no other way.
Upvotes: 2
Views: 2316
Reputation: 5747
To answer your question of:
Is there any way in Xcode 8+ to configure indentation on a per file type basis?
Yes, there is. On the File Inspector
of each file, you can set the Indent
type to Spaces
or Tab
and also the number of spaces
.
I have attached the screenshot here:
You can select multiple file and update the settings at the same time. The settings here will overwrite what you have set in the Preferences > Text Editing > Indentation
.
Upvotes: 8