Swift syntax က ရှင်းလင်းပြီး ဖတ်ရလွယ်ပါတယ်။ Java/C# လို main() function တစ်ခုအမြဲရေးစရာမလိုဘဲ Playground ထဲမှာ code ကို အပေါ်ကနေအောက်ကို run လုပ်နိုင်ပါတယ်။
import Foundation က dates, strings, collections စတဲ့ common utility တွေသုံးဖို့ Foundation framework ကိုခေါ်တာပါ။ Simple print example အတွက် မဖြစ်မနေမလိုပေမယ့် real code တွေမှာ အသုံးများပါတယ်။
swift
import Foundation
// Program စတင် run သည့်အခါ ဒီလိုင်းက console ထဲကို text ထုတ်ပြမယ်။
print("Hello, World!")Swift က code ကို top-to-bottom ဖတ်ပါတယ်။ ဒီ example မှာ Foundation ကို import လုပ်ပြီး print() function နဲ့ text တစ်ကြောင်းထုတ်ပြထားပါတယ်။
You should see
Hello, World!