Is there a way to hide/unhide all comments in xcode source files?
This would be very helpful when working with code that has way too many comments added.
The answer is actually very simple if you want to comment a continuous sequence of lines. Select the consecutive lines, then simply press ⌘ / .
Begin a comment with a forward slash and two asterisks ( /** ), and terminate it with an asterisk and a forward slash ( */ ). Content you add in between becomes the documentation. Otherwise, use the Code Actions menu in Xcode to generate a template that you fill out.
Cmd + Shift + 7 will comment the selected lines.
You can use fold/unfold to hide/show comments using ⌃⇧⌘↑ and ⌃⇧⌘↓. This is also accessible through View --> Code Folding --> Fold/Unfold Comment Blocks.
Try: Ctrl + Command + Shift + Left Or Ctrl + Command + Left
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With