A Swift Tour
First program in a new language should print the words "Hello World!" on the screen.In Swift,this can be done in single line
print("Hello,World!")
If you have written code in C or objective c,this syntax looks familiar to you-in swift,this line of your code is a complete program.you don't need to import a separate library for functionning like input/output or string handling.code written at global scope is used as a entry point for program,so you don't need a main function.You also don't need to write semicolons at end of every statement.

No comments:
Post a Comment