Skip to content

Instantly share code, notes, and snippets.

@digidigo
Created January 12, 2011 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digidigo/776532 to your computer and use it in GitHub Desktop.
Save digidigo/776532 to your computer and use it in GitHub Desktop.
Category to allow customization of the placeholder in an UITextField
#import <Foundation/Foundation.h>
@interface UITextField (ColoredPlaceholder)
@end
#import "UITextField+ColoredPlaceholder.h"
#import "AppStyle.h"
@implementation UITextField (ColoredPlaceholder)
- (void) drawPlaceholderInRect:(CGRect)rect {
[[AppStyle placeHolderTextColor] setFill];
[[self placeholder] drawInRect:rect withFont:self.font];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment