Skip to content

Instantly share code, notes, and snippets.

@Sakurina
Created December 28, 2010 04:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sakurina/756912 to your computer and use it in GitHub Desktop.
Save Sakurina/756912 to your computer and use it in GitHub Desktop.
ICQuery - helpers for working with icon lists from cycript
/*
* ICQuery - helpers for working with icon lists from cycript
* by Yanik Magnan - http://r-ch.net
*
* EXAMPLES:
* i$(0) => dictionary containing the 0th icon list model and view
* i$(ilModel) => index of that icon list model in the root folder
* i$(ilView) => index of that icon list view in the root folder
*
* WHAT ABOUT NON-ROOT FOLDERS?
* /Fuck/ folders. [But when I inevitably have to deal with them,
* maybe they'll show up in here.]
*
* WHAT ABOUT XYZ FEATURE?
* Features are added as I need them. API stability is in no way
* guaranteed. You have been warned.
*/
function ICQuery(something) {
if (typeof something == "number")
return {
model: [[[SBIconController sharedInstance] rootIconListAtIndex:something] model],
view: [[SBIconController sharedInstance] rootIconListAtIndex:something]
};
if ([something isKindOfClass:SBIconListModel])
return [[[SBIconModel sharedInstance] rootFolder] indexOfIconList:something];
if ([something isKindOfClass:SBIconListView])
return [[[SBIconModel sharedInstance] rootFolder] indexOfIconList:[something model]];
return null;
}
var i$ = ICQuery;
@grp
Copy link

grp commented Dec 28, 2010

Remind my why you hate folders again? </troll>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment