Search code examples
xcodecode-folding

Code folding in Xcode 8


Is anyone having problem with code folding in Xcode 8? Every time I fold GameScene.swift (or any other file), switch to, for example, AppDelegate.swift, and switch back to GameScene.swift (which were folded before), it unfolds.


Solution

  • Xcode unfortunately neither store nor remembers code folding. It actually resets folded parts after losing focus that file.

    Since the code folding is reset all the time, I personally use this way of refolding:

    To fold all the methods: Shift + Alt + Cmd + <- left

    Place cursor onto the desired method and unfold it by clicking or using shortcut: Alt + Cmd + -> right