Swift _ xcode Basics

Source: Internet
Author: User

Android L has already been announced at the Development Conference, and the technology has to keep up with the trend of the times. To develop in the mobile Internet, I have to work hard to learn HTML + JS and OC! I will not write about server O & M, even my own life records. Android has always wanted to write the truth, and found that he liked writing continuously, just like xianjian. It should be the kind that can make people think of, and it is not good at writing, let's start with these basics.

In a daze .....

In the previous tutorial, after xcode6 was installed, I opened the xcode start interface and suddenly found get start playground. I 've been waiting for him to be a magic horse ....

After you click get start playground, there is a big surprise on the interface. This is a real-time page that often appears in HTML. Remember to use the blog to write the MD syntax. It is such a page ....



Okay, the pace of VaR JS !! I was so excited that OC and JS were combined. Swift was indeed an artifact.

Next part of the code

// Playground-noun: a place where people can playimport cocoavar STR = "Hello, playground" // variable VAR x = 0.0, y = 0.0, z = 0.0let numint = 10 // constant/*** multiline comment */println (STR) // output function println (numint) println ("STR is \ (STR) num is \ (numint )") /*** note that double */let anotherpi = 3 + 0.14159 // anotherpi is assumed to be of the double type let decimalinteger = 17let binaryinteger = 0b10001 // binary 17let octalinteger = 0o21/ /octal 17let he Xadecimalinteger = 0x11 // The hexadecimal 17 is very fond of 0x. It reminds me of the pain of plug-ins when I am playing games. I read the base address of the memory/*** map vest in the tuples of Java, first, let's get this understanding. */let http404error = (404, "not found") LET (statuscode, statusmessage) = http404errorprintln ("the status code is \ (statuscode )") // output "the status code is 404" println ("the status message is \ (statusmessage)") // output "the status message is not found" Let (justthestatuscode ,_) = http404errorprintln ("the status code Is \ (justthestatuscode) ") // output" the status code is 404 "only needs a part of the tuples. during decomposition, You can underline the parts to be ignored (_) mark println ("the status code is \ (http404error. 0) ") // output" the status code is 404 "subscript mode Value println (" the status message is \ (http404error. 1) ") // output" the status message is not found "subscript mode Value let http200status = (statuscode: 200, Description:" OK ") // messy, it can be written in this way. This is the understanding of Map <string, Object>.










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.