Interactive App Building Flashcards

1
Q

Which of the following segues adds a new view to the navigation stack? Present Modally, Present as popover, Show

A

Show

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

TF: When we want to show a view, we add the view to the navigation stack

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why do we use a navigation stack rather than a modal view for our information flow?

A

A modal view is used to display temporary information
A modal view is used to draw the users attention and prevents them from taking any action unless the modal is dismissed.
A navigation stack is used to display hierarchical or organized data like our story.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does a navigation controller object manage the currently displayed screens?

A

Using the navigation stack, which is represented by an array of view controllers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

TF: You cannot interact with the navigation bar. It is entirely managed by the system.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

TF: When we want to show a view, we add the view to the navigation stack?

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

TF: A tuple in swift is also known as an anonymous struct.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What’s the difference if we add an image like this -> UIImage(named: “Home”) as opposed to the pic with the name( can’t put it in here but the image comes up in xcode)?

A

if we return the image like this -> UIImage(named: “Home”) -> This an optional and must be force unwrapped.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

If you have 2 functions with the same name, but different parameters for the function, what is this called?

A

Method overloading

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Under the hood in Swift a tuple is just:

A

Struct without a name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

An optional is a(n) ________ under the hood with a ______ and _________ case

A

Enum
Some
None

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a selector?

A

A name used to select a method to execute for an object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why do we set a view’s translatesAutoresizingMaskIntoConstraints property to false?

A

The system adds its own constraints to views which might conflict with ours

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

TF: We can only apply styles to the entire attributed string. It is not possible to style a particular section of a string.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Before we can add constraints to any views we create, which of the following tasks is required:

A

Adding the created view as a subview of the main view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do we modify the appearance of an attributed string?

A

Using a dictionary of attributes that we associate with the string

17
Q

Why can we access self inside our closure when we mark the property as lazily loaded?

A

Lazy loaded properties are created after object initialization meaning self is available to access.

18
Q

TF: var someProperty = 1 is the same as var someProperty = { return 1 }()

A

True

19
Q

TF: Refactoring is the process of changing the structure of our code and changing functionality

A

False

20
Q

Why do we use a delegate pattern to be notified of the text field’s events?

A

Because at most only a single object needs to know about the event

21
Q

How do we send additional information along with a notification?

A

Using the userInfo dictionary property

22
Q

TF: By default every app has its own notification center that manages notifications and observers

A

True

23
Q

Which of the following communication methods allows for a loosely coupled, one-to-many pattern? Calling a method on an object, Notifications, Target-Action, Delegates

A

Notifications

24
Q

TF: Passing the memory address of a file rather than a value allows us to work on large files without affecting memory usage

A

True

25
Q

How is an inout parameter different from a regular parameter?

A

Inout passes by reference while a regular parameter passes by value

26
Q

If I wanted to create a type called Degree that was represented as a Double, how would I do that?

A

typealias Degree = Double