Swift Learning Notes (a)-My first Swift program Hello world

Source: Internet
Author: User

The two languages that are currently being developed for iOS are OC and Swift, both of which are currently showing a trend. But in order to develop well, learning two languages is very necessary. Now I'm going to start learning swift. This is my first Swift program--hello world. Apple introduced a very good tool for developing swift in Xcode6, called playground. Using playground can show the output of the current code in real-time, which can be said to be fun.

(1) Open Xcode and select the first option "Get started with a playground".

.


(2) Enter the project name and platform in the dialog box and choose iOS on the platform.


(3) Finally select the storage path, then create. A swift project is completed for creation. You can see that Swift has automatically created several lines of code, and Apple has a humorous explanation for the term playground: a place where people can play. A str variable "Hello,playground" is then declared. You can see the output of this variable in real time on the right. Can be said to be very convenient.


(4) Enter your own code "Hello World" and make the output. You can see that the expected output has already appeared on the right.



(5) Playground also has a very good hint effect, on the right side of the output there is a small eye, click the eye, you can zoom in another window to display the effect.


(6) next to the right side of the small eyes there is a plus, click the plus sign, you can prompt the output under the code. Visible playground is really fun. :


Start Learning Swift!

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Swift Learning Notes (a)-My first Swift program Hello world

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.