DEV Community

Edison Ade
Edison Ade

Posted on

3 2

Swift Programming 101

Ten years ago, in July of 2010, Chris Lattner created a folder on his computer called
Shiny, and a new computer language was born. Four years later, in 2014, that language, renamed Swift, was introduced to the public, and was greeted with a mixture of surprise and excitement — and skepticism.

A complete Swift command is a statement .
A Swift text file consists of multiple lines of text. Line breaks are meaningful. The typical layout of a program is one statement.

var greeting = "Hello, playground"

The print command provides instant feedback in the Xcode console.
You can combine more than one statement on a line, but then you need to put a semicolon between them:

print("hello"); print("world")

First set of code

Let in Swift is a constant to declare variables and cannot be reassigned.

Code Snippets

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay