iOS image picker library not displaying image preview - ios

We have been struggling with this bug for a while. It is really weird (as has been working fine in other projects). For some reason the image picker does not display the thumbnails, although the images are selectable a blank thumbnail is displayed.
Things we have already try without success:
Display this picker the first time when our app runs on the app delegate to avoid weird interactions
Use external libraries to get the images, they all present the same issue.
Create a new empty project with the same source code (only the part to display the picker)(in that case works fine)
Obviously is something related to our project setup or some weird interaction with a library... but no clue. Anyone?

Finally we found it, was a side effect of declaring a NSDictionary category to handle nil json values. Probably the library uses internally NSDictionary and was not liking our category.

Related

Asset Catalog and Media Library Access and Naming Issues

Hey there stackoverflow!
This is probably actually a really stupid question, but I'm going to ask anyway, because why not.
So I made an app mockup in Sketch, and exported the images. All good, fine, dandy. When I import the images into XCode (still in their respective folders), still - good, fine, dandy. When I try to drag and drop an image from the media library picker in Storyboard; I'm running into a problem.
In Sketch, I used symbols and had some states that were organized, Ex. 'Icons/Toggle/Blue/On' and 'Icons/Toggle/Blue/Off'. The problem is, if I also had a 'Icons/Toggle/Red/On', Media Library is putting all of the 'On' images in one... asset, I suppose?
I can see the images in the media library if I click on the 'On' asset, but I can't choose one to place onto the storyboard view, or even just drag and drop that asset.
Even worse - when I use 'provide namespace' in the assets picker, I can clearly see the images separating:
But when I go back to the storyboard - poof! Gone. And once again, all grouped together.
So - anyone know how to just pick a single image from the long list or will I have to rename everything or... is there some sort of trick?
EDIT: Just to add, I did a clean and a build run; still cannot see the images in Media Library or drag and drop them.
Solved: Though a clean and build run did not work (nor did closing the project/XCode and opening it up again), a full system reset seemed to have done the trick?
So maybe not solved but. Solvedish.

Prevent Notification thumbnail from showing when 3D-touching

I am creating notifications in an app with iOS >10. When I attach an image to this notification, it shows exactly as I want it, but when the user 3D-touch the notification, the image is shown almost full screen.
The image has almost nothing to do with my notification; it only works as an indicator, and I would like for it to keep the tiny 70px thumbnail-size when a user force-touches it, or remove it all together in this expanded state. Is this possible?
This is exactly as I want it ^
I do not want the image to grow so much!
Is there a way to prevent the thumbnail from being this huge? The image's size is 70x70..
I ended up using a NotificationContentExtension to solve this. This extension adds a new target to your project, with its own storyboard and .plist and everything. It was really overkill for my project, as it was a lot of work, but I wanted to get rid of that blown-up thumbnail.
This extension can communicate with your app, so we were able to put a lot of nice information into the extended notification, and it actually turned out looking great. You design everything yourself, like what happens when you 3D-touch a notification from the Calendar app. You could probably also use an empty xib/storyboard for this extension to simply remove the thumbnail, but I just went nuts and created gold. It is practically a UIViewController that you can design to show whatever you want.
I did read quite a few tutorials on the matter. This is one of them.

iOS custom gallery

Sorry, I've asked a similar question but I'm already suffering 3 days dealing with a simple photo gallery in my app. I just need a gallery with array of 1024x768 images, a gallery that will fit pictures properly into the screen.
I've tried
ATPagingView - worked fine but an 1024x768 image couldn't be resized properly for both orientations.
MWPhotobrowser - didn't managed to connect because i'm using ARC, even if I disabled arc for added files, there was a compile error I coudn't get rid of.
Custom UIScrollView with pages, with a scrollView for each page and imageview inside it, but it didn't help.
Please, help me somehow, did somebody make galleries like that?
Give Nimbus a try. It is an open source framework that is run by jverkoey, ex Three20 guy. It is not ARC'd yet, but you can turn ARC off for compilation and that works just fine, plus they are moving to ARC soon, already have a git branch of it. It has a photoviewer class but I've not used it yet, but I will need to, that's only one of the reasons I'm using it. Pretty happy with it so far!
I already found KTPhotoBrowser classes. They are nice and well-documented. I implemented the very simple photo browsing gallery very fast. Images are now resized properly, everything is okay. if you want a gallery, try this, for sure!

iOS iTunes Album Cover type (or similar) Image Display

Is there any tutorials that show how to make a Image display similar to the Album Art diaply in iTunes? Or anything similar. I followed code posted here, but I just cannot seem to get it working in the new XCode. Opening his project works fine, but using it in my own, the UIImageView renders the images beyond it's borders, making them appear over each other.
Any help would be appreciated.
I assume you're talking about CoverFlow?
I wrote a free, very easy to use CoverFlow library. It's modelled on the way that UITableView works, so if you can use that, you can use this. You can get it from here:
https://github.com/nicklockwood/iCarousel

Using UIImagePicker in a tabbed UIPopover

I am developing an iPad app that needs to have multiple image sources, on the device/Photo Albums, remote and some included with the app. Now the ideal situation would be to have a UIPopover controller with 3 tabs for each source. The only problem is I can't seem to figure out how to have a UIImagePicker be in its own tab. What I am trying to do is very similar to Apple's Keynote for iPad. The photo icon's popover has tabs and the far left tab called media for sure has a UIImagePicker in there. I have no idea how they did that, is it possible for me to do something like that? I think the main issue is that the Image Picker is it's own navigation controller and it cannot be pushed on to another navigation controller. Any help would be greatly appreciated!
check out this - https://github.com/key1jp/ELCImagePickerController
you can implement it with custom asset library
The built-in image picker is no good.
Create your own image picker and add it to your navigation controller as a normal view. Start from either the Matt Tuzzolo or the MyImagePicker from the WWDC 2010 sample code. Note that you probably want to add image and video preview - I copied the image viewer from MyImagePicker and added a 'add' or 'remove' button to it, and the same for video.
Your image picking is in two steps, one for selecting the group, and one for selecting the assets within the group. I recommend dividing the first step into a two - if there is only one, then go directly to that group, i.e. when you have found the first group, check whether that group was the last (block stop argument). Then push the right view controller.
Obiously modify the size of the thumbnails also, they are iPhone size now. Adding a line of metadata (icon and duration) looks much nicer and is more informative for video.
I also recommend adding a 'click-and-hold' function for extended information after like 2 seconds.
Handle different sources by creating a protocol which gives you what you want, i.e.
-(BOOL)isImageAtIndex:(NSInteger)index;
-(UIImage*)thumbnailForUndex:(NSInteger)index;
-(void)setSelectedAtIndex:(NSInteger)index;
Creating a source which handles local files, included resources and assets is perfectly possible - I use NSURLs and check on the url scheme.
Are you not using UITabBarController for your tabs? You should be able to add a UIImagePickerController directly to viewControllers. I'm not sure whether that is a supported use of the image picker, though; the documentation only mentions displaying it modally or displaying it in a UIPopoverController.
It's not usually useful to look at an Apple app to find out what you can do with various built-in controls, as Apple allows themselves to use private APIs.

Resources