Please let me know how to use this custom UITextField
in my UIViewController
I am using storyboards.
#import <UIKit/UIKit.h>
@interface MYTextField : UITextField
@end
@implementation MYTextField
- (CGRect)textRectForBounds:(CGRect)bounds {
int margin = 10;
CGRect inset = CGRectMake(bounds.origin.x + margin, bounds.origin.y, bounds.size.width - margin, bounds.size.height);
return inset;
}
- (CGRect)editingRectForBounds:(CGRect)bounds {
int margin = 10;
CGRect inset = CGRectMake(bounds.origin.x + margin, bounds.origin.y, bounds.size.width - margin, bounds.size.height);
return inset;
}
this code add some margin to left side of text field. Try this worked for me.