File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -43,32 +43,33 @@ @implementation MPNumericTextField
43
43
44
44
- (id )initWithCoder : (NSCoder *)aDecoder {
45
45
if ((self = [super initWithCoder: aDecoder])) {
46
- [self setDefaults ];
46
+ [self setDefaultsWithForcedAlignment: NO ];
47
47
}
48
48
return self;
49
49
}
50
50
51
51
- (id )initWithFrame : (CGRect)frame {
52
52
if ((self = [super initWithFrame: frame])) {
53
- [self setDefaults ];
53
+ [self setDefaultsWithForcedAlignment: NO ];
54
54
}
55
55
return self;
56
56
}
57
57
58
58
- (id )init {
59
59
if ((self = [super init ])) {
60
- [self setDefaults ];
60
+ [self setDefaultsWithForcedAlignment: YES ];
61
61
}
62
62
return self;
63
63
}
64
64
65
- - (void ) setDefaults {
65
+ - (void ) setDefaultsWithForcedAlignment : ( BOOL ) forceAlignment {
66
66
self.locale = [NSLocale currentLocale ];
67
67
self.currencyCode = [self .locale objectForKey: NSLocaleCurrencyCode ];
68
68
self.keyboardType = UIKeyboardTypeDecimalPad;
69
69
self.type = MPNumericTextFieldDecimal;
70
70
self.delegate = self.numericDelegate ;
71
- self.textAlignment = NSTextAlignmentRight;
71
+ if (forceAlignment)
72
+ self.textAlignment = NSTextAlignmentRight;
72
73
}
73
74
74
75
- (void ) setCurrencyCode : (NSString *)currencyCode {
You can’t perform that action at this time.
0 commit comments