concept image picker controller in category ios

appears as: image picker controller, The image picker controller, n image picker controller
iOS Development with Swift

This is an excerpt from Manning's book iOS Development with Swift.

  • Inside the takePhoto method, instantiate a UIImagePickerController with a camera source and present it.
    let imagePicker = UIImagePickerController()                  1
    imagePicker.sourceType = .camera                             2
    present(imagePicker, animated: true, completion: nil)        3
    • 1 Creates image picker controller
    • 2 Sets source to camera
    • 3 Presents full screen
    You can get notification that the user has taken a photo through the image picker controller’s delegate.
  • iOS 7 in Action

    This is an excerpt from Manning's book iOS 7 in Action.

    You’re now finished with the initial setup of your Media Info application and can get started using different pieces of the Assets Library framework to add in the features you need. You’ll start by retrieving existing photos and videos using the image picker controller.

    7.2.1. Preparing and presenting the image picker controller

    The view controller that is shown when you launch your application is the IAView-Controller class that was created for you when you created your project. You’ll continue to use this as the main view that will present your users with two different actions. The first action is the one you’ll be focusing on in this section. This will be a button with the label Choose Photo or Video, which will launch an image picker controller.

    Listing 7.5. Launching the image picker controller from the launchImagePicker: method
    - (IBAction)launchImagePicker:(id)sender { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; picker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:picker.sourceType]; [self presentViewController:picker animated:YES completion:nil]; }