Section 1

Preview this deck

Struct vs Class

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 (15)

Section 1

(15 cards)

Struct vs Class

Front

Struct = value type. Instance keeps unique copy of data. Class = reference type.

Back

Key-Value Observing

Front

Attaches code to variables so that when variable changes the code runs.

Back

Rect vs Frame

Front

??

Back

Garbage Collecting in Swift

Front

Uses automatic reference counting: form of garbage collection which deallocates objects once there are no more references.

Back

Repeat

Front

Runs logic in block before while statement is processed.

Back

Default vs Ephemeral URLSession call

Front

??

Back

Stack vs Heap

Front

STACK is used for static memory allocation (instance data known at compile time and size fixed when program starts). Uses LIFO, faster. Heap for dynamic memory allocation (instance data and lifetime is configurable).

Back

Final

Front

Used to mark objects that cannot be inherited from.

Back

Property

Front

Stores data in instance of class.

Back

What happens if you wrap an "if let" on an unwrapped property?

Front

Won't compile.

Back

Float vs Double

Front

Doubles are more precise (14 digits of precision vs 7)

Back

viewDidAppear vs viewDidLoad

Front

viewDidLoad is called when view is loaded in memory, Appear is called every time it appears.

Back

Static Method

Front

Static methods are defined in an object but do not require instance data. Therefore, they can be called directly with the class name, such as Math.random().

Back

View vs Layer

Front

Layers manage visual content and are the backing store for views. If a layer is created by a view, the view assigns itself as the delegate.

Back

string.replacingOccurences(of: "foo", with: "bar")

Front

Returns a new string with occurrences swapped.

Back