Code warehousing was disabled in Xcode 9 beta 1, which is now working, in Xcode 9 Beta5 according to the beta note: Solved in Xcode 9 beta 5 - IDE
Here's how:
- Press and hold the
β (command) button on the keyboard and move / hover your mouse over any (start or end) curly braces. It will automatically highlight the block area. - Hold (hold)
β (command) and press the highlighted area. This will allow you to quickly open the menu window with the Fold option. - Select
Fold from the menu list. It will add your code and display 3 points, folding / closing the entire block. - Now, to expand your code block again, release the
β (command) button and click on 3 points, folding the block.
For convenience, see this snapshot:

All manual cuts also work.
Fold β₯ β β option + command + left arrow Unfold β₯ β β option + command + right arrow Unfold All β₯ U option + U Fold Methods & Functions β₯ β β option + command + up arrow Unfold Methods & Functions β₯ β β option + command + down arrow Fold Comment Blocks β β§ β β control + shift + command + up Unfold Comment Blocks β β§ β β control + shift + command + down Focus Follows Selection β β₯ β F control + option + command + F Fold All β β₯ β§ β command + option + shift + left Unfold All β β₯ β§ β command + option + shift + left
Options for adding code from the Xcode menu :
Menubar β Editor β Code Fold β βHere is a list of code folding optionsβ
Here is a snapshot of ref:

Same parameters from Xcode abbreviated list :
Menubar β Xcode β Preferences β Key Bindings β βHere is a list of code keys with short keysβ

Krunal
source share