-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdvancedTextField.m
More file actions
36 lines (28 loc) · 829 Bytes
/
AdvancedTextField.m
File metadata and controls
36 lines (28 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// CredentialsTextField.m
// Upside
//
// Created by Maksim Horbul on 9/15/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "AdvancedTextField.h"
@implementation AdvancedTextField
@synthesize placeholderColor = _placeholderColor;
@synthesize placeholderFont = _placeholderFont;
-(UIColor *)placeholderColor {
return (_placeholderColor == nil) ? [UIColor lightGrayColor] : _placeholderColor;
}
-(UIFont *)placeholderFont {
return (_placeholderFont == nil) ? [self font] : _placeholderFont;
}
- (void)drawPlaceholderInRect:(CGRect)rect{
[[self placeholderColor] setFill];
[[self placeholder] drawInRect:rect withFont:[self placeholderFont]];
[super drawRect:rect];
}
-(void)dealloc {
[_placeholderColor release];
[_placeholderFont release];
[super dealloc];
}
@end