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?
It is a great feature to have. It seems too few developers know about this. Especially when writing code in SwiftUI, I like to see that my code works before refactoring it into separate views.
Folding is a great tool to have.
Here an example in Xcode 12. It is not active by default but you need too check the box "Code Folding Ribbon" in the preferences:
and you can fold nested views as deep as you like, with animation: