Section 1

Preview this deck

return

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (92)

Section 1

(50 cards)

return

Front

Immediately breaks control flow out of the current context, and additionally returns a value supplied after it if one is present.

Back

any

Front

Can be used to represent an instance of any type at all, including function types.

Back

repeat

Front

Performs a single pass through the loop block first, before considering the loop's condition

Back

subscript

Front

A shortcut for accessing the member elements of a collection, list, or sequence.

Back

extension

Front

Lets one add new functionality to an existing class, structure, enumeration, or protocol type.

Back

false

Front

One of two constant values Swift used to represent the logical type, Bool, as not being true.

Back

typealias

Front

Introduces a named alias of an existing type into your program.

Back

case

Front

A statement that is evaluated and then compared with the provided patterns inside a 'switch' case.

Back

switch

Front

Considers a value and compares it against several possible matching patterns. It then executes an appropriate block of code, based on the first pattern that matches successfully.

Back

var

Front

Defines a variable as mutable.

Back

fileprivate

Front

An access control construct that restricts scope to only the defining source file.

Back

func

Front

Self-contained chunks of code that perform a specific task.

Back

open

Front

An access control construct that allows objects to be both accessible and subclassable outside of its defining module. For members, they are both accessible and overridable outside of its defining module.

Back

inout

Front

A value that is passed to a function and modified by it, and is passed back out of the function to replace the original value. Applies to both reference and value types.

Back

let

Front

Defines a variable as immutable.

Back

continue

Front

Ends program execution of the current iteration of a loop statement but does not stop execution of the loop statement.

Back

nil

Front

Represents a stateless value for any type in Swift. *Different from Objective-C's nil, which is a pointer to a nonexistent object.

Back

defer

Front

Used for executing code just before transferring program control outside of the scope that it appears in.

Back

if

Front

Used for executing code based on the evaluation of one or more conditions.

Back

protocol

Front

Defines a blueprint of methods, properties, and other requirements that suit a particular task or piece of functionality.

Back

internal

Front

An access control construct that allows entities to be used within any source file from its defining module, but not in any source file outside of it.

Back

default

Front

Used to cover any values that are not addressed explicitly in a case.

Back

break

Front

Ends program execution of a loop, an 'if' statement, or a 'switch' statement.

Back

public

Front

An access control construct that allows objects to be both accessible and subclassable but only inside of its defining module. For members, they are both accessible and overridable inside of its defining module.

Back

where

Front

Requires that an associated type must conform to a certain protocol, or that certain type parameters and associated types must be the same. It's also used to provide an additional condition within a pattern in cases that are considered to be matched to the control expression. *The where clause can be used in several contexts, these are examples of their primary use as a generic where clause and pattern matching.

Back

struct

Front

A general-purpose, flexible construct that becomes the building blocks of your program's code and can also provide member wise initializers. Unlike a 'class', they are always copied when they are passed around in your code and as such, do not use automatic reference counting. In addition, they do not: use inheritance; allow type casting at runtime; have, or use, deinitializers.

Back

guard

Front

Used to transfer program control out of a scope if one or more conditions aren't met, while also unwrapping any optional values provided.

Back

is

Front

A type check operator used to determine whether an instance is of a certain subclass type.

Back

throws

Front

Indicates that a function, method, or initializer can potentially throw an error.

Back

super

Front

Exposes access to the superclass version of a method, property, or subscript.

Back

enum

Front

Defines a common type for a group of related values and enables you to work with those values in a type-safe way within your code. In Swift, they are first class types and can use features typically supported only by classes in other languages.

Back

operator

Front

A special symbol or phrase that you use to check, change, or combine values.

Back

as

Front

A type cast operator used to attempt to cast a value to a different, or an expected and specific type.

Back

do

Front

Begins a statement to handle errors by running a block of code.

Back

in

Front

Iterates over a sequence, such as ranges of numbers, items in an array, or characters in a string. *pairs with the 'for' keyword

Back

init

Front

The process of preparing an instance of a class, structure, or enumeration for use.

Back

static

Front

Defines methods that are called on the type itself. Also used to define static members.

Back

for

Front

Iterates over a sequence, such as ranges of numbers, items in an array, or characters in a 'string'. *pairs with the 'in' keyword

Back

Self

Front

In protocols, represents the type that will eventually conform to the given protocol.

Back

while

Front

Performs a set of statements until a condition becomes 'false'.

Back

deinit

Front

Called immediately before a class instance is deallocated.

Back

rethrows

Front

Indicates that the function throws an error only if one of its function parameters throws an error.

Back

self

Front

An implicit property that every instance of a type has, which is exactly equivalent to the instance itself. Also very useful for distinguishing between a parameter name and a property name.

Back

import

Front

Exposes a framework or application that is built and shipped as a single unit into the given binary.

Back

catch

Front

If an error is thrown by code in a 'do' clause, it's matched against a 'catch' clause to determine how the error will be handled.

Back

throw

Front

Used to explicitly throw an error from the current context.

Back

fallthrough

Front

Explicitly allows execution to continue from one case to the next in a 'switch' statement.

Back

private

Front

An access control construct that allows entities to be scoped to its defining declaration.

Back

class

Front

a general purpose, flexible construct that becomes the building blocks of your program's code.

Back

else

Front

Used in conjunction with an 'if' statement it executes one part of code when the condition is true and another part of code when the same condition is false.

Back

Section 2

(42 cards)

Type

Front

Refers to the type of any type, including class types, structure types, enumeration types, and protocol types.

Back

#fileReference

Front

A playground literal which brings up a picker to select a file which returns as a 'NSURL' instance.

Back

postfix

Front

Specifies that an operator follows the target that it operates on.

Back

#endif

Front

A conditional compiler control statement that allows the program to conditionally compile some given code. Used for marking the end of conditionally compiled code.

Back

lazy

Front

A property whose initial value is not calculated until the first time it is used.

Back

willSet

Front

A property observer that is invoked right before a value is stored on a property.

Back

#imageLiteral

Front

A playground literal which brings up a picker to select an image which returns as a 'UIImage' instance.

Back

#function

Front

A special literal expression which returns the name of a function, inside a method it is the name of that method inside a property getter or setter it is the name of that property, inside special members like 'init' or 'subscript' it is the names of that keyword, and at the top level of a file it is the name of the current module.

Back

#available

Front

A condition of an 'if', 'while', and 'guard' statement to query the availability of API's at run-time, based on specified platforms arguments.

Back

mutating

Front

Allows modification of the properties of a structure enumeration within a particular method.

Back

#sourceLocation

Front

A line control statement used to specify a line number and filename that can be different from the line number and filename of the source code being compiled. Useful for changing the source code location used by Swift for diagnostic and debugging purposes.

Back

#column

Front

A special literal expression that returns the column number in which it begins.

Back

#elseif

Front

A conditional compiler control statement that allows the program to conditionally compile some given code. Used in conjunction with an '#if' statement, it executes one part of code when the given condition is true.

Back

left

Front

Specifies the associativity of an operator as left to right so operators with the same precedence level are grouped together correctly in the absence of grouping parentheses.

Back

_

Front

A wilcard pattern that matches and ignores any value.

Back

#selector

Front

An expression that forms the Objective-C selector which uses static checking to ensure that the method exists and that it's also exposed to Objective-C.

Back

final

Front

Prevents a method, property, or subscript from being overridden.

Back

associativity

Front

Specifies how a sequence of operators with the same precedence level are grouped together in the absence of grouping parentheses by using 'left', 'right', or 'none'.

Back

right

Front

Specifies the associativity of an operator as right to left so operators with the same precedence level are grouped together correctly in the absence of grouping parentheses.

Back

true

Front

One of two constant values Swift used to represent the logical type, Bool as being true.

Back

dynamic

Front

Indicates that access to that member or function is never inlined or devirtualized by the compiler, which means access to that member is always dynamically dispatched (instead of statically) using the Objective-C runtime.

Back

optional

Front

Used to declare optional methods in protocols. These requirements do not have to be implemented by types that conform to it.

Back

#file

Front

A special literal expression that returns the name of the file in which it appears.

Back

convenience

Front

Secondary, supporting initializers for a class that eventually delegate initialization of the instance to a designated initializer.

Back

infix

Front

Specifies that an operator is used between two targets. If a new global operator is defined as an infix operator, it also requires membership to a precedence group.

Back

#else

Front

A conditional compiler control statement that allows the program to conditionally compile some given code. Used in conjunction with an '#if' statement, it executes one part of code when the condition is true and another part of code when the same condition is false.

Back

required

Front

Enforces the compiler to make sure that every subclass of the class must implement the given initializer.

Back

#colorLiteral

Front

A playground literal which brings up an interactive color picker to assign a variable.

Back

nonmutating

Front

Indicates that a member's setter doesn't modify the containing instance, but rather has other intended consequences.

Back

set

Front

Takes in a value for a member to set as its new value. Also used with computed properties to set other properties and values indirectly. If a computed property's setter does not define a name for the new value to bet set, a default name of 'newValue' can be used implicitly.

Back

didSet

Front

A property observer that is invoked immediately after a value is stored on a property.

Back

weak

Front

Enables one instance in a reference cycle to refer to the other instance without keeping a strong hold on it when the other instance has a shorter lifetime -- that is when the other instance can be deallocated first.

Back

precedence

Front

Represents an operator's higher priority than others; so that these operators are applied first.

Back

unowned

Front

Enables one instance in a reference cycle to refer to the other instance without keeping a strong hold on it when the other instance has the same lifetime or a longer lifetime.

Back

prefix

Front

Specifies that an operator precedes the target it operates on.

Back

indirect

Front

Indicates that an enumeration has another instance of the enumeration as the associated value for one or more of the enumeration cases.

Back

none

Front

Specifies that an operator has the absence of any associativity applied to it, which restricts operators of the same precedence level from appearing adjacent to each other.

Back

try

Front

Indicates that the following function could potentially throw an error. Can be used 3 different ways: try, try? and try!

Back

get

Front

Returns the given value for a member. Also used with computed properties to get other properties and values indirectly.

Back

override

Front

Indicates that a subclass will provide its own custom implementation of an instance method, type method, instance property, type property, or subscript that it would otherwise inherit from a superclass.

Back

#if

Front

A conditional compiler control statement that allows the program to conditionally compile some given code. Used for executing code based on the evaluation of one or more conditions.

Back

#line

Front

A special literal expression which returns the line number on which it appears.

Back