Auto Format Xcode Source

I know that a very similar question was asked, but that was a year and a half ago. Things are changing in this period of time, especially with the release of Xcode 4 on us.

My colleague and I are working on creating a library in Objective-C for use on the iPhone and possibly Mac OSX (later). We both work on this, but I do most of the code. Often he implements something, and then passes it to me. He will work on something else, and then I will expand the functionality of what he wrote. He has preferences for his code, for example, leaving the brackets of the opening method in their own line, but I prefer them on the same line as the signature of the method. There are other differences, but I will not go into them here. Is there a built-in tool or even an external tool that I can run after I have checked its code from the repository to change the style to my own? Or even better, can it be automated for each of us, so that when you open the file, it will be formatted to our taste,so that only the files we touch are marked as modified by our version control program?

+3
source share
4 answers

I found a link that should help me with this. I think that the solution will probably be for both my colleague and me, so that we run separate scripts to format the code to your liking.

+1
source

I think that when it comes to this, you should both agree on a coding style. Looking at the history of versions of files that are formatted, you will like each user to turn into a nightmare if you need to split the files at any time in the future.

+2
source

, .

.

, , , .

, , , , . , /. 90% - .

, , , - "" .

- , , , , , , , .

+1

For optional Objective-C formatting in Xcode, check out Xcode 4 Uncrustify

+1
source

Source: https://habr.com/ru/post/1795240/


All Articles