Folding and Unfolding Source Code
- Steps
With a source file open, click anywhere in the source code.
Choose Editor > Code Folding > Fold Methods & Functions.
Navigate to the method you want to unfold.
Double-click the ellipsis button to unfold the method.
Use the focus ribbon to select the method’s scope.
Click in the focus ribbon to fold the method.

Focus your attention on a particular method or function in source code by hiding the other parts of the source code.
The Code Folding submenu provides several options for folding and unfolding code.
The focus ribbon is located between the editor gutter and the source code. Move the pointer into the focus ribbon to display a scope in the focus box. Then click in the focus ribbon to fold the code in scope.
The video shows the steps for folding all the methods and functions in the source code, unfolding the method naturalSize, and folding the same method using the focus ribbon.
© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-01-09)