How to bring back Code Folding in Xcode 7

Screen Shot 2015-09-17 at 20.15.52

I’ve updated Xcode yesterday from version 6.4 to 7, and lo and behold, I couldn’t find those little triangles anymore that used to let me fold and unfold my code. You know, the ones that let you collapse a method so that code becomes more readable I really don’t like it when a simple upgrade punches me in the face like that.

Turns out that the Xcode upgrade had disabled this setting under Preferences – Text Editing. See the option that reads “Code Folding Ribbon”? It was un-checked after the upgrade, removing the little triangles from the gutter (where you set break points). Enabling it brings our code folding back (see screenshot above).

There are other methods of collapsing code of course: to collapse all methods, hit SHIFT + OPTION + CMD + LEFT CURSOR. Likewise, to open all methods, use SHIFT + OPTION + CMD + RIGHT CURSOR.

To open a single method, you can also click those little three dots in the yellow brackets.

Screen Shot 2015-09-17 at 20.25.30

And finally of course, we can use the menu as before. Head over to Editor – Code Folding for all these options and their respective keyboard shortcuts.

Screen Shot 2015-09-17 at 20.28.36

About Jay Versluis

Jay is a medical miracle known as Super Survivor. He runs two YouTube channels, five websites and several podcast feeds. To see what else he's up to, and to support him on his mission to make the world a better place, check out his Patreon Campaign.

One thought on “How to bring back Code Folding in Xcode 7

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.