In my code , uiimagepickerviewcontroll is not selecting image on touch , it selects image either on swipe on the image or very long press.
I've not added any special code below is the code I've used.
self.imagePickerController = [[UIImagePickerController alloc] init];
_imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
_imagePickerController.allowsEditing = NO;
_imagePickerController.delegate = self;
[self.navigationController pushViewController:self.imagePickerController animated:YES];
if any one have any solution , please help me.
Thanks.
Hi, try this way, working always correct for me:
UIImagePickerController *imagePicker = [UIImagePickerController new];
imagePicker.delegate = self;
imagePicker.mediaTypes = #[(NSString*) kUTTypeImage];
imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum ;
_libraryImagePickerController = imagePicker;
Hope it helps :)
I don't know why this issue came, but I found only 1 solution, created a new project and copied whole code to the new one.
Issue was automatically resolved.
Related
I've been unable to get the trim controls to appear when capturing an iOS movie.
Here's my code:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.mediaTypes = #[(__bridge NSString *)kUTTypeMovie, (__bridge NSString *)kUTTypeImage];
imagePicker.allowsEditing = YES;
imagePicker.delegate = self;
[self presentViewController:imagePicker animated:YES completion:nil];
Additionally, I'm capturing the reply with imagePickerController:didFinishPickingMediaWithInfo:.
From searching StackOverflow I'm aware that I need to actually trim the video myself. That doesn't seem too difficult, but while I get the image picker and can capture a video I can't get the trim controls to appear! What am I missing?
My mistake was just in using video samples that were too short. They need to be over a certain length before the trimming tools will appear.
i cannot seem to get this right. ive looked at several tutorials with no luck. i realize it is a simple task, which is why i am so confused on why it isnt working for me.
i have a programmatically made button inside an expanding cell and when you press it, it is suppose to access the camera to take a picture. i have this code:
- (void)buttonPressed:(UIButton *)button {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[picker setDelegate:self];
//picker.allowsImageEditing = NO;
[self presentModalExpandingCell:picker animated:YES];
picker.showsCameraControls = YES;
}
the error appears in line 5. and says "no visible #interface for 'ExpandingCell' declares the selector 'presentModalExpandingCell:animated:'" i have "" in the .h file so i have no idea what to do.
any help will be greatly appreciated. thanks in advance.
Have you declared the method "presentModalExpandingCell" in your class? Because, if not, that is why the compiler is throwing that error.
I want to upload multiple video to server using ASIHttDataFormRequest.For selecting video ,I am using ImagePickerViewController But it doesn't give the option to select multiple video.
Bellow is the code, which is used to open imagePicker and but unable to select multiple video.
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
imagePicker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[self presentViewController:imagePicker animated:YES completion:nil];
Please help me by giving some clue or code. Thanks in Advance
Use this sample
https://github.com/B-Sides/ELCImagePickerController
For video multiple selection refer
Use ELCImagePickerController to pick video
Hope it helps you..
Here is the library to take a photo or select from library: https://github.com/fulldecent/FDTake
This works great so far for photos. Video is in progress.
I'm trying to make some composite images from currently existing ones in the photo rolls.
I have code that seems to work that loads an image from the photo roll onto a UIImageView and displays it to the user; (here's the Action that does that:)
- (IBAction)grabImage:(id)sender
{
if ([_myPopoverController isPopoverVisible])
[_myPopoverController dismissPopoverAnimated:YES];
else
{
if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeSavedPhotosAlbum])
{
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.mediaTypes = [NSArray arrayWithObjects: (NSString *) kUTTypeImage, nil];
imagePicker.allowsEditing = NO;
_myPopoverController = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
_myPopoverController.delegate = self;
[_myPopoverController presentPopoverFromRect: [sender frame] inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES ];
_newMedia = NO;
}
}
}
next I want to be able to select more photos, but instead of replacing the current one I want them to be layered one on top of another. Finally, when the user is done layering images, I want them to be able to save the final product to the photo roll.
How do I implement this? Not sure where to start...
thanks in advance,
marina
It turns out that all that was needed to do this is just add CALayers to an UIImageView with various degrees of alpha; instead of wiping out the previous image and replacing it with a new one, I simply add differently alpha's layers of images. Works like a charm!
I know that this question been asked before, but I'm getting an error while I'm running this code for picking video.
-(void)video
{
UIImagePickerController *imagePicker =
[[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType =
UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie,nil];
[self presentModalViewController:imagePicker animated:YES];
}
This code taking me to a window where video should appear. But the window is blank. The message showing is "No Videos you can sync photos and videos onto your iPod.............albums and videos" . I know that this message shows when there is no videos in video library. But I import lot of videos and still showing this error.
You should take a look at this "HowTo" : http://www.raywenderlich.com/13418/how-to-play-record-edit-videos-in-ios. It helped me a lot.
You will only need the first part.