Asset Catalog and Media Library Access and Naming Issues - ios

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.

Related

Its just impossible to add an action extension icon

I've been literally trying for two weeks to get an icon for an action extension to appear, but absolutely nothing works.
I've seen past questions such as this iOS 8 Action Extension icon sizes and this Why isn't my iOS8 Application Action Extension App Icon showing up? but they are of no use.
I've created an Xcode template project purely to try every combination of things mentioned in the other questions, still without avail.
1) The first thing that's mentioned is that the action extension should have its own asset catalog, ok here it is:
2) Secondly that it should contain an app icon image set, here that is:
3) Thirdly people say they had to add its target membership to the extension and to the app. Here that is too (in all of these things, I've tried variations such the membership being just the extension, just the app, both)
4) Fourthly, people mention they had to add it to the compile sources, here that is, as well as it being copied in the bundle resources:
5) Some say it also needs to be copied in the container app's bundle, here that is, and for good measure its been added as a compile resource of that too:
6) One person says it was necessary to add the container apps assets to the extension bundle, I can't see how that would work as the icons in the container app are colored and not matching the requirements of the extension icons, but what the hell, might as well try everything right, and while we're at it lets add assets everywhere:
7) The asset icon itself is important, colored icons are not displayed, but I tried it anyway. A simple black and white image is described as the white parts appearing as grey but I've tried that anyway. Trying unsupported icons was just desperation and experimentation, of course I'm actually using an icon with a transparent background. When posted here it appears on this webpage as all white of course, but the non-black parts are actually fully transparent and have an alpha of 0:
But despite trying many combinations of all the various steps above, this is what it looks like on the device:
This is using iOS 10.n, latest 10.7 (it hasn't worked with any beta) and Xcode 8.6. If I download an app from the app store that uses action extensions then their icons are appearing, so there's no issue with the 10 beta. The issue is either something building the app with Xcode beta, or some step I've missed out - if that is the case, then what?
Finally found out the solution - in order to get it to work its additionally necessary to set the Asset Catalog compiler options of Build Settings section of the extension to specify the name of the app icon set within the asset catalog:
How to set an action icon really is the most appallingly badly documented aspect of iOS, totally shockingly awful.

Where should I put background and button image files? Assets or just drag into the app files?

I am making an app but I'm not quite sure where should I put the image files? Just drag and copy inside the app or in assests? What's the difference, I'm not quite sure.
I'd strongly recommend using the xcassets, which you can do by dragging your files onto it when you have it open in Xcode. Xcode handles the rest, copying them into your project. Doing this also allows you do call UIImage(imageNamed:), using the title you give to each Image Set. You also don't have to worry about specific naming of the different size classes, as you drag them to the appropriate section there.

Changing old UI on Xcode to new UI

This is a newbie question. But I would like to change my old UI (pngs) on my current project to some new updated ones that are of similar size. Is there anyway to drag and drop the UI directly without affecting the actions so the buttons still work the same on the app. Or do you have to recode everything when you change UI? I'm not really sure the steps I need to do, but I have all the new UI ready to go. Can anybody guide me through these steps?
Another question is, I have a video editor and want to test out a video player in the simulator at run time, but right now I can see my music or video files because I don't have any in the simulator. How do I import these files into a project to test it out (on the computer), I know the camera roll on a phone would work.
If anybody can give me some guidance, I would greatly appreciate it. I know these are newbie questions.
Thanks,
If the new images are the same size of the old images, just rename the new images exactly like the old images and then overwrite the old images at the project's path.
And for the video files, drag the video files directly to the iOS simulator. The video will open in the Safari, click the share button in the tab bar of the safari and hit "Save Video".

iOS image picker library not displaying image preview

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.

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!

Resources