Does Xcode support regions?

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

    One nice solution I just found:

    Put your project into one big namespace. Close and reopen this namespace for the individual sections of your source file:

    namespace myproj { // members of class MyClassA
    
    void MyClassA::dosomething()
    {
    }
    
    void MyClassA::dosomethingelse()
    {
    }
    
    } // members of class MyClassA
    namespace myproj { // members of MyClassB
    
    void MyClassB::dosomething()
    {
    }
    
    void MyClassB::dosomethingelse()
    {
    }
    
    } // members of MyClassB
    

提交回复
热议问题