iOS Development Flashcards
Core Data
allows us to take the objects we have created and save them into an internal database.
core data entity
The same as a class,
created in xcdatamodeld file
ManagedObjectContext
acts as a bridge from app to database
Set initial view controller
View controller > Attributes > View Controller > Check off “Is initial View Controller”
continue
tells our for loop to skip a value if
break
breaks out of a loop if a specific condition is met
What is a Dictionary in swift?
An unordered collection of paired data. The paired data is commonly referred to as a key-value pair in which a key is a unique identifier for their associated value.
What do you call a dictionary with no key-value pairs?
An Empty Dictionary
what are if-let statements used for
To check if a real value exists inside of an optional. If the value exists, the optional will be unwrapped and assigned to a variable.
the ___ operator has higher precedence over the ___ operator
&&, ||
Instead of relying on the compiler to set operator precedence, we can do so ouselves with _____
Parentheses
with regards to logical operators, in an ___ statement true takes priority over false but in a ___ statement false takes priority over true
||, &&
The logical __ operator returnes true only when both operands are true, it returns false in all other cases.
&&
The logical __ operator returns true when either operands are true. when both operands are false, the logical expression evaluates to false
||
The logical __ operator translates to NOT and negates a Boolean value
!
inout
If you want a function to modify a parameter's value, you need to define the parameter as in-out parameter. You write an in-out parameter by placing the inout keyword right before a parameter's type. Behind the scenes, an in-out parameter has a value that is passed into the function, is modified by the function, and is passed back out of the function to replace the original value. Therefore the value passed in the function call cannot be a constant. You must declare it as a variable. The syntax of function with inout parameter is: func funcname(parameterName:inout Type) -> Return Type { //statements }
What does swift “Control Flow” do?
It controls the flow of program execution. The term is used to describe the logic that dictates the execution path that is taken through the source code of an application as it runs.
With regards to control flow what is “looping control”?
How often code is executed
With regards to control flow what is “conditional control flow”?
Whether code is executed
With regards to closure syntax, what does the “in” keyword indicate?
The start of the closure expression code.
in reality functions are just named _____ expressions
closure
In traditional computer science, what is a “closure” considered to be?
The combination of a self-contained block of code and one or more variables that exist in the context surrounding the code block.
What data types are currently able to be used as keys in a Swift dictionary?
String, Int, Double, and Bool