Question: To be able to execute code in response to a UIButton-tap interaction by the user we... Select one: a. ...create a delegate protocol and use

To be able to execute code in response to a UIButton-tap interaction by the user we...

Select one:

a. ...create a delegate protocol and use the delegation pattern

b. ...create an Action inside our UIViewController

c. ...pass a callback into our UIButton instance

d. ...create an Outlet inside our UIViewController

Question 2

Complete

0.00 points out of 1.00

Flag question

Question text

To be able to change the text of a label from inside our code we...

Select one:

a. ...create a delegate protocol and use the delegation pattern

b. ...create a delegate protocol and use the delegation pattern

c. ...create an Outlet inside our UIViewController

d. ...create an Action inside our UIViewController

Question 3

Complete

1.00 points out of 1.00

Flag question

Question text

In order to create views that will display on any screen size and screen orientation we use...

Select one:

a. XML views

b. Cascading Style Sheets

c. The X and Y coordinates of parent views

d. Auto Layout Constraints

Question 4

Complete

0.00 points out of 1.00

Flag question

Question text

Match which of these concepts of Object Oriented Programming are available to us when working with...

Structs

Answer 1Choose...InheritanceInheritance, CompositionComposition

Classes

Answer 2Choose...InheritanceInheritance, CompositionComposition

Question 5

Complete

0.00 points out of 1.00

Flag question

Question text

Your app crashed after you renamed an outlet inside your UIViewController. What went wrong?

Select one:

a. The old name of the outlet is still being used in our storyboard file. To avoid this we could have right-clicked the outlet declaration in our UIViewController and renamed the outlet with the "refactor" tool. We could also delete the outlet inside InterfaceBuilder and re-create it with the new name.

b. In general it is a better approach to use Actions exclusively. Actions are much more versatile than Outlets.

c. After renaming an outlet all layout constraints associated with the view component have to be updated. We can either delete each layout constraint and re-create it, or we can update each constraint manually. To avoid this altogether we could place view components based on the x and y coordinates in the respective parent view.

d. Outlets, once created, can not be renamed. We could have avoided this by spending more time coming up with a better name for the outlet at the outset.

e. The app crashed because we didn't call viewDidLoad() after renaming the outlet. We have to make sure we call that method whenever we re-name an outlet.

Question 6

Complete

0.25 points out of 1.00

Flag question

Question text

We would like to update the location of one of our view components in our Storyboard file

Select one or more:

a. Layout constraints are visually represented as lines inside Interface Builder. We can select the view component with the constraint we would like to update, select the line representing the constraint, and edit its properties with the right editor tab.

b. Sometimes it might be easiest do delete and re-create the constraint.

c. All views and subviews are displayed in a hierarchical tree in the view inspector on the left. From there we can select the view with the constraint we would like to update. All of the associated constraints will be nested with that view in the ViewInspector. Once selected, we can update the constraint's properties with the right editor tab.

d. A visual way of updating our layout is selecting the view component we would like to update in Interface Builder and dragging it to the new location. We have to make sure to tell interface builder to update the constraints by clicking on the yellow warning triangle in the View Hirarchy to the left, and resolving the misplaced constraints from there.

e. We can just create a new constraint. Old conflicting constraints will automatically be deleted.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!