-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathUITextField.m
59 lines (47 loc) · 1.07 KB
/
UITextField.m
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// UITextField.m
// UIKit
//
// Created by Shaun Harrison on 7/20/09.
// Copyright 2009 enormego. All rights reserved.
//
#import "UITextField.h"
#import "UIColor.h"
#import <QuartzCore/QuartzCore.h>
//
// IMPORTANT NOTE:
// Do NOT layer back UI/NSTextField. It will cause a lot of issues.
//
@implementation UITextField
@synthesize backgroundColor, textColor;
- (id)initWithFrame:(NSRect)frame {
if((self = [super initWithFrame:(NSRect)frame])) {
[self setDrawsBackground:NO];
}
return self;
}
- (id)initWithCoder:(NSCoder *)aDecoder {
if((self = [super initWithCoder:aDecoder])) {
[self setDrawsBackground:NO];
}
return self;
}
- (BOOL)isFlipped {
return YES;
}
- (void)setTextColor:(UIColor *)aColor {
[textColor release];
textColor = [aColor retain];
[super setTextColor:self.textColor.NSColor];
}
- (void)setBackgroundColor:(UIColor *)aColor {
[backgroundColor release];
backgroundColor = [aColor retain];
[super setBackgroundColor:backgroundColor.NSColor];
}
- (void)dealloc {
[textColor release];
[backgroundColor release];
[super dealloc];
}
@end