Multi-line comments in Xcode

Viewed 77874

Is there a way to comment various lines at the same time in Xcode IDE? Selecting which lines to comment, then clicking somewhere et voilá.. the /* ... */ characters wrapping the code.

Thank you.

11 Answers

I've been using the Command + Shift + 7 for years, but now in Xcode 13.1 it just started to open the help menu instead of commenting the selected block.

Apparently the new command for commenting a selection of code is:

Command + Shift + ?

Edit:

Another solution is to deselect "Show Help menu" in settings > keyboard > App Shortcuts

enter image description here

For xcode 8 ->
sudo /usr/libexec/xpccachectl
restart your computer

Related