Swift Core Cheat Sheet

A Programming › Swift cheat sheet in English by mobilejay
8,897 views 2,078 downloads 26 Dec 2017 History
3.7 avg · 0 ratings

Declar­ations

associatedtype, class, deinit, enum, extension, fileprivate, func, import, init, inout, internal, let, open, operator, private, protocol, public, static, struct, subscript, typealias, and var.

Statements

break, case, continue, default, defer, do, else, fallthrough, for, guard, if, in, repeat, return, switch, where, and while

Expres­sions and types

as, Any, catch, false, is, nil, rethrows, super, self, Self, throw, throws, true, and try.

Patterns

 _

Begin with a number sign (#)

#available, #colorLiteral, #column, #else, #elseif, #endif, #file, #fileLiteral, #function, #if, #imageLiteral, #line, #selector, and #sourceLocation

Reserved in particular contexts

associativity, convenience, dynamic, didSet, final, get, infix, indirect, lazy, left, mutating, none, nonmutating, optional, override, postfix, precedence, prefix, Protocol, required, right, set, Type, unowned, weak, and willSet.
Outside the context in which they appear in the grammar, they can be used as identi­fiers.

Reserved as punctu­ation

(, ), {, }, [, ], ., ,, :, ;, =, @, #, & (as a prefix operator), ->, `, ?, and ! (as a postfix operator).

These tokens are reserved as punctu­ation and can’t be used as custom operators.

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.