Created
August 5, 2014 03:44
-
-
Save ks-simakov/ad58093328c90de4070c to your computer and use it in GitHub Desktop.
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
// | |
// UITextField+Paddings.h | |
// | |
// Created by Konstantin Simakov | |
// | |
#import <Foundation/Foundation.h> | |
@interface UITextField (Paddings) | |
-(void) setLeftPadding:(int) paddingValue; | |
-(void) setRightPadding:(int) paddingValue; | |
@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
// | |
// UITextField+Paddings.m | |
// | |
// Created by Konstantin Simakov | |
// | |
#import "UITextField+Paddings.h" | |
@implementation UITextField (Paddings) | |
-(void) setLeftPadding:(int) paddingValue | |
{ | |
UIView *paddingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, paddingValue, self.frame.size.height)]; | |
self.leftView = paddingView; | |
self.leftViewMode = UITextFieldViewModeAlways; | |
} | |
-(void) setRightPadding:(int) paddingValue | |
{ | |
UIView *paddingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, paddingValue, self.frame.size.height)]; | |
self.rightView = paddingView; | |
self.rightViewMode = UITextFieldViewModeAlways; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment