SBFolderController

From iPhone Development Wiki
Revision as of 00:07, 2 March 2015 by Uroboro (talk | contribs) (Readability)

SBFolderController is the superclass of SBRootFolderController you can use this to create a new instance of SBFolderController for any SBFolder (you could also use another SBFolderController, this is relevant with folders in folders). This is useful if you need a SBFolderView.

iOS 8

//Create instance of SBFolderController
SBIconController *iconController = [%c(SBIconController) sharedInstance];
SBRootFolderController *rootFolderController = [iconController _rootFolderController];
SBFolder *folder = [iconView.icon folder];
Class controllerClass = [iconController controllerClassForFolder:folder];

SBFolderController *innerFolder = [[[controllerClass alloc] initWithFolder:folder orientation:[iconController orientation] viewMap:[rootFolderController _viewMap]] autorelease];
//Tell rootFolderController we have an innerFolderController
[rootFolderController setInnerFolderController:innerFolder];

//Folder view retrieved with:
SBFolderView *view = [innerFolder contentView];

//To close folder
[rootFolderController _setInnerFolderOpen:NO animated:NO completion:nil];