ClassyKit / Classy

Expressive, flexible, and powerful stylesheets for UIView and friends.
http://classykit.github.io/Classy/
MIT License
740 stars 77 forks source link

TableViewCell customization #71

Closed tbrannam closed 10 years ago

tbrannam commented 10 years ago

It would be great to see some wrappers around cell customization - specifically things like selectedbackgroundcolor.

Additional examples/docs around creating custom implementations would be good too.

CASObjectClassDescriptor *objectClassDescriptor = [[CASStyler defaultStyler] objectClassDescriptorForClass:[UITableViewCell class]];
CASArgumentDescriptor *colorArg = [CASArgumentDescriptor argWithClass:UIColor.class];
[objectClassDescriptor setArgumentDescriptors:@[colorArg] setter:@selector(setSelectedBackgroundColor:) forPropertyKey:@"selectedBackgroundColor"];
cloudkite commented 10 years ago

@tbrannam alot of properties are picked up automatically using reflection, however if its declared as a selector in the header or if it takes a enum then It cant be detected automatically. If you find anything missing please submit a PR or issue. Sorry docs definitely need a bit of work

tbrannam commented 10 years ago

So UITableViewCell's don't accept a color for selected background color, instead they are customized in a non-UIAppearance fashion. The typical implementation for a solid color is create a proxy view, and set a background color to that. Or alternatively provide an image instead of a color.

thanks for making this library available