Let’s begin with the basics of Swift.
One or more values are printed to the terminal using the
print("Welcome to Swift!") // Prints: Welcome to Swift!
From top to bottom, the programs runs line by line:
print("Hello") print("Swift World!")
Two consecutive forward slashes are used to make single-line comments in Swift. Any text after
// on the same line is ignored by the compiler.
// This is a single-line comment an it will be ignored by the compiler.
Multiline comments are written by beginning the comment with
/* and ending it with
*/. Any text in between is ignored by the compiler.
/* This is a multi-line comment all of this will be ignored by the compiler */
Here are some useful tools to help you along your journey!
Setting up an IDE (Integrated Development Environment) can be difficult for beginners. The Online Compiler will enable you to run your code inside your browser without the need to install an IDE. If you need a more detailed explanation of a specific topic, the best place to find answers is in the Official Documentation.