Difference between revisions of "SBIcon"

From iPhone Development Wiki
Jump to: navigation, search
Line 9: Line 9:
 
0 = Springboard/dock
 
0 = Springboard/dock
 
4 = Spotlight
 
4 = Spotlight
 +
 +
== Getting an SBIcon ==
 +
<source lang=objc>
 +
SBIconController *viewcont = [%c(SBIconController) sharedInstance];
 +
SBIconModel *model = [cont model];
 +
SBIcon *icon = [model expectedIconForDisplayIdentifier:identifier];
 +
</source>
  
 
== References ==
 
== References ==
 
{{IPFHeader|SpringBoard|.app}}
 
{{IPFHeader|SpringBoard|.app}}

Revision as of 19:29, 2 January 2015

SBIcon is a class representing an icon displayed by SpringBoard. It is not typically used directly; instead, its various subclasses are used: SBApplicationIcon, SBBookmarkIcon, SBDownloadingIcon, and SBDestinationHole (which is a blank space used when rearranging icons).

In iOS 5 Apple split up SBIcon, creating a separate class for SBIconView, and just leaving SBIcon with behind the scenes stuff.

Launching an Application using SBIcon

[icon launchFromLocation:4];

0 = Springboard/dock 4 = Spotlight

Getting an SBIcon

SBIconController *viewcont = [%c(SBIconController) sharedInstance];
SBIconModel *model = [cont model];
SBIcon *icon = [model expectedIconForDisplayIdentifier:identifier];

References