Back to Developer Roadmap

Semicolons in Swift

src/data/roadmaps/swift-ui/content/[email protected]

4.0540 B
Original Source

Semicolons in Swift

Semicolons (;) are used in Swift to separate multiple statements on a single line. While Swift doesn't require semicolons at the end of each statement like some other languages, they are necessary when you want to write more than one statement on the same line of code. Otherwise, Swift infers the end of a statement based on the line break.

Visit the following resources to learn more: