iPhone - custom UIImagePickerController - iphone

I am showing a UIImagePickerController in an app that just works with videos. So, it is nonsense to show pictures to users.
I have changed all properties I see on the controller but the picker shows like the next picture.
Two questions:
How do I get rid of this choice and show just the Photo Library, without having to tap first to get there.
As far as I know, all videos shot with iPhone end on camera roll. Suppose the iPad gets a camera in the future. Does this Photo Library option include the camera roll or what?
thanks in advance.

You can probably use this and customize to fit your needs.
http://www.icodeblog.com/cloning-uiimagepickercontroller-using-the-assets-library-framework/
I found some issues with it, mostly that it takes a while to load on a device when there are 200+ images. I have not dug into to much, but this might be a start for you.

Not sure if this helps but to access the camera roll directly you just need to set your UIImagePickerController source like this:
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;

Related

Is it possible to avoid the "use"/"retake" screen after taking a photo in an iOS app?

i have hired a programmer to create an iPhone app for me. The purpose of the app is to take a photo and upload it to a server. We want to make a special purpose screen to review the photo before uploading it. This specially developed screen will crucially have zooming functionality.
He claims that after taking a photo, it is impossible to avoid the "use"/"reuse" screen to show up, so now we have two screens to review the photo. First the standard one from Apple, then our own with zoom. Is he right about that? It just sounds so unreasonable that Apple would put such a restriction.
Edit: I mean taking a photo using the camera.
As par Apple's documentation
To perform fully-customized image or movie capture, instead use the AV
Foundation framework as described in “Media Capture and Access to
Camera” in AV Foundation Programming Guide. To create a
fully-customized image picker for browsing the photo library, use
classes from the Assets Library framework. For example, you could
create a custom image picker that displays larger thumbnail images,
that makes use of EXIF metadata including timestamp and location
information, or that integrates with other frameworks such as Map Kit.
For more information, see Assets Library Framework Reference. Media
browsing using the Assets Library framework is available starting in
iOS 4.0
In short yes it is possible check out this sample
[Update]
Use the allowsEditing property on your UIImagePickerController
imagePickerController.allowsEditing = NO;
Previous answer was a bit of a hack to take advantage of a code path that didn't show the buttons but wasn't awesome.
[Previous answer]
You can actually avoid it without going through the hassle of setting up your own image capture from AV Foundation.
Including the following will remove the need to show the "review" screen. All you have to do is put in a few of your own buttons and wire them up to the appropriate functionality.
[self.imagePickerController setShowsCameraControls:NO];
It is a little bit too late I know, but for future reference:
This is far more simple that the answers already provided,
what you are looking for is the allowsEditing option.
imagePickerController.allowsEditing = NO;
That should be enough to avoid showing the "Retake"/"Use" screen after the user takes a picture.

iPhone/ iPad app development TV Out

HI,
I have just submitted my first application to iTunes for approval, however, there is one thing I really want to add to it ASAP.
I would like to code into an app that it can use the TV Out functions of both the iPhone and iPad? Ideally it would work in a similar way to how keynote works i.e. you see a bit more on the iPad itself than is projected on the TV, but even just mirroring the screen would be a step in the right direction.
I have searched all over for this and all I keep getting is about downloading jailbreaks for you iPhone to mirror the screen, which doesn't really help.
Thanks in advance,
If you just want to mirror, use my TVOutManager singleton. I've put up code to do this on github: https://github.com/robterrell/TVOutManager (Hmmm... I just noticed I haven't pushed the most recent code. I'll review and push new code asap.) I wrote up some detailed info about it at http://www.touchcentric.com/blog/archives/123 if you want to know the how's and why's.
Basically, just add the files to your project, and call:
[[TVOutManager sharedInstance] startTVOut];
If you want to do more than mirroring, read the docs on UIScreen. It's fairly trivial to create a UIWindow on the external screen (steal the bits from TVOutManager if you need to) and add subviews to it. This way you could have a Keynote-like controller on the device screen, while the main display is on the external display.
http://mattgemmell.com/2010/06/01/ipad-vga-output should get you started ...
Mirroring is not possible.
But to draw on an external display, just get the UIScreen object for the external display, then set the screen property of a UIWindow to it, (making sure to set the frame correctly etc) everything in that window should be drawn on the respective display.
Relative links:
developer.apple.com/library/ios/#documentation/uikit/reference/UIWindow_Class/UIWindowClassReference/UIWindowClassReference.html (look at screen property)
developer.apple.com/library/ios/#documentation/uikit/reference/UIScreen_Class/Reference/UIScreen.html (look at +screens)
(I don't have any reputation => can't post clickable links)
I think, you can't do this. You can only stream videos from iPod app.
But, if you have jailbreak on your device, try this (link) or take a look at this great YouTube video (link) showing exactly what you need.

UIImagepickercontroller: is it possible to change the sort order of the images in camera roll?

Basically the app im working on would be a lot less of a pain if users didn't have to scroll to the very bottom of their camera roll to get their most recent photos, I want the most recent at the top, wouldn't this make sense anyway? Not sure why apple designed it this way, or if im just not realizing something.
Thanks
nick
If you don't mind adding an extra step of selecting the camera roll from an album list you can try changing your sourceType from SavedPhotoAlbums to PhotoLibrary:
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
After selecting the desired album, the next photo selection view will show the most recent images at the bottom.
There is no way to customize UIImagePickerController in this way, but as of iOS 4.0, you can basically build your own image picker in any way you like using the AssetsLibrary framework.
You can get images, using ALAsset in an arry, and then can sort them as you want and use in table view or collectionview to build your own custom album

When using the UIImagePickerController in iOS4 to pick from the photo library can you start w/newest first?

Is there a way to show the UIImagePickerController photo library interface such that when it comes up it starts at the bottom of the library which is where the newest images are in iOS4? Apparently this is how it worked in 3.x.
Thanks
Try changing your sourceType from SavedPhotoAlbums to PhotoLibrary:
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
After selecting the desired album, the next photo selection view will show the most recent images at the bottom.
However, this adds an additional step, since users need to select an album before viewing the photos. This works for the Camera Roll, but synced albums still show photos at the top.
I'm not too familiar with iOS dev, but looking at the doc for this # Apple: http://developer.apple.com/iphone/library/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html
I don't see any way you can do this in one go.
Did you try simply scrolling down after loading the image picker? Or is that not possible?
Sorry, just throwing ideas out there.
Cheers,
Turns out the answer here is no.

How to make UI Image Picker Controller read a custom source type in iPhone

I have to create a photo gallery app in iPhone. It should function same as the Photos app which is shipped with iPhone. But it should show the images which I package with the app.
UIImagePickerController reads only the following source types.
UIImagePickerControllerSourceTypePhotoLibrary,
UIImagePickerControllerSourceTypeCamera,
UIImagePickerControllerSourceTypeSavedPhotosAlbum
I was thinking of adding the images bundle to the resources group in Xcode and make UIImagePickerController to read them and display.
Looking at the class references I found UIImagePickerController reads only from the resources mentioned above. Which means it can only pick the images from camera roll OR saved photo gallery OR allow user to take a pic and use it.
Does anybody know how to make UIImagePickerController read from custom source type or images?
OR
How to create a photo gallery app in iPhone :-)
Thanks,
AJ
I don't believe it is possible to make the UIImagePicker pick images from your own source. You will have to write the picker yourself (which, performance aside, doesn't seem to hard... Just a couple of UIImageViews in a UIScrollView).
Just today I started a open source UIImagePickerController clone, it is not perfect but it works quite ok. Feel free to fork http://github.com/jeena/JPImagePickerController