How can I sort iMessage images by name? - imessage

When I add images to Sticker Pack, they added unsorted. I can sort them manually, one-by-one, but how to sort all of them by name for one time?

Just found the solution.
Correct Way: (Important note - sort files in Finder correctly)
Wrong way

Related

Create a plist outside Xcode?

In our app we have lots of photos that we need to read while using the app, we have to also orgenize them into groups/categories.
this option is to make a plist with their names, and just put them into the app and read the plist.
create folders inside the app, order them inside, and read the specific folder.
Option 2 took me days and I couldn't even make it work reliably, and it also seems not the right way to work for some reason.
Option 1, the problem is that if you have 100 files you have to edit your plist every time again for a new file you add.
Is there a way to make option 1 outside of xcode so I can put all files in a folder on my mac, get their plist, and put this plist inside Xcode ?
What's the right way to achieve this ?
plist is just a simple XML file. You can create the plist file and add to xcode as any normal file to the bundle and read it.
macOS comes with two command-line tools for manipulating plists:
/usr/bin/plutil can convert a plist between formats. You might like this because you could write your photo catalog in JSON using whatever tools you like, then convert it to a plist. Of course, then you could just use JSON directly in your app…
/usr/libexec/PlistBuddy (note that /usr/libexec is not normally in one's PATH) can modify a plist in place, adding, removing, or changing entries.
Both of these tools have man pages (man plutil, man PlistBuddy) and substantial built-in help (plutil -h, /usr/libexec/PlistBuddy -h).
First, you're making a false assumption. There is no need to use a plist file here. An ordinary text file listing the names will do just fine, and you can just make up your own format to dictate groups and suchlike. And that sort of file is trivially easy to maintain.
Second, your rather confused claim that "Option 2 took me days and I couldn't even make it work reliably, and it also seems not the right way to work for some reason" is just a cop-out. Folder references are not a difficult thing to use (you can configure them in the Finder, which is as simple as you can get), they do work just fine, and they are a perfectly reasonable solution here.

Get a list of images in the project in iOS?

I imported a lot of images into my app. I could use imageNamed: for each item but it is very hard to do manually (~50 images). Can I somehow get a list of them? It is just for testing purposes, so private api is acceptable too.
Or will it be easier for me to rename them to something like 1.jpg, 2.jpg and etc.
the best way for you is rename you file to ( 1,2,3 xxx )
but there is a tool that help you to see you picture from app bundle during your coding
KSImageNamed

Adding image sets to images.xcassets catalog programmatically in iOS?

I've searched high and low on stackoverflow and google for an answer to this question. Perhaps it's not possible, or I may need to devise a different method to do this.
In our iOS app we have a whole bunch of image sets in images.xcassets. But we're moving to a more dynamic environment where we'll be downloading image sets instead.
I'd like to try and stick with the convention of having everything in the images.xcassets folder. Except as said, I want to dynamically create the image sets based on the data we retrieve from our server. Is this possible?
So there is a way to do this, but it's iOS 8.0 and above. Unfortunately, we're supporting 7 and above so I can't use it.
But for anyone else who's interested, you can use the UIImageAsset class to do what you need to do when you want to create a container for your images to encapsulate different resolutions, as the images.xcassets container currently does.
UIImageAsset docs
This answer gives a good overview of the XCAssets folder at runtime: Can I access an xcassets directory on the filesystem? - it looks like it's the wrong way of going about things.
I believe it is recommended that you use the temp or document folders, depending on the how long you wish to keep these images (https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html).

Dropbox iOS SDK "Broken"?```

I am trying to use the latest official version of the DropBox iOS Core SDK, in particular the DBRestClient, to efficiently keep a document tree up to date on my local computer. However, several features of the SDK don't seem to be implemented as you'd expect, and I was wondering whether I am doing something wrong, failing to understand something, or on the other hand just looking for features that aren't there.
Dropbox has (at least?) two kinds of entities it stores: files and folders. If I make a change to a file in Dropbox, I can detect it by a change in the file's "rev" string.
However, for folders, the rev string doesn't change when the contents changes. For example, it doesn't change in response to any of the following:
Adding a file
Deleting a file
Editing a file
Question 1:
Is this the expected behavior ? If so, does that mean that when I want to know if any of my Dropbox files have changed I must walk through the entire folder tree every time ?
Deltas:
There is a command to get a "delta" of the current contents (of something, the command takes no path parameters) related a "cursor" string. The command looks like it is supposed to return a record of edited files/folders along with a new "cursor" string specifying the current state. However, when I get the delta, the contents are always empty. If I make a change in dropbox, and then send back the previous returned "cursor", I still get an empty delta.
Question 2:
Are deltas currently working in the SDK, and if so can anyone tell me what I am doing wrong ?
Question 1: Yes, that's the expected behavior. Typically you would use delta to watch for changes.
Question 2: Yes, I would assume that delta is working. You haven't shown any code, so it's impossible to guess what's going wrong.

Get array of all images in asset catalog folder

In iOS is it possible to get an array of images (or image names) that are inside a folder of an asset catalog?
If so, how?
I'm not really sure why there is a down vote on this. I really have no idea where to start.
My alternative is to create a plist of all the files in the folders but it just seems redundant.
I can't add any code because what would I add?
Would love to get feedback on why there is a down vote though.
Of course, you can read the directories that your app owns, you can create/remove..
You can start reading NSFileManager documentation at
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/index.html
You can download the related source code as examples and see how this is done.
I hope this helps.

Resources