關(guān)鍵字
被保留的關(guān)鍵字(keywords)不允許用作標識符,除非被反引號轉(zhuǎn)義,參見 標識符。
-
用作聲明的關(guān)鍵字:class、deinit、enum、extension、func、import、init、let、protocol、static、struct、subscript、typealias、var
-
用作語句的關(guān)鍵字:break、case、continue、default、do、else、fallthrough、if、in、for、return、switch、where、while
-
用作表達和類型的關(guān)鍵字:as、dynamicType、is、new、super、self、Self、Type、__COLUMN__、__FILE__、__FUNCTION__、__LINE__
-
特定上下文中被保留的關(guān)鍵字:associativity、didSet、get、infix、inout、left、mutating、none、nonmutating、operator、override、postfix、precedence、prefix、right、set、unowned、unowned(safe)、unowned(unsafe)、weak、willSet,這些關(guān)鍵字在特定上下文之外可以被用于標識符。