Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CGContextRef context = UIGraphicsGetCurrentContext();
- UIColor *color = [UIColor colorWithRed: 0.029 green: 0.195 blue: 0.288 alpha: 1];
- UIColor *shadowColor = [UIColor colorWithRed: 1 green: 1 blue: 1 alpha: 0.71];
- CGSize shadowOffset = CGSizeMake(0.1, 1.1);
- CGFloat shadowBlurRadius = 1;
- NSString *yourTicket = @"Your ticket to ticket";
- NSString *every = @"every";
- CGRect textRect = CGRectMake(32, 41, 183, 25);
- CGContextSaveGState(context);
- CGContextSetShadowWithColor(context, shadowOffset, shadowBlurRadius, shadowColor.CGColor);
- [color setFill];
- [yourTicket drawInRect:textRect withFont:[UIFont fontWithName:@"Helvetica" size:12] lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentCenter];
- CGContextRestoreGState(context);
- CGRect text2Rect = CGRectMake(100, 41, 89, 26);
- CGContextSaveGState(context);
- CGContextSetShadowWithColor(context, shadowOffset, shadowBlurRadius, shadowColor.CGColor);
- [[UIColor blackColor] setFill];
- [every drawInRect:text2Rect withFont:[UIFont fontWithName:@"Helvetica-Bold" size:12] lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentCenter];
- CGContextRestoreGState(context);
- // result http://cl.ly/image/0W280W2y2a2a
Advertisement
Add Comment
Please, Sign In to add comment