🌟 Swift Syntax & Structure
Learn how Swift code is structured — from your first function call to understanding its syntax rules.
📝 Basic Swift Program Structure
Output will appear here...
📖 Key Syntax Rules
- Swift programs use
import
statements to access libraries.
- Use
print()
to output text to the console.
- Statements do not require semicolons unless multiple statements are on the same line.
- Variables and constants are declared using
var
and let
.
- Curly braces
{ }
define code blocks for functions and control statements.
💡 Tip: Swift is type-safe — always assign values matching the expected type, unless using Any
.