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
2010-08-28 21:00:49.045 CTTest[22262:a0f] aaaaa{ | |
NSFont = "\"Helvetica 96.00 pt. P [] (0x10019b1a0) fobj=0x10019b1a0, spc=26.67\""; | |
NSUnderline = 9; | |
} |
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
#import <UIKit/UIKit.h> | |
@interface MyAwesomeView : UIView | |
{ | |
UILabel *textLabel; | |
UIButton *button; | |
NSUInteger counter; | |
} |
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
#import "MyAwesomeView.h" | |
@interface MyAwesomeView () | |
- (void)updateDisplay; | |
@end | |
@implementation MyAwesomeView | |
@synthesize textLabel; | |
- (void)dealloc; |
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
for (id p in self.lines) | |
{ | |
//if (i >= self.numberOfLines && self.numberOfLines) | |
// break; | |
CGPoint origin = self.lineOrigins[i++]; | |
CGContextSetTextPosition(ctx, origin.x , origin.y); | |
CTLineRef line = (CTLineRef)p; | |
CGFloat ascent, descent, leading; |
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)drawRect:(CGRect)rect; | |
{ | |
CGAffineTransform flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, CGRectGetHeight(self.bounds)); | |
CTFramesetterRef ref = CTFramesetterCreateWithAttributedString((CFAttributedStringRef)self.attributedString); | |
UIBezierPath *path = [UIBezierPath bezierPathWithRect:self.bounds]; | |
CTFrameRef ctFrame = CTFramesetterCreateFrame(ref, CFRangeMake(0, 0), [path CGPath], NULL); | |
CGContextRef ctx = UIGraphicsGetCurrentContext(); | |
CGContextConcatCTM(ctx, flipVertical); |
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
+ (id)sharedInstance | |
{ | |
static id sharedInstance; | |
static dispatch_once_t once; | |
dispatch_once(&once, ^{ sharedInstance = [[self alloc] init]; }); | |
return sharedInstance; | |
} |
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
#import "PrivatesTestViewController.h" | |
@interface PrivatesTestViewController (Privates) | |
@property (nonatomic, retain) IBOutlet UIView *testView; | |
@end | |
@interface PrivatesTestViewController () | |
@property (nonatomic, retain) UIView *testView; | |
@end |
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
#import "JWPatternImageView.h" | |
@implementation JWPatternImageView | |
@synthesize patternImage; | |
- (void)dealloc; | |
{ | |
self.patternImage = nil; | |
[super dealloc]; | |
} |
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)drawRect:(CGRect)rect; | |
{ | |
CGContextRef ctx = UIGraphicsGetCurrentContext(); | |
CGContextSetBlendMode(ctx, kCGBlendModeCopy); | |
CGContextDrawImage(ctx, (CGRect){CGPointZero, self.topImage.size}, [self.topImage CGImage]); | |
CGContextSaveGState(ctx); | |
CGContextClipToRect(ctx, CGRectMake(0, self.topImage.size.height, self.bounds.size.width, self.bounds.size.height - self.topImage.size.height - self.bottomImage.size.height)); | |
CGContextDrawTiledImage(ctx, (CGRect){CGPointZero, self.middleImage.size}, [self.middleImage CGImage]); | |
CGContextRestoreGState(ctx); |
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
@implementation UIView (Responder) | |
- (UIView *)currentFirstResponder; | |
{ | |
for (UIView *view in [self subviews]) | |
{ | |
if ([view isFirstResponder]) | |
return view; | |
if (![view isKindOfClass:[UIControl class]]) | |
{ | |
UIView *subview = [view currentFirstResponder]; |
OlderNewer