This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface AppDelegate : NSObject <NSApplicationDelegate, NSOutlineViewDataSource, NSOutlineViewDelegate> | |
@end | |
@implementation AppDelegate { | |
NSWindow *_w; | |
NSDictionary *_data; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)_setValue:(CGFloat)value forAnimatedKey:(NSString *)animationKey | |
{ | |
POPSpringAnimation *ps = [self pop_animationForKey:animationKey]; | |
if (!ps) { | |
ps = [POPSpringAnimation animation]; | |
ps.property = [POPAnimatableProperty propertyWithName:animationKey initializer:^(POPMutableAnimatableProperty *prop) { | |
prop.readBlock = ^(DEViewerView *view, CGFloat *vs) { | |
vs[0] = [[view valueForKey:animationKey] floatValue]; | |
}; | |
prop.writeBlock = ^(DEViewerView *view, const CGFloat *vs) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//o is an object type, k is the key on which to check validity | |
//returns a NSString constant of the relevant key | |
#define KVC(o, k) (0 && sizeof(o.k) ? @#k : @#k) | |
//Usage: | |
ObjectWithMethodCalledKeyName *object = ...; | |
[object addObserver:self forKeyPath:KVC(object, keyName) options:0 context:NULL]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Declare a 2D texture as a uniform variable | |
uniform sampler2D texture; | |
uniform float samples; | |
void main() | |
{ | |
vec2 poissonDisk[8]; | |
poissonDisk[0] = vec2(-0.613392, 0.617481); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface A : NSObject | |
- (void)doSomething; | |
@end | |
@implementation A | |
- (void)doSomething; | |
{ |
NewerOlder