Key words for Swift

Source: Internet
Author: User

Using keywords in declarations

Let: Declares a constant

var: declaring a variable

Class: Declaring a Category

Static: Statically

Deinit: Inverse initialization method? destructor method

Init: How to construct it? Initialize method

Enum: enum

Extension: Extending---Adding methods to Objects

Func: Declaring a function

Import: Importing header files

Internal: The Internal

Private: Private

Public: Publicly available

Operator: custom operator

Protocol: Protocol

struct: struct

Subscript: Subscript

Typealias: Renaming a method Typealias Feet = Int

Using keywords in statements

Break: Interrupt

Case: Condition

Continue: Skip

Default: Defaults

Do: What to do for example Do...while

Repeat: Ditto Repeat...while

if: Conditional judgment

ELSE: Conditional judgment

else if: conditional judgment

SWITCH: Conditional selection

Fallthrough: A statement jump is used to jump in a switch to execute a piece of code that has Fallthrough and jumps to the default

For: Loop

For in: Loop

While: Looping

Where: After case judgment executioncase let (x, y) where x == y:

Using keywords in expressions and types
As DynamicType False Is
Nil Self Self Super
True _column_ _file_ _function_
_line_
Keywords used in specific situations
Associativity Convenience Dynamic Didset
Final Get Infix InOut
Lazy Left Mutating None
Nonmutating Optional Override Postfix
Precedence Prefix Protocol Required
Right Set Type unowned
Weak Willset

Key words for Swift

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.