Swift

Swift was introduced in 2014 as an Apple programming language. It was eventually available for development in Xcode the following year.

Includes knowledge areas

Optionals

A type that represents either a wrapped value or nil, the absence of a value.

Error handling

Error handling is the process of responding to and recovering from error conditions in your program.

Strings

A string is a series of charactersю. Swift strings are represented by the String type. The contents of a String can be accessed in various ways, including as a collection of Character values.

Collections

Open-source package focused on extending the set of available Swift data structures.

Control Flow

Swift provides a variety of control flow statements. These include while loops to perform a task multiple times; if, guard, and switch statements to execute different branches of code based on certain conditions; and statements such as break and continue to transfer the flow of execution to another point in your code.

Functions and methods

Functions are self-contained chunks of code that perform a specific task. Methods are functions that are associated with a particular type.

Closure expressions

A closure expression creates a closure, also known as a lambda or an anonymous function in other programming languages. Like a function declaration, a closure contains statements, and it captures constants and variables from its enclosing scope.

Enumeration

An enumeration 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.

Class vs Structure

In Swift, structs are value types whereas classes are reference types.

Properties

Properties associate values with a particular class, structure, or enumeration.

Initializers

Initializers are like special methods that can be called to create a new instance of a particular type.

Functional programming: map

The map function applies a function to every item in a collection.

Functional programming: filter

The filter function simply returns values that passed an if-statement, and only if that condition resulted in true.

Functional programming: reduce

The reduce() function turns a collection into one value.

Memory management

Memory management refers to the process of managing heap memory. This means managing the life cycles of objects on the heap and making sure that these objects are freed when they are no longer needed so the memory can be reused.

Type casting

Type casting is a way to check the type of an instance, or to treat that instance as a different superclass or subclass from somewhere else in its own class hierarchy.

Extensions

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

Protocols

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

Generics

Generics are one of the most powerful features of Swift, and much of the Swift standard library is built with generic code. Generic code enables a possibility to write flexible, reusable functions and types that can work with any type, subject to requirements that are defined.

Swift/Objective-C interoperability

Possibility to use Swift code in Objective-C and Objective-C code in Swift

Subscripts

Subscripts are shortcuts for accessing the member elements of a collection, list, or sequence.

Access Control

Access control restricts access to parts of the own code from code in other source files and modules.

Is a part of:

Heading

HeadingHeading

The rich text element allows you to create and format headings, paragraphs, blockquotes, images, and video all in one place instead of having to add and format them individually. Just double-click and easily create content.

Static and dynamic content editing

A rich text element can be used with static or dynamic content. For static content, just drop it into any page and begin editing. For dynamic content, add a rich text field to any collection and then connect a rich text element to that field in the settings panel. Voila!

How to customize formatting for each rich text

Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.