Code Folding in Xcode

Hi


I have some parts of code that isnt inside a function such as a big array, is it possible to make that area foldable in Xcode 11.3 ?

--

Kindest Regards

Answered by Claude31 in 411377022

Could you show this part of code ?


I tested:


let arr = ["1",
        "2",
        "3",
        "4"]

I can fold on one line

let arr = [•••]

Everything is foldable, even a var or struct or enum declaration outside of a class.


So what is your exact case ?

I defined a long Array inside a ViewController, I dont see its foldable only the whole ViewController code and the functions !

Accepted Answer

Could you show this part of code ?


I tested:


let arr = ["1",
        "2",
        "3",
        "4"]

I can fold on one line

let arr = [•••]

Aha got it, my array was like a one long line, once I brake it into 2 lines by hitting enter the folding showed

Code Folding in Xcode
 
 
Q