-
Notifications
You must be signed in to change notification settings - Fork 76
Quick How To's
From Issue #65:
[UIView animateWithDuration:defaultAnimationDuration animations:^{
[self.myButton cas_updateStyling];
}];
From Issue #69
In the stylesheet:
MyView.myClass {
background-image-path: "http://somewhere.com/images/icon.png"
}
In code, declare a property:
@interface MyView
@property (nonatomic) NSString* backgroundImagePath;
@end
Then override cas_updateStyling
and use something like UIKit+AFNetworking to load the image:
@implementation MyView
- (void)cas_updateStyling {
[super cas_updateStyling]
[self.imageView setImageWithURL:[NSURL URLWithString:self.backgroundImagePath]]
}
@end
From Issue #72
Enums cannot be automatically picked up by reflection in objc so anything which is an enum value uses a custom mapping. For contentMode mappings, see this code.
From Issue #73
See the Custom Views section of the documentation.
From Issue #94
Add the following to your app delegate application:didFinishLaunchingWithOptions: method:
if UIDevice.currentDevice().systemName.compare("iPhone Simulator") == .OrderedSame {
let curFilePath = __FILE__
let curFileDir = curFilePath.stringByDeletingLastPathComponent;
let styleFilePath = curFileDir.stringByAppendingPathComponent("StyleSheets/stylesheet.cas")
CASStyler.defaultStyler().watchFilePath = styleFilePath
}
From Issue #64
Call the following, replacing myView with your view:
[CASStyler.defaultStyler styleItem:myView];
From Issue #48
The way web devs did this before :nth-child was invented was to append a class of "even" to the even table rows and define the styles for .even in your CSS file. Could do the same with Classy and would be more in line with what I think is great about the separation between style and content that Classy provides. I can work up an example if you want more details.
From Issue #11