Does Xcode support regions?

后端 未结 8 1350
慢半拍i
慢半拍i 2020-12-06 04:15

Does Xcode support anything akin to Visual Studio style #region directives for arbitrary code folding?

8条回答
  •  抹茶落季
    2020-12-06 04:26

    That won't work in the place you want it most, that is, around groups of functions or methods.

    It may be useful inside a long, linear method with no internal conditionals or loops, but such methods aren't common in general Mac OS X UI code, though if you're writing some big numeric or graphics-crunching code it could help group things.

    And the if(fold) is entirely superfluous. Just use the braces inside a method or function and Xcode will fold them.

提交回复
热议问题