Xcode Swift code folding/collapse

前端 未结 5 1575
暗喜
暗喜 2020-12-28 14:10

I know we can use \"Shift + Alt + Cmd + Left\" to fold/collapse swift code in Xcode, but can anyone tell me how to fold/collapse for functions only?

5条回答
  •  隐瞒了意图╮
    2020-12-28 14:28

    you can always go to Symbol Navigator, cmd+2 and enjoy list of all your declarations that swift has organized. However, if this doesn't satisfy you, and you require to have better control over your functions I recommend you to use function protocols, they work somewhat similar to header files in C. you can find out more about function prototypes in(https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Protocols.html#//apple_ref/doc/uid/TP40014097-CH25-ID267)

提交回复
热议问题