According to this site, text files (i.e. source code files) should always end in a new line. But Xcode (as of at least version 7.1) defaults to have no new line at the end of a file unless you explicitly put it there.
There are preferences to strip trailing whitespace and set the default line endings (all in “Xcode -> Preferences -> Text Editing”) but I can’t find a way to automatically add a new line at the end of each file. Can this be done in Xcode?