Original articles, welcome reprint. Reprint Please specify: Dongsheng's Blog
a lot of computer language has identifiers and keywords, has not been a good summary, is such a use, now a small tidy up Swift the identifiers and keywords in the.
What is an identifier it?
identifiers is the name specified by the developer for variables, constants, methods, functions, enumerations, structs, classes, protocols, and so on.
In fact, the letters that make up identifiers have certain specifications, Swift the naming rules in are:
Case Sensitive, Myname with the myname is a two different identifier;
The first character of an identifier canbegin with an underscore (_) or a letter, but not a number;
The other characters in the identifier can be underscores (_), 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 Key Words it?
A keyword is a sequence of reserved characters similar to an identifier, defined by the language itself, and cannot be used unless accented ( ` ) to enclose it. A
Swift Language Common keywords have the following 4 species.
keywords related to declarations:class,deinit,enum, and so on.
keywords related to statements:break,case,continue, and so on.
Expressions and Type keywords:as,catch,DynamicType,false, and so on.
keywords used in a specific context: associativity , Convenience , Dynamic and so on.
Swift The keywords are case-sensitive, so class and the Class is different, then Class is not Swift the key word.
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
650) this.width=650; "title=" 00.png "alt=" Wkiol1bnlsmaxwwtaaas2mbeznc339.png "src=" http://s5.51cto.com/wyfs02/M00/ 7b/66/wkiol1bnlsmaxwwtaaas2mbeznc339.png "/>
More ProductsIOS,Cocos, mobile Design course please pay attention to the official website of Chi Jie Classroom:http://www.zhijieketang.com
Smart-Jie Classroom Forum Website:http://51work6.com/forum.php
This article is from the "Dongsheng-ios Technical Consultant" blog, make sure to keep this source http://2009315319.blog.51cto.com/701759/1744589
Learning Swift from scratch (Day5)--The identifiers and keywords I know