Does Xcode support regions?

后端 未结 8 1364
慢半拍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:36

    A useful option in XCode 12 (maybe before), is an option in preferences "Code Folding Ribbon"

    When you check it, the source code looks like this

    When you hover the mouse over this ribbon, you get foldable regions based on brackets, like this

    When you click the Ribbon, it folds the bracket region, like this

    Its not as the regions in Visual Studio, where you can place them wherever you want, but they're good enough to tidy up your code files.

提交回复
热议问题