SBFolderController: Difference between revisions

From iPhone Development Wiki
(Created page with "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 SBF...")
 
No edit summary
Line 17: Line 17:
[[[%c(SBIconController) sharedInstance] _rootFolderController] _setInnerFolderOpen:NO animated:NO completion:nil];
[[[%c(SBIconController) sharedInstance] _rootFolderController] _setInnerFolderOpen:NO animated:NO completion:nil];
</source>
</source>
--[[User:Broganminer|Broganminer]] ([[User talk:Broganminer|talk]]) 13:45, 1 March 2015 (PST)

Revision as of 00:02, 2 March 2015

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
SBFolderController *innerFolder = [[[[[%c(SBIconController) sharedInstance]  controllerClassForFolder:[iconView.icon folder]] alloc] initWithFolder:[iconView.icon folder] orientation:[[%c(SBIconController) sharedInstance] orientation] viewMap:[[[%c(SBIconController) sharedInstance] _rootFolderController] _viewMap]] autorelease];
//Tell rootFolderController we have an innerFolderController
[[[%c(SBIconController) sharedInstance] _rootFolderController] setInnerFolderController:innerFolder];


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


//To close folder
[[[%c(SBIconController) sharedInstance] _rootFolderController] _setInnerFolderOpen:NO animated:NO completion:nil];