Can you set code regions in Xcode?

前端 未结 6 1321
忘掉有多难
忘掉有多难 2020-12-31 01:03

When writing c#, in Visual Studio, you can set regions to group code accordingly. Being new to Xcode I can\'t seem to find a similar feature.

6条回答
  •  借酒劲吻你
    2020-12-31 01:32

    If you want to have a folding zone with a custom section of your code then put your desired code inside braces { }, and it will become a folding zone.

    But you have to keep in mind that braces also define variables scope, so this code should not have variables declarations which will be used outside these brackets.

提交回复
热议问题