This file contains hidden or 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
| @implementation AppController : CPObject | |
| { | |
| } | |
| - (void)applicationDidFinishLaunching:(CPNotification)aNotification | |
| { | |
| class_addIvar(AppController, "hello", "CPString"); | |
| alert(self.hello === nil); | |
| } |
This file contains hidden or 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
| @import <AppKit/CPView.j> | |
| @import "_Ace/ace.js" | |
| @import "_Ace/theme-twilight.js" | |
| @implementation AceView : CPView | |
| { | |
| Editor m_editor; | |
| } |
This file contains hidden or 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
| @implementation LongPressAndPanGestureRecognizer | |
| - (id)initWithTarget:(id)aTarget action:(SEL)anAction | |
| { | |
| self = [super initWithTarget:aTarget action:anAction]; | |
| if (self) | |
| [self addObserver:self forKeyPath:@"view" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:NULL]; |
This file contains hidden or 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 _KeyPathObserver : NSObject | |
| @end | |
| @implementation NSObject (Additions) | |
| - (void)performSelector:(SEL)aSelector forChangesInKeyPath:(NSString *)aKeyPath | |
| { | |
| [self addObserver:(id)[_KeyPathObserver class] forKeyPath:aKeyPath options:NSKeyValueObservingOptionNew context:aSelector]; | |
| } |
This file contains hidden or 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 _KeyPathObserver : NSObject | |
| @end | |
| @implementation NSObject (Additions) | |
| - (void)performSelector:(SEL)aSelector forChangesInKeyPath:(NSString *)aKeyPath | |
| { | |
| [self addObserver:(id)[_KeyPathObserver class] forKeyPath:aKeyPath options:NSKeyValueObservingOptionNew context:aSelector]; | |
| } |
This file contains hidden or 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
| // | |
| // UIView+PropertyAdditions.m | |
| // | |
| // Created by Francisco Tolmasky on 7/3/11. | |
| // Copyright 2011 __MyCompanyName__. All rights reserved. | |
| // | |
| #import "NSObject+KVOAdditions.h" | |
| #import "UIView+KVOAdditions.h" |
This file contains hidden or 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
| UIImageView * imageView = (UIImageView *)aGestureRecognizer.view; | |
| draggedView = [[UIImageView alloc] initWithImage:[imageView image]]; | |
| UIWindow * window = [self.view window]; | |
| BOOL areEnabled = [UIView areAnimationsEnabled]; | |
| [UIView setAnimationsEnabled:NO]; | |
| draggedView.frame = [imageView.superview convertRect:imageView.frame toView:window]; | |
| [window addSubview:draggedView]; |
This file contains hidden or 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
| -[UIGestureRecognizer _updateGestureWithEvent:] () | |
| -[UIApplication _cancelGestureRecognizers:] () | |
| -[UIView(Hierarchy) _willMoveToWindow:] () | |
| -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] () | |
| -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] () | |
| -[UIView(Hierarchy) removeFromSuperview] () | |
| -[UITableViewCell removeFromSuperview] () | |
| -[UITableView(_UITableViewPrivate) _updateAnimationDidStop:finished:context:] () | |
| -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] () | |
| +[UIViewAnimationState popAnimationState] () |
This file contains hidden or 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
| document.addEventListener("dragstart", function(event) | |
| { | |
| event.dataTransfer.setData("image/png", slides.imageRep()); | |
| event.dataTransfer.setData("slides", slides.serializedRep()); | |
| // etc. | |
| }, false); |
This file contains hidden or 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
| document.addEventListener("click", function() { /*...*/ }, false); |