# Swift Comments

> Learn how to write comments in Swift, including single-line comments, multi-line comments, and the handy ability to nest multi-line comments together.

Author: Flavio Copes | Published: 2021-05-29 | Canonical: https://flaviocopes.com/swift-comments/

> This tutorial belongs to the [Swift](https://flaviocopes.com/swift-introduction/) series

A comment in Swift can take 2 forms: a single-line comment, and a multi-line comment.

A single-line comment is

```swift
//this is a comment
```

and it can be put at the end of a line of code:

```swift
let a = 1 //this is a comment
```

A multi-line comment is written using this syntax:

```swift
/* this
 is
    a multi-line
 comment
*/
```

Swift allows to nest multi-line comments:

```swift
/* this
 is
    a /* nested */ multi-line
 comment
*/
```

which is handy especially when commenting out large portions of code that already contains multi-line comments.
