Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198
SBFolderController: Difference between revisions - iPhone Development Wiki

SBFolderController: Difference between revisions

From iPhone Development Wiki
m (Added to SpringBoard's classes list)
m (Added References section)
 
Line 20: Line 20:
[rootFolderController _setInnerFolderOpen:NO animated:NO completion:nil];
[rootFolderController _setInnerFolderOpen:NO animated:NO completion:nil];
</source>
</source>
== References ==
<references/>


{{occlass|library=SpringBoard.app|navbox=1}}
{{occlass|library=SpringBoard.app|navbox=1}}

Latest revision as of 14:13, 11 August 2015

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

iOS 8

// Get an 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];

References