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?
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)