??
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