Skip to content

Instantly share code, notes, and snippets.

@kharmabum
Last active December 14, 2015 14:49
Show Gist options
  • Select an option

  • Save kharmabum/5103384 to your computer and use it in GitHub Desktop.

Select an option

Save kharmabum/5103384 to your computer and use it in GitHub Desktop.
Generic custom UITableViewCell with Nib
//
// FTCustomUITableViewCellWithNib.m
// Created by Juan-Carlos Foust on 06/03/2013.
//
#import "FTCustomUITableViewCellWithNib.h"
static UIImage *_placeholderImage = nil;
@interface FTGenericUITableViewCellWithNib ()
@property (strong, nonatomic) UIImage *placeHolderImage;
@end
@implementation FTCustomUITableViewCellWithNib
//FileOwner in nib file not set. Class on UITableViewCell in nib file set to FTCustomUITableViewCellWithNib
@dynamic placeHolderImage;
- (UIImage *)placeholderImage
{
if (!_placeholderImage) {
_placeholderImage = [UIImage imageNamed:@"<#image-name#>.png"];
}
return _placeholderImage;
}
- (void)prepareForReuse
{
[super prepareForReuse];
}
- (void)setup
{
}
- (void)awakeFromNib
{
[super awakeFromNib];
[self setup];
}
- (NSString *)reuseIdentifier
{
return NSStringFromClass([self class]);
}
+ (CGFloat)heightForInfo:(NSDictionary *)info
{
CGFloat height = 0;
//calculate height
return height;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment