Book Appointment Now
Introduction to iOS App Development with Swift 5 Quiz Answers
Table of Contents
Introduction to iOS App Development with Swift 5 Week 01 Quiz Answers
Quiz 1: iOS Review
Q1. If you want your images to support both retina and non-retina iOS devices what should you do?
- Provide @1x, @2x, and @3x images
- Click the checkbox in the storyboard labeled “Enable Retina”
- Provide both PNG and JPEG versions of your images
- All of the above
Quiz 2: iOS Basics Review
Q1. If you want to transition to a new screen what would you use?
- UIScreenManager
- UITransitionView
- Segue
- UIStackView
Introduction to iOS App Development with Swift 5 Week 02 Quiz Answers
Quiz 1: iPad Review
Q1. To create different layouts for different screen sizes you would use Size Classes
- True
- False
Quiz 2: iPad Review
Q1. What is the best way to support multiple screen sizes and orientations?
- Build iPhone UI in Interface Builder and iPad UI in your Swift code
- Create a different storyboard for each orientation and screen
- Have your designer create one design that looks good on all screens
- Size Classes
Quiz 3: Interface Builder Assessment
Q1. Which of these is the cause for the exception setValue:forUndefinedKey ?
- You have forgotten to set a placeholder on a UITextField
- You have forgotten to set an IBAction for each UIButton in Interface Builder
- An IBOutlet has been removed from the code, but Interface Builder is still referencing it
- All of the above
Q2. What is the best way to pass data to a new UIViewController that you want to present?
- Set a timer for a few seconds in the presenting view controller that passes data to the new view controller once it has loaded
- In the prepareForSegue function
- You should not pass data to other view controllers
- Use NotificationCenter and observers to send data to the new view controller
Q3. A UIViewController can only be presented if there is a segue set in the Interface Builder
- True
- False
Q4. Which of the following is correct syntax for declaring an IBOutlet?
- weak var IBOutlet aButton: UIButton!
- weak var aButton: IBOutlet UIButton!
- @weak IBOutlet var aButton: UIButton!
- @IBOutlet weak var aButton: UIButton!
Q5. Which of the following UIViewController functions is best for performing initialization operations that only run one time?
- viewDidLoad
- viewWillAppear
- viewDidAppear
- viewWillLayoutSubviews
Introduction to iOS App Development with Swift 5 Week 03 Quiz Answers
Quiz 1: Custom UI Review
Q1. What can you do to get a custom view to display within Interface Builder?
- This is not currently possible in iOS
- Use @IBDesignable in your custom view
- Select the view within Interface Builder and click “Refresh UI Automatically”
- Ensure that your custom view inherits from UIViewDisplay
Introduction to iOS App Development with Swift 5 Week 04 Quiz Answers
Quiz 1: iOS Review
Q1. Which of the following classes manages the presenting of a full-sized screen?
- UIView
- UIViewController
- UIResponder
- UITableView
Quiz 2 : iOS Assessment
Q1. UIImageView, UILabel, and UIButton all inherit from what common parent?
- UIView
- UIViewController
- IBOutlet
- UICoreControl
Q2. If I wanted to ensure that code I write doesn’t later break I might do what?
- Only write code that doesn’t modify or affect old code
- Make all variables private
- Make backup copies of older code
- Write Unit Tests
Q3. If you want to access a UI element in your code that you have created in Interface Builder what should you do?
- Create an IBOutlet in code for that UI element
- Create an IBAction in code for that UI element
- Iterate through your main view’s subviews and find the appropriate view
- None of the above
Q4. How can you add subviews to your UIViewController’s main view?
- Add views to a Storyboard in Interface Builder
- Add subviews dynamically in code with the addSubview function
- Dynamically instantiate XIB (nib) files in your code
- Use XML to pre-specify which views you want to load before compilation
Q5. If you want Interface Builder to reflect UI changes that you have written in code, you must prefix your custom class with what designation?
Q6. Consider the following code below. How do you round the corners of the background view?
let background = UIView()
- 1.
background.roundCorners(radius: 5.0)
2.background.edges.circular(5.0)
3.background.layer.cornerRadius = 5.0
4.background.layer.makeEdges(5.0)
Q7. If you want to present a custom view on top of the iOS keyboard when a UITextField is tapped you would do what?
- Set the inputAccessoryView of that UITextField
- Create a custom UIKeyboard class
- Create any UIView and simply move it above the keyboard
- All of the above
Q8. Views within a UIStackView should only have which constraints if needed?
- CenterX and CenterY
- Views within UIStackViews must not use any constraints
- Width & Height
- Width, Height, CenterX, and CenterY
Get all Course Quiz Answers of Swift 5 iOS Application Developer Specialization
Introduction to Programming in Swift 5 Coursera Quiz Answers
Introduction to iOS App Development with Swift 5 Quiz Answers
Tables, Data & Networking in iOS Coursera Quiz Answers
iOS App Store & In-App Purchases Coursera Quiz Answers