Last active
August 29, 2015 14:13
-
-
Save csknns/9b9cf701b3d521f6820b to your computer and use it in GitHub Desktop.
TextFieldsWithInsets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TextFieldsWithInsets.h | |
// | |
// | |
// Created by Christos Koninis on 11/26/12. | |
// | |
// | |
#import <UIKit/UIKit.h> | |
@interface TextFieldsWithInsets : UITextField | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TextFieldsWithInsets.m | |
// | |
// | |
// Created by Christos Koninis on 11/26/12. | |
// | |
// | |
#import "TextFieldsWithInsets.h" | |
@implementation TextFieldsWithInsets | |
- (id)initWithFrame:(CGRect)frame | |
{ | |
self = [super initWithFrame:frame]; | |
if (self) { | |
// Initialization code | |
} | |
return self; | |
} | |
// placeholder position | |
- (CGRect)textRectForBounds:(CGRect)bounds { | |
return CGRectInset( bounds , 15 , 0 ); | |
} | |
// text position | |
- (CGRect)editingRectForBounds:(CGRect)bounds { | |
return CGRectInset( bounds , 15 , 0 ); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment