ypasswordiphone/YShadowLabel.m
Yann Esposito (Yogsototh) bc5acff2b5 Remove some unused Log
2011-03-20 11:15:48 +01:00

51 lines
1.1 KiB
Objective-C

//
// YShadowLabel.m
// YPassword
//
// Created by Yann Esposito on 26/09/10.
// Copyright 2010 yannesposito. All rights reserved.
//
#import "YShadowLabel.h"
@implementation YShadowLabel
@synthesize blurRadius;
- (id)initWithFrame:(CGRect)frame {
if ((self = [super initWithFrame:frame])) {
// Initialization code
self.blurRadius = [NSNumber numberWithFloat:5.0];
}
return self;
}
- (void)awakeFromNib {
// Initialization code
self.blurRadius = [NSNumber numberWithFloat:5.0];
}
- (void) drawTextInRect:(CGRect)rect {
CGContextRef myContext = UIGraphicsGetCurrentContext();
CGContextSaveGState(myContext);
CGContextSetShadow (myContext, self.shadowOffset, 1);
CGColorSpaceRef myColorSpace = CGColorSpaceCreateDeviceRGB();
CGColorRef myColor = [self.shadowColor CGColor];
CGContextSetShadowWithColor (myContext, self.shadowOffset, (CGFloat)[self.blurRadius floatValue], myColor);
[super drawTextInRect:rect];
CGColorSpaceRelease(myColorSpace);
CGContextRestoreGState(myContext);
}
- (void)dealloc {
[super dealloc];
}
@end