ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်
App တစ်ခုကို Simulator (ဒါမှမဟုတ် physical device) ပေါ်မှာ run ဖို့ Run (▶ ဒါမှမဟုတ် Cmd+R) ကို နှိပ်ရုံပါပဲ — Xcode က code ကို compile လုပ်ပြီး, app bundle ကို build ကာ Simulator ပေါ် install/launch လုပ်ပေးပါတယ်။ `ContentView` ကို `WindowGroup { ContentView() }` ထဲမှာ root view အနေနဲ့ ခေါ်ထားရင် app ဖွင့်တာနဲ့ အဲဒီ UI ချက်ချင်း ပေါ်လာပါလိမ့်မယ်.
လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
`ContentView.swift` ထဲမှာ `var body: some View { Greeting(name: "iOS") }` လို့ ရေးထားရင်, app ကို Run လိုက်တာနဲ့ Simulator screen ပေါ်မှာ 'Hello, iOS!' ဆိုတဲ့ text ချက်ချင်း ပေါ်လာပါလိမ့်မယ် — ဒါက သင့်ရဲ့ ပထမဆုံး တကယ့် iOS app ပါပဲ.
အတူတူ ကြည့်မယ်
struct ContentView: View {
var body: some View {
Greeting(name: "iOS")
}
}Simulator screen ပေါ်မှာ 'Hello, iOS!' ဆိုတဲ့ text ကို တွေ့ရမည်။၅ မိနစ် စမ်းကြည့်
`ContentView.swift` ကို edit လုပ်ပြီး `Greeting(name: "iOS")` ထည့်ကာ Run (Cmd+R) နှိပ်ကြည့်ပါ — Simulator ပေါ် app ချက်ချင်း launch ဖြစ်တာ confirm လုပ်ကြည့်ပါ။
သတိလေးတစ်ချက်
ပထမဆုံး build/Simulator boot က (Mac performance အလိုက်) မိနစ်အနည်းငယ် ကြာနိုင်ပါတယ် — 'stuck နေတယ်' လို့ မထင်ဘဲ progress indicator ကို စောင့်ကြည့်ပါ။