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
dispatch_queue_t queue = dispatch_queue_create("PlusFlickrPhotoView Queue", DISPATCH_QUEUE_CONCURRENT); | |
dispatch_async(queue, ^{ | |
// force decompress of image | |
UIGraphicsBeginImageContext(CGSizeMake(1, 1)); | |
[image drawAtPoint:CGPointZero]; | |
UIGraphicsEndImageContext(); | |
// set the image on main thread | |
dispatch_sync(dispatch_get_main_queue(), ^{ |
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
+ (CAKeyframeAnimation *)jumpAnimation | |
{ | |
// these three values are subject to experimentation | |
CGFloat initialMomentum = 150.0f; // positive is upwards, per sec | |
CGFloat gravityConstant = 250.0f; // downwards pull per sec | |
CGFloat dampeningFactorPerBounce = 0.6; // percent of rebound | |
// internal values for the calculation | |
CGFloat momentum = initialMomentum; // momentum starts with initial value | |
CGFloat positionOffset = 0; // we begin at the original position |
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 <objc/runtime.h> | |
@implementation UIView (DTActionHandlers) | |
- (id)tapActionBlock | |
{ | |
return objc_getAssociatedObject(self, "DTActionHandlerTap"); | |
} | |
- (void)addTapActionWithBlock:(void (^)(void))block |
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 "UIView+DTActionHandlers.h" | |
#import <objc/runtime.h> | |
char * const kDTActionHandlerTapBlockKey = "DTActionHandlerTapBlockKey"; | |
char * const kDTActionHandlerTapGestureKey = "DTActionHandlerTapGestureKey"; | |
char * const kDTActionHandlerLongPressBlockKey = "DTActionHandlerLongPressBlockKey"; | |
char * const kDTActionHandlerLongPressGestureKey = "DTActionHandlerLongPressGestureKey"; | |
@implementation UIView (DTActionHandlers) |
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
- (void)drawTextInRect:(CGRect)rect | |
{ | |
[super drawTextInRect:rect]; | |
CGContextRef ctx = UIGraphicsGetCurrentContext(); | |
NSString *fontName = self.font.fontName; | |
CGFloat fontSize = self.font.pointSize; | |
CTFontRef font = CTFontCreateWithName((__bridge CFStringRef)fontName, fontSize, 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
Please help complete and sort this list. These are the icons visible in the WWDC 2012 Banner. Roughly sorted by size. | |
http://www.cocoanetics.com/files/WWDC2012_Banner.png | |
alternate, high res pictures of the Banner: | |
http://cdn.macrumors.com/article-new/2012/06/photo.jpg | |
Path - http://itunes.apple.com/us/app/path/id403639508?mt=8 | |
Star Walk - http://itunes.apple.com/app/star-walk-guide-dastronomie/id295430577?mt=8 | |
Instagram - http://itunes.apple.com/us/app/instagram/id389801252?mt=8 |
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
Process: GeoCorder [45519] | |
Path: /Users/USER/Library/Application Support/iPhone Simulator/*/GeoCorder.app/GeoCorder | |
Identifier: GeoCorder | |
Version: ??? (???) | |
Code Type: X86 (Native) | |
Parent Process: launchd [131] | |
Date/Time: 2012-07-10 21:32:53.939 +0300 | |
OS Version: Mac OS X 10.7.4 (11E53) | |
Report Version: 9 |
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
- (void)recordLocation:(CLLocation *)location | |
{ | |
if (previousRecordedLocation) | |
{ | |
NSTimeInterval interval = [location.timestamp timeIntervalSinceDate:previousRecordedLocation.timestamp]; | |
NSTimeInterval distance = [location distanceFromLocation:previousRecordedLocation]; | |
CLLocationDistance currentSpeed = distance/interval; | |
if (previousRecordedSpeed) |
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
- (void)drawCIImage:(CIImage *)image | |
{ | |
CGRect rect = [image extent]; | |
// http://stackoverflow.com/questions/8778117/video-filtering-in-iphone-is-slow | |
GLuint _renderBuffer; | |
CGContextRef cgContext; | |
CIContext *coreImageContext; | |
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
- (void)drawCIImage:(CIImage *)image | |
{ | |
CGRect rect = [image extent]; | |
CIContext *coreImageContext; | |
EAGLContext *glContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; | |
[EAGLContext setCurrentContext:glContext]; | |
// http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/WorkingwithEAGLContexts/WorkingwithEAGLContexts.html |