Ios Development notes, ios development

Source: Internet
Author: User

Ios Development notes, ios development

1. We all know that c # java has an entry main function, but swift does not have it in the code. But if there is main. swift, let's take the entry of the program in this file! In addition, files cannot be deleted. If the deletion program cannot be compiled

2. Basic Syntax: Use let to declare constants and var to declare variables. Generally, the type of the defined variables corresponds to the value.

Let a = 10; if a constant is assigned a value, it cannot be assigned a second value. That is to say, the constant value cannot be changed.

Var B = 10; you can also define multiple values (tuples) var c = (100, 30) or give the name var c = (money:, name: "ysq "). Access c. money

Var c = [1, 3, 4, 45] defines the number axis and accesses the subscript

Note: When programming, you can write a semicolon instead of a space.

 

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.