All Guides

iOS-Entwicklung mit Swift

Starten Sie die iOS-App-Entwicklung mit Swift und SwiftUI.

Intermediate20 Min.

Setup Steps

1. macOS and Xcode are required (download from Mac App Store)

2. Open Xcode: File > New > Project

3. Select iOS > App template

4. Interface: SwiftUI, Language: Swift

5. Basic SwiftUI structure (ContentView.swift):

swift
import SwiftUI

struct ContentView: View {
    @State private var count = 0
    
    var body: some View {
        VStack {
            Text("Counter: \(count)")
                .font(.largeTitle)
            Button("Increment") {
                count += 1
            }
            .buttonStyle(.borderedProminent)
        }
    }
}

6. Run in Simulator: Cmd+R

7. Add packages with Swift Package Manager:

File > Add Package Dependencies

8. API call with URLSession:

swift
let url = URL(string: "https://api.example.com/data")!
let (data, _) = try await URLSession.shared.data(from: url)
let result = try JSONDecoder().decode(MyModel.self, from: data)

9. Distribute beta tests via TestFlight