0Pricing
SwiftUI Academy · Ders

Bir SwiftUI Uygulama Dosyasının Yapısı

@main, App, WindowGroup ve ContentView kavramlarını anlayın.

Bir SwiftUI Uygulama Dosyasının Yapısı, CoddyKit'te ücretsiz bir SwiftUI Academy dersidir. Bu, 4 dersinin 2. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, SwiftUI Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. SwiftUI Academy kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

The App File

Every SwiftUI project has a file named after your app, like MyFirstApp.swift. This app file is the true entry point where your whole app begins. 📱

The @main Marker

The @main attribute tells Swift exactly where your program starts. iOS launches your app by running the type marked with it.

@main
struct MyFirstApp: App {
}

Conforming to App

Your main struct conforms to the App protocol. This is the SwiftUI blueprint for an application, describing what scenes it shows.

The body Property

Inside the App struct, a body property describes your app's scenes. SwiftUI reads it to know what to display when the app launches.

var body: some Scene {
    WindowGroup {
        ContentView()
    }
}

Scenes, Not Views

The app's body returns a Scene, not a View. A scene is a container for a window or screen that holds your actual views inside it.

WindowGroup

WindowGroup is the most common scene. It manages your app's main window and, on iPhone, simply fills the whole screen.

Your Root View

Inside WindowGroup you place your root view, usually ContentView(). It is the first screen the user sees when the app opens.

ContentView Lives Apart

ContentView sits in its own file, separate from the app file. Keeping the entry point and the UI apart keeps your project tidy and clear.

How It Flows

The chain is simple: @main starts the App, the App shows a WindowGroup, and the WindowGroup displays your ContentView. ✨

One @main Only

An app can have just one @main entry point. The template already provides it, so you rarely add or change this part yourself.

Where You Work

You will spend most of your time editing views like ContentView, not the app file. The app file mostly just wires everything together.

Quick Check

What is the job of the WindowGroup scene in the app file?

Recap

You learned the chain: @main on the App struct returns a WindowGroup scene that shows ContentView. That is how a SwiftUI app boots up. 🧩

Sıkça Sorulan Sorular

“Bir SwiftUI Uygulama Dosyasının Yapısı” dersi ücretsiz mi?

Evet — “Bir SwiftUI Uygulama Dosyasının Yapısı” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve SwiftUI Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. SwiftUI Academy kursu toplamda 4 dersten oluşur.

“Bir SwiftUI Uygulama Dosyasının Yapısı” dersinde ne öğreneceğim?

@main, App, WindowGroup ve ContentView kavramlarını anlayın. SwiftUI Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

SwiftUI Academy öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te SwiftUI Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 2. dersidir.

“Bir SwiftUI Uygulama Dosyasının Yapısı” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu SwiftUI Academy dersinde kod yazıp çalıştırabilir miyim?

Evet. Her SwiftUI Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Xcode’u Yükleme ve Proje Oluşturma
  2. Bir SwiftUI Uygulama Dosyasının Yapısı
  3. Canlı Önizleme Tuvali
  4. Simülatörde ve Aygıtta Çalıştırma
← SwiftUI Academy Sayfasına Dön