Recall & Review
beginner
What is the purpose of UIImagePickerController in iOS development?
UIImagePickerController is a built-in class that lets users pick images or videos from their photo library or take new photos or videos using the camera.Click to reveal answer
beginner
Which privacy key must be added to Info.plist to access the camera?
You must add the key NSCameraUsageDescription with a message explaining why your app needs camera access.
Click to reveal answer
beginner
How do you check if the camera is available on an iOS device?
Use UIImagePickerController.isSourceTypeAvailable(.camera) to check if the device has a camera before trying to use it.
Click to reveal answer
intermediate
What delegate protocol must your class conform to when using UIImagePickerController?Your class must conform to <strong>UIImagePickerControllerDelegate</strong> and <strong>UINavigationControllerDelegate</strong> to handle image picking results and navigation events.Click to reveal answer
beginner
Why is it important to dismiss UIImagePickerController after picking an image?
Dismissing UIImagePickerController returns control to your app's interface and prevents the picker from blocking user interaction.
Click to reveal answer
Which source type allows users to select photos from their library?
✗ Incorrect
The .photoLibrary source type lets users pick images or videos from their photo library.
What must you do before accessing the camera in your app?
✗ Incorrect
You must add NSCameraUsageDescription in Info.plist to explain why your app needs camera access.
Which delegate method handles the event when a user finishes picking an image?
✗ Incorrect
imagePickerController(_:didFinishPickingMediaWithInfo:) is called when the user picks an image or video.
How do you check if the device supports taking photos?
✗ Incorrect
UIImagePickerController.isSourceTypeAvailable(.camera) returns true if the device has a camera.
What happens if you don't dismiss UIImagePickerController after use?
✗ Incorrect
If you don't dismiss the picker, it remains visible and blocks user interaction with your app.
Explain the steps to let a user take a photo and use it in your app.
Think about permissions, presenting the camera, and handling the result.
You got /5 concepts.
Describe how to allow users to pick an existing photo from their library.
Focus on the photo library source and delegate handling.
You got /4 concepts.