In this tutorial, we will learn the basic syntax of Swift language. We will go through the key components of a simple Swift program.
import Foundation
print("Hello, World!")
Hello, World!
import Foundation
print("Hello, World!")
print
function to output the string "Hello, World!" to the standard output (usually the console).;
), although it's often omitted and optional.print
and Print
would be considered different.//
for single-line comments or /* ... */
for multi-line comments.