Glowing effect in a UILabel using inner shadow

Viewed 3039

I am trying to achieve this glowing effect for a UILabel as shown below :

Glow effect

I have subclassed UILabel , and created a custom label class that adds an outer shadow.

Edit : Here's the code i have used for outer shadow/glow in my custom Label class :

- (void)drawTextInRect:(CGRect)rect {
UIColor *insideColor;
UIColor *blurColor;
CGContextRef ctx = UIGraphicsGetCurrentContext();

insideColor =[UIColor colorWithRed:255/255.0 green:255/255.0 blue:191/255.0 alpha:1];
blurColor =[UIColor orangeColor];    


    CGContextSetFillColorWithColor(ctx, insideColor.CGColor);
    CGContextSetShadowWithColor(ctx, CGSizeMake(0, 0), self.glowAmount, blurColor.CGColor);
    CGContextSetTextDrawingMode(ctx, kCGTextFillStroke);

    [self.text drawInRect:self.bounds withFont:self.font lineBreakMode:self.lineBreakMode alignment:self.textAlignment];
}

But this gives me the following result

MyImage

As you can see this lacks the desired effect because of the missing inner shadow. Can anyone suggest how to achieve this?

Thanks!

1 Answers
Related