25 lines
677 B
Markdown
25 lines
677 B
Markdown
|
---
|
||
|
title: Comments
|
||
|
---
|
||
|
## Comments
|
||
|
|
||
|
Comments allow you to document your code. Comments are ignored by the Swift compiler, and are only useful for people reading your code base.
|
||
|
|
||
|
Single-line comments begin with two forward-slashes `//`.
|
||
|
|
||
|
#### Example:
|
||
|
```swift
|
||
|
// Hello, single-line comment!
|
||
|
```
|
||
|
|
||
|
Multiline comments begin with a forward-slash followed by an asterisk `/*` and ends with an asterisk followed by a forward-slash `*/`
|
||
|
|
||
|
#### Example:
|
||
|
```swift
|
||
|
/* Hello,
|
||
|
multiline-line comment! */
|
||
|
```
|
||
|
|
||
|
#### More Information:
|
||
|
- <a href='https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html#ID315' target='_blank' rel='nofollow'>The Swift Programming Language</a>
|