Difference between revisions of "SBIconView"

From iPhone Development Wiki
Jump to: navigation, search
(Created page with ''''SBIconView''' is a UIView subclass introduced in iOS 5 that is used to display icons in SpringBoard. === Creating an Instance === <source lang="objc"> …')
 
Line 2: Line 2:
 
=== Creating an Instance ===
 
=== Creating an Instance ===
 
<source lang="objc">
 
<source lang="objc">
   SBIcon *sbicon = [[objc_getClass("SBIconModel") sharedInstance] applicationIconForDisplayIdentifier:[icondict objectAtIndex:i]];
+
   SBIcon *sbicon = [[objc_getClass("SBIconModel") sharedInstance] applicationIconForDisplayIdentifier:@"com.apple.MobileSafari"];
 
   SBIconView *view = [[objc_getClass("SBIconView") alloc]initWithDefaultSize];
 
   SBIconView *view = [[objc_getClass("SBIconView") alloc]initWithDefaultSize];
 
     // set an SBIcon to get the display name and icon image  
 
     // set an SBIcon to get the display name and icon image  

Revision as of 06:08, 10 February 2012

SBIconView is a UIView subclass introduced in iOS 5 that is used to display icons in SpringBoard.

Creating an Instance

SBIcon *sbicon = [[objc_getClass("SBIconModel") sharedInstance] applicationIconForDisplayIdentifier:@"com.apple.MobileSafari"];
   SBIconView *view = [[objc_getClass("SBIconView") alloc]initWithDefaultSize];
    // set an SBIcon to get the display name and icon image 
    [view setIcon:sbicon];
     view.delegate = self;

Delegate Methods

- (BOOL)iconAllowJitter:(SBIconView *)arg1 {
    
    return YES;
}
- (BOOL)iconPositionIsEditable:(id)arg1 {
    
    return NO;
}
- (void)iconHandleLongPress:(SBIconView *)arg1 {
    
    [arg1 setIsJittering:YES];
}
- (void)iconTouchBegan:(SBIconView *)arg1 {
    [arg1 setHighlighted:YES];
    
    
}
- (void)icon:(id)arg1 touchMovedWithEvent:(id)arg2 {
    
    
}
- (void)icon:(SBIconView *)arg1 touchEnded:(BOOL)arg2 {
    [arg1 setHighlighted:NO delayUnhighlight:NO];

}
- (BOOL)iconShouldAllowTap:(id)arg1 {
    return YES;
}
- (void)iconTapped:(SBIconView *)arg1 {
    [arg1.icon launchFromViewSwitcher];
}
- (BOOL)icon:(id)arg1 canReceiveGrabbedIcon:(id)arg2 {
    return NO;
}

- (int)closeBoxTypeForIcon:(id)arg1 {
    
    return 1;
}
- (void)iconCloseBoxTapped:(id)arg1 {
    
}
- (BOOL)iconShouldPrepareGhostlyImage:(id)arg1 {
    
    return YES;
}
- (BOOL)iconViewDisplaysBadges:(id)arg1 {
    
    return NO;
}