Learn notes from the zero-learning Swift (DAY5)-Identifiers and keyword I know

Source: Internet
Author: User

??

Swift 2.0 Study Notes ( Day5 )--the identifiers and keyword I know

original articles, welcome reprint. Reprint Please specify: Dongsheng's blog

a lot of computer language has identifiers and keyword, has not been a good summary, is this use, and now a small tidy up Swift the identifiers and keyword in the.

What is an identifier it?

identifiers is the name assigned by the developer to variables, constants, methods, functions, enumerations, structs, classes, protocols, and so on.

in fact. There are certain specifications for the letters that make up identifiers, and the naming rules in Swift are:

  • distinguishes between uppercase and lowercase. Myname and Myname are two different identifiers;

  • The first character of the identifier can be underlined ( _ ) or the letter starts, but not the number.

  • The other characters in the identifier can be underlined ( _ ), letters, or numbers.

For example: userName , user_name , _sys_val , height, etc. as a valid identifier, and 2mail , room# and the class is an illegal identifier.

What is keyword it?

keyword is a sequence of reserved characters similar to identifiers. Defined by the language itself. You can't use it for him. Unless you enclose it with an accent sign (').

Swift language Common keyword have the following 4 species.

  • keyword related to the declaration: class , Deinit , enum and so on.

  • break Span style= "font-family: Arial" >, case , continue

  • expression and type keyword: as catch , dynamictype , false

  • keyword used in a specific context: associativity , Convenience , Dynamic and so on.

Swift The keyword is a distinction between uppercase and lowercase. So class and class are different, then class is not Swift the keyword.

Welcome to follow Dongsheng Sina Weibo @tony_ Dongsheng.

Learn about the latest technical articles, books, tutorials and information on the public platform of the smart Jie classroom

many other boutique IOS,Cocos, mobile design courses please pay attention to the official site of the Smart Jie classroom:http://www.zhijieketang.com

Luxgen Classroom Forum Site:http://51work6.com/forum.php

Learn notes from the zero-learning Swift (DAY5)-Identifiers and keyword I know

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.