Avatar ·

What is // MARK in Swift and how to use this directive correctly in Xcode?

Hello everyone! I'm a beginner iOS developer, learning Swift for about a month. I've noticed that in other people's projects, comments like `// MARK: - ...`, `// TODO: ...`, and `// FIXME: ...` are often used. I understand these are some kind of special markers, but I don't fully understand how they work and why they are needed. For example, in one project I saw this code: ```swift class ViewController: UIViewController { // MARK: - Lifecycle override func viewDidLoad() { super.viewDidLoad() } // MARK: - Actions @IBAction func buttonTapped(_ sender: UIButton) { // TODO: add logic } // MARK: - Helpers func setupUI() { // FIXME: fix constraints } } ``` I tried just writing regular comments like `// Lifecycle`,