Swift Programming Tutorial

Master iOS and macOS development with Swift

🚀 Welcome to Swift!

Swift is Apple's powerful programming language for iOS, macOS, watchOS, and tvOS development. It's designed to be safe, fast, and expressive for modern app development.


// Your first Swift program
print("Hello, Swift World!")
print("Welcome to iOS development!")
                                    

Output:

Hello, Swift World!

Welcome to iOS development!

Why Learn Swift?

📱

iOS Development

Build iPhone and iPad apps

import UIKit
// iOS app development
💻

macOS Apps

Create desktop applications

import Cocoa
// macOS development
âš¡

Fast & Safe

Memory safe with high performance

var name: String = "Swift"
// Type safety built-in
🎯

Modern Syntax

Clean and readable code

let numbers = [1, 2, 3, 4, 5]
// Simple and elegant

🔹 Swift Tutorial Topics

Master Swift programming step by step:

📚 Complete Swift Course:

  • Swift Overview - Understanding Swift language
  • Environment Setup - Installing Xcode and tools
  • Basic Syntax - Writing your first Swift code
  • Variables - Storing and changing data
  • Constants - Fixed values in Swift
  • Literals - Different types of values

🔹 Quick Swift Example

See how easy Swift programming can be:

// Variables and Constants
var userName = "John"
let appName = "MyApp"

// Functions
func greetUser() {
    print("Welcome to \(appName), \(userName)!")
}

// Arrays
let fruits = ["Apple", "Banana", "Orange"]

// Call function
greetUser()

// Loop through array
for fruit in fruits {
    print("I like \(fruit)")
}

Output:

Welcome to MyApp, John!

I like Apple

I like Banana

I like Orange

🧠 Test Your Knowledge

What company created Swift?