Xcode Spell Checking
Did you know that Xcode can spell check your code and comments? Based on my experience working on large teams and large Xcode projects, this is a little-known feature. I routinely find spelling errors, not only in code comments but in symbol names. For the latter, this is particularly frustrating when a misspelled symbol is widely used because correcting that error — a rename that affects a substantial portion of the codebase — produces a large diff.
[…]
In Xcode, you can enable spelling from the Edit menu, Edit > Format > Spelling and Grammar > Check Spelling While Typing. Just like a typical word processor, Xcode will helpfully underline misspelled words and offer to apply corrections.
Even better, Xcode understands variable names and will correctly identify errors in camelCase, snake_case, and other common identifier formats.
A good reminder. I think I used to have this enabled, and then it got turned off, and then I forgot Xcode could check spelling because the option isn’t in the contextual menu like in most apps.
It seems to ignore single-letter prefixes and some multi-letter ones like rw
, but it doesn’t like ns
or most Hungarian notation.
2 Comments RSS · Twitter · Mastodon
I turned it off, because it annoyed me while typing, but I would love to be able to run it as a single pass on any new code.