Restrict user from switching to video mode

I have requirement in my application in which when he choose take photo option,he should only be allowed to capture photo and cannot switch to video mode. And same for choosing the photo from photolibrary he should only be allowed to choose from available photos, he should not be allowed to choose video.How can I restrict user from doing this? What mode should be set in source type to do it.

Answers


Take a look at the mediaTypes property of UIImagePickerController.


Depending on the media types you assign to this property, the picker displays a dedicated interface for still images or movies, or a selection control that lets the user choose the picker interface. Before setting this property, check which media types are available by calling the availableMediaTypesForSourceType: class method.

If you set this property to an empty array, or to an array in which none of the media types is available for the current source, the system throws an exception.

When capturing media, the value of this property determines the camera interface to display. When browsing saved media, this property determines the types of media presented in the interface.

By default, this property is set to the single value kUTTypeImage, which designates the still camera interface when capturing media, and specifies that only still images should be displayed in the media picker when browsing saved media. To designate the movie capture interface, or to indicate that only movies should be displayed when browsing saved media, use the kUTTypeMovie identifier in a statement like this:

myImagePickerController.mediaTypes =
    [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];

To designate all available media types for a source, use a statement like this:

myImagePickerController.mediaTypes =
    [UIImagePickerController availableMediaTypesForSourceType:
        UIImagePickerControllerSourceTypeCamera];

Need Your Help

Require JS some dependencies are not found and error as 'undefined'

javascript requirejs

I've been using RequireJS for a little bit now but I'm still struggling to get to grips with it...

Add Two Images in Matlab

matlab guide

I am trying to overlay an activation map over a baseline vasculature image but I keep getting the same error below:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.