In the past, it was possible to set the editor in such a way that ...for(i=0;i<n;++i){instruction1;...instruction k;} can be replaced by for(i=0;i<n;++i){...}. It was very convenient to compact the edition. However, such functionality doesn't seem to exist on the recent version of Xcode. Is it still existing, and if it is the case how to reach it?
In the past, it was possible to set the editor in such a way that ...for(i=0;i<n;++i){instruction1;...instruction k;} can be replaced by for(i=0;i<n;++i){...}. It was very convenient to compact the edition. However, such functionality doesn't seem to exis
Effectively, this has been removed from the language in Swift 3.
See a complete discussion on the rationale of the Swift design team, here :
h ttps://github.com/apple/swift-evolution/blob/master/proposals/0004-remove-pre-post-inc-decrement.md
2 other points :
what difference do you make between:
for(i=0;i<n;++i){instruction1;...instruction k;}
that can be replaced by
for(i=0;i<n;++i){...}
When you post a question, take care to set a short title and not leave the colmplete question as the title. It will be better for readers.
I think the question is about code folding...though I haven't used 9.x enough to be any help.
>> I think the question is about code folding
In that case, the answer is:
Currently (in Xcode 9.x), you can't code-fold loops in Objective-C source files. You can only fold functions, methods and classes. (Nobody knows why — maybe this will come back in the future).
In Swift, you can fold any scope defined by braces ({ … }), but the code folding ribbon is gone. You have to use the functions on the Editor -> Code Folding submenu, or their keyboard equivalents such as Command-Option-Left/Right Arrow.
>In the past
Right - Current Xcode 9 exhibits changed behavior.
See this previous thread: https://forums.developer.apple.com/thread/78912 and this SO thread: https://stackoverflow.com/questions/46387262/code-folding-changes-in-xcode-9
Got it. In fact question is probably about objC and code folding (which has been already reported as an issue).