[swift] Hello Swift

The conclusion before writing Swift language

let lang= “Swift” println(“Oh my \(lang)”)

2. Using comment can be used // or /*… */

the comment on Swift is still c-style : // for single line /*

3. Assigning variable both of var and let

let use for the variable cannot be changed value if you want to change value on runtime you could use var keyword

When the end of statement unnecessary use ; if the statement is too short, you use ; for create next statement

5. Don’t worry about break keyword

for c-style, writing the code for condition switch, often you miss break keyword it makes the code run out of command but the Swift language prevent it

6. Writing method with func keyword

When you create method or function, the easy keyword you can write func

Originally published at windowsdna.blogspot.com on June 17, 2015.