Skip to content

Instantly share code, notes, and snippets.

@jontelang
Created April 28, 2013 14:26
Show Gist options
  • Save jontelang/5477026 to your computer and use it in GitHub Desktop.
Save jontelang/5477026 to your computer and use it in GitHub Desktop.
ddd
#include "Preferences/Preferences.h"
@interface PSTableCell ()
- (id)initWithSpecifier:(PSSpecifier *)specifier;
- (id)initWithStyle:(UITableViewCellStyle)x reuseIdentifier:(id)y specifier:(id)z;
@end
@interface CustomCell : PSTableCell {//<PreferencesTableCustomView> {
UILabel *_label;
}
@end
@implementation CustomCell
- (id)initWithSpecifier:(PSSpecifier *)specifier
{
self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell" specifier:specifier];
if (self) {
CGRect frame = [self frame];
_label = [[UILabel alloc] initWithFrame:frame];
[_label setLineBreakMode:UILineBreakModeWordWrap];
[_label setNumberOfLines:0];
[_label setText:@"You can use attributed text to make this prettier."];
[_label setBackgroundColor:[UIColor clearColor]];
[_label setShadowColor:[UIColor whiteColor]];
[_label setShadowOffset:CGSizeMake(0,1)];
[_label setTextAlignment:UITextAlignmentCenter];
[self addSubview:_label];
[_label release];
}
return self;
}
- (float)preferredHeightForWidth:(float)arg1
{
// Return a custom cell height.
return 60.f;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment