Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make parts of the source code "folded" (hidden) in Xcode?

Tags:

xcode

swift

In the Visual Basic.Net I can use

#Region "identifier_string" #End Region

to "fold" (hide) parts of the source code in the editor.

How can I do that in Swift ?

like image 999
Osama Jassim Avatar asked Nov 26 '25 20:11

Osama Jassim


1 Answers

@Eric D.'s answer is perfect.

If you want to mark down some regions then you can use it like as :

// MARK:

Will be preceded by a horizontal divider

// MARK: your text goes here

Puts 'your text goes here' in bold in the drop down list

// MARK: - your text goes here

Puts 'your text goes here' in bold in the drop down list, preceded by a horizontal divider

like image 113
Ashish Kakkad Avatar answered Nov 29 '25 14:11

Ashish Kakkad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!