Skip to content

Instantly share code, notes, and snippets.

@orgmir
Last active August 29, 2015 14:24
Show Gist options
  • Save orgmir/666d7bf4f05c6d419e05 to your computer and use it in GitHub Desktop.
Save orgmir/666d7bf4f05c6d419e05 to your computer and use it in GitHub Desktop.
@interface DashboardCollectionViewCell : UICollectionViewCell
@property (weak, nonatomic) DashboardItem *dashboardItem;
+ (void) setupCell:(DashboardCollectionViewCell*)cell dashboardItem:(DashboardItem*)item;
@end
@implementation
static NSNumberFormatter *numberFormatter;
+ (NSNumberFormatter *) numberFormatter {
static NSNumberFormatter *numberFormatter = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle];
[numberFormatter setMaximumFractionDigits:1];
});
return numberFormatter;
}
+ (void) setupCell:(DashboardCollectionViewCell*)cell dashboardItem:(DashboardItem*)item
{
// HERE GOES SETUP CODE!!
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment