Skip to content
Browse files

refactoring in Filters

  • Loading branch information...
1 parent 79466c2 commit df0ffe9bbfe2d61ac6307218a276e3546bbf910d @Malaar committed
View
6 MUKit/MUControls/MUInputFields/MUTextField.h
@@ -8,8 +8,8 @@
#import <Foundation/Foundation.h>
#import "MUValidator.h"
+#import "MUFilter.h"
#import "MUKeyboardAvoiderProtocol.h"
-#import "MUInputTextFilter.h"
@class MUTextField_Holder;
@@ -17,10 +17,10 @@
{
MUValidator* validator;
MUTextField_Holder* delegateHolder;
- MUInputFilter *inputTextFilter;
+ MUFilter *inputTextFilter;
}
@property (nonatomic, assign) id<UITextFieldDelegate> mudelegate;
-@property (nonatomic, retain) MUInputFilter *inputTextFilter;
+@property (nonatomic, retain) MUFilter *filter;
@end
View
6 MUKit/MUControls/MUInputFields/MUTextField.m
@@ -35,7 +35,7 @@ @implementation MUTextField
@synthesize validatableText;
@synthesize mudelegate;
@synthesize keyboardAvoiding;
-@synthesize inputTextFilter;
+@synthesize filter;
#pragma mark - Init/Dealloc
//==========================================================================================
@@ -189,8 +189,8 @@ - (void)textFieldDidEndEditing:(UITextField *)textField
- (BOOL)textField:(MUTextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
BOOL result = YES;
- if (textField.inputTextFilter)
- result = [textField.inputTextFilter filterText:textField shouldChangeCharactersInRange:range replacementString:string];
+ if (textField.filter)
+ result = [textField.filter filterText:textField shouldChangeCharactersInRange:range replacementString:string];
if([holded.mudelegate respondsToSelector:@selector(textField:shouldChangeCharactersInRange:replacementString:)])
result = [holded.mudelegate textField:textField shouldChangeCharactersInRange:range replacementString:string];
View
6 MUKit/MUControls/MUInputFields/MUTextView.h
@@ -9,7 +9,7 @@
#import <Foundation/Foundation.h>
#import "MUValidator.h"
#import "MUKeyboardAvoiderProtocol.h"
-#import "MUInputTextFilter.h"
+#import "MUFilter.h"
@class MUTextView_Holder;
@@ -17,11 +17,11 @@
{
MUValidator* validator;
MUTextView_Holder* delegateHolder;
- MUInputFilter *inputTextFilter;
+ MUFilter *filter;
}
@property (nonatomic, assign) id<UITextViewDelegate> mudelegate;
@property (nonatomic, copy) NSString* observedText;
-@property (nonatomic, retain) MUInputFilter *inputTextFilter;
+@property (nonatomic, retain) MUFilter *filter;
@end
View
8 MUKit/MUControls/MUInputFields/MUTextView.m
@@ -34,7 +34,7 @@ @implementation MUTextView
@synthesize mudelegate;
@synthesize keyboardAvoiding;
@synthesize observedText;
-@synthesize inputTextFilter;
+@synthesize filter;
//==========================================================================================
- (id) init
@@ -71,7 +71,7 @@ - (void) dealloc
{
[delegateHolder release];
[validator release];
- [inputTextFilter release];
+ [filter release];
[super dealloc];
}
@@ -191,9 +191,9 @@ - (BOOL)textView:(MUTextView *)textView shouldChangeTextInRange:(NSRange)range r
{
BOOL result = YES;
- if (textView.inputTextFilter)
+ if (textView.filter)
{
- result = [textView.inputTextFilter filterText:textView shouldChangeCharactersInRange:range replacementString:text];
+ result = [textView.filter filterText:textView shouldChangeCharactersInRange:range replacementString:text];
}
if([holded.mudelegate respondsToSelector:@selector(textView:shouldChangeTextInRange:replacementText:)])
View
40 MUKit/MUCore/MUFilter.h
@@ -0,0 +1,40 @@
+//
+// MUInputTextFilter.h
+// MUKitTest
+//
+// Created by Yuriy Bosov on 4/18/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+//==============================================================================
+/// text filter : base class
+@interface MUFilter : NSObject
+{
+ NSUInteger maxLengthText;
+}
+
+@property (nonatomic, assign) NSUInteger maxLengthText;
+
+- (id)initWithMaxLengthText:(NSUInteger) aMaxLengthText;
+- (BOOL) filterText:(id)inputTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string;
+
+@end
+
+//==============================================================================
+/// text with only number
+@interface MUFilterNumbers : MUFilter
+
+@end
+
+//==============================================================================
+/// text with only letters
+@interface MUFilterLetters : MUFilter
+
+@end
+
+//==============================================================================
+@interface MUFilterLettersAndDigits : MUFilter
+
+@end
View
113 MUKit/MUCore/MUFilter.m
@@ -0,0 +1,113 @@
+//
+// MUInputTextFilter.m
+// MUKitTest
+//
+// Created by Yuriy Bosov on 4/18/12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import "MUFilter.h"
+
+//==============================================================================
+//==============================================================================
+//==============================================================================
+/// text filter : base class
+@implementation MUFilter
+
+@synthesize maxLengthText;
+
+//==============================================================================
+- (id) init
+{
+ if( (self = [super init]) )
+ {
+ maxLengthText = NSNotFound;
+ }
+ return self;
+}
+
+//==============================================================================
+- (id)initWithMaxLengthText:(NSUInteger) aMaxLengthText
+{
+ if( (self = [super init]) )
+ {
+ maxLengthText = aMaxLengthText;
+ }
+ return self;
+}
+
+//==============================================================================
+- (BOOL) filterText:(id)inputTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
+{
+// result &= [[inputTextField text] length] < maxLengthText;
+ return YES;
+}
+
+@end
+
+//==============================================================================
+//==============================================================================
+//==============================================================================
+/// text with only number
+@implementation MUFilterNumbers
+
+//==============================================================================
+- (BOOL) filterText:(id)inputTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
+{
+ BOOL result = YES;
+
+ if ([string length] > 0)
+ {
+ result = [string rangeOfCharacterFromSet:[NSCharacterSet decimalDigitCharacterSet]].location != NSNotFound;
+ result &= [[inputTextField text] length] < maxLengthText;
+ }
+
+ return result;
+}
+
+@end
+
+//==============================================================================
+//==============================================================================
+//==============================================================================
+/// text with only letters
+@implementation MUFilterLetters
+
+//==============================================================================
+- (BOOL) filterText:(id)inputTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
+{
+ BOOL result = YES;
+
+ if ([string length] > 0)
+ {
+ result = [string rangeOfCharacterFromSet:[NSCharacterSet letterCharacterSet]].location != NSNotFound;
+ result &= [[inputTextField text] length] < maxLengthText;
+ }
+
+ return result;
+}
+
+
+@end
+
+//==============================================================================
+//==============================================================================
+//==============================================================================
+@implementation MUFilterLettersAndDigits
+
+- (BOOL) filterText:(id)inputTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
+{
+ BOOL result = YES;
+
+ if([string length] > 0)
+ {
+ NSRegularExpression* regExp = [[NSRegularExpression alloc]initWithPattern:@"^[0-9a-zA-Z]+$" options:NSRegularExpressionCaseInsensitive error:nil];
+ NSUInteger count = [regExp numberOfMatchesInString:[inputTextField text] options:0 range:NSMakeRange(0, [inputTextField text].length)];
+ result = count == 1;
+ [regExp release];
+ }
+
+ return result;
+}
+
+@end
View
72 MUKit/MUCore/MUInputTextFilter.h
@@ -1,72 +0,0 @@
-//
-// MUInputTextFilter.h
-// MUKitTest
-//
-// Created by Yuriy Bosov on 4/18/12.
-// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-//==============================================================================
-//==============================================================================
-//==============================================================================
-/// text filter : base class
-@interface MUInputFilter : NSObject
-
-- (BOOL) filterText:(id)inputTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string;
-
-@end
-
-//==============================================================================
-//==============================================================================
-//==============================================================================
-/// text with only number
-@interface MUInputFilterNumbreValue : MUInputFilter
-
-@end
-
-//==============================================================================
-//==============================================================================
-//==============================================================================
-/// text with only numbers, numbers value has max
-@interface MUInputFilterNumbreValueWithMaxLengthText : MUInputFilterNumbreValue
-
-@property (nonatomic, assign) NSUInteger maxLengthText;
-
-- (id)initWithMaxLengthText:(NSUInteger) aMaxLengthText;
-
-@end
-
-//==============================================================================
-//==============================================================================
-//==============================================================================
-/// text with only letters
-@interface MUInputFilterLetterValue : MUInputFilter
-
-@end
-
-//==============================================================================
-//==============================================================================
-//==============================================================================
-/// text with only letters, text has limited the length
-@interface MUInputFilterLetterValueWithMaxLengthText : MUInputFilterLetterValue
-
-@property (nonatomic, assign) NSUInteger maxLengthText;
-
-- (id)initWithMaxLengthText:(NSUInteger) aMaxLengthText;
-
-@end
-
-//==============================================================================
-//==============================================================================
-//==============================================================================
-/// text has limited the length
-@interface MUInputFilterStringWithMaxLengthText : MUInputFilter
-
-@property (nonatomic, assign) NSUInteger maxLengthText;
-
-- (id)initWithMaxLengthText:(NSUInteger) aMaxLengthText;
-
-@end
-
View
226 MUKit/MUCore/MUInputTextFilter.m
@@ -1,226 +0,0 @@
-//
-// MUInputTextFilter.m
-// MUKitTest
-//
-// Created by Yuriy Bosov on 4/18/12.
-// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-#import "MUInputTextFilter.h"
-
-//==============================================================================
-//==============================================================================
-//==============================================================================
-/// text filter : base class
-@implementation MUInputFilter
-
-- (BOOL) filterText:(id)inputTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
-{
- return YES;
-}
-
-@end
-
-//==============================================================================
-//==============================================================================
-//==============================================================================
-/// text with only number
-@implementation MUInputFilterNumbreValue
-
-//==============================================================================
-- (BOOL) filterText:(id)inputTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
-{
- BOOL result = NO;
-
- if ([string length] > 0)
- {
- if ([string rangeOfCharacterFromSet:[NSCharacterSet decimalDigitCharacterSet]].location != NSNotFound)
- {
- result = YES;
- }
- else
- {
- result = NO;
- }
- }
- else
- {
- result = YES;
- }
-
- return result;
-}
-
-@end
-
-//==============================================================================
-//==============================================================================
-//==============================================================================
-/// text with only numbers, numbers value has max and min
-@implementation MUInputFilterNumbreValueWithMaxLengthText
-
-//==============================================================================
-@synthesize maxLengthText;
-
-//==============================================================================
-- (id) initWithMaxLengthText:(NSUInteger)aMaxLengthText
-{
- self = [super init];
- if (self)
- {
- self.maxLengthText = aMaxLengthText;
- }
- return self;
-}
-
-//==============================================================================
-- (BOOL) filterText:(id)inputTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
-{
- BOOL result = NO;
-
- if ([string length] > 0)
- {
- if ([string rangeOfCharacterFromSet:[NSCharacterSet decimalDigitCharacterSet]].location != NSNotFound && [[inputTextField text] length] < maxLengthText)
- {
- result = YES;
- }
- else
- {
- result = NO;
- }
- }
- else
- {
- result = YES;
- }
-
- return result;
-}
-
-@end
-
-//==============================================================================
-//==============================================================================
-//==============================================================================
-/// text with only letters
-@implementation MUInputFilterLetterValue
-
-//==============================================================================
-- (BOOL) filterText:(id)inputTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
-{
- BOOL result = NO;
-
- if ([string length] > 0)
- {
- if ([string rangeOfCharacterFromSet:[NSCharacterSet letterCharacterSet]].location != NSNotFound)
- {
- result = YES;
- }
- else
- {
- result = NO;
- }
- }
- else
- {
- result = YES;
- }
-
- return result;
-}
-
-
-@end
-
-//==============================================================================
-//==============================================================================
-//==============================================================================
-/// text with only letters, text has limited the length
-@implementation MUInputFilterLetterValueWithMaxLengthText
-
-//==============================================================================
-@synthesize maxLengthText;
-
-//==============================================================================
-- (id) initWithMaxLengthText:(NSUInteger)aMaxLengthText
-{
- self = [super init];
- if (self)
- {
- self.maxLengthText = aMaxLengthText;
- }
- return self;
-}
-
-//==============================================================================
-- (BOOL) filterText:(id)inputTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
-{
- BOOL result = NO;
-
- if ([string length] > 0)
- {
- if ([string rangeOfCharacterFromSet:[NSCharacterSet letterCharacterSet]].location != NSNotFound && [[inputTextField text] length] < maxLengthText)
- {
- result = YES;
- }
- else
- {
- result = NO;
- }
- }
- else
- {
- result = YES;
- }
-
- return result;
-}
-
-@end
-
-//==============================================================================
-//==============================================================================
-//==============================================================================
-/// text has limited the length
-@implementation MUInputFilterStringWithMaxLengthText
-
-//==============================================================================
-@synthesize maxLengthText;
-
-//==============================================================================
-- (id) initWithMaxLengthText:(NSUInteger)aMaxLengthText
-{
- self = [super init];
- if (self)
- {
- self.maxLengthText = aMaxLengthText;
- }
- return self;
-}
-
-//==============================================================================
-- (BOOL) filterText:(id)inputTextField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
-{
- BOOL result = NO;
-
- if ([string length] > 0)
- {
- if ([[inputTextField text] length] < maxLengthText)
- {
- result = YES;
- }
- else
- {
- result = NO;
- }
- }
- else
- {
- result = YES;
- }
-
- return result;
-}
-
-@end
-
View
4 MUKit/MUTableDisposer/CellDatas/CellDataSimple/MUCellDataTextField.h
@@ -8,7 +8,7 @@
#import "MUCellDataTextPair.h"
#import "MUValidator.h"
-#import "MUInputTextFilter.h"
+#import "MUFilter.h"
@interface MUCellDataTextField : MUCellDataTextPair
@@ -25,6 +25,6 @@
@property (nonatomic, assign) UIReturnKeyType returnKeyType; ///< default is UIReturnKeyDefault
@property (nonatomic, retain) MUValidator *validator;
-@property (nonatomic, retain) MUInputFilter *inputFilter;
+@property (nonatomic, retain) MUFilter *filter;
@end
View
4 MUKit/MUTableDisposer/CellDatas/CellDataSimple/MUCellDataTextField.m
@@ -22,7 +22,7 @@ @implementation MUCellDataTextField
@synthesize returnKeyType;
@synthesize validator;
-@synthesize inputFilter;
+@synthesize filter;
#pragma mark - Init/Dealloc
//==============================================================================
@@ -49,7 +49,7 @@ - (void) dealloc
[placeholder release];
[placeholderColor release];
[validator release];
- [inputFilter release];
+ [filter release];
[super dealloc];
}
View
4 MUKit/MUTableDisposer/CellDatas/CellDataSimple/MUCellDataTextView.h
@@ -8,7 +8,7 @@
#import "MUCellDataTextPair.h"
#import "MUValidator.h"
-#import "MUInputTextFilter.h"
+#import "MUFilter.h"
@interface MUCellDataTextView : MUCellDataTextPair
@@ -22,6 +22,6 @@
@property (nonatomic, assign) UIReturnKeyType returnKeyType; ///< default is UIReturnKeyDefault
@property (nonatomic, retain) MUValidator *validator;
-@property (nonatomic, retain) MUInputFilter *inputFilter;
+@property (nonatomic, retain) MUFilter *filter;
@end
View
4 MUKit/MUTableDisposer/CellDatas/CellDataSimple/MUCellDataTextView.m
@@ -20,7 +20,7 @@ @implementation MUCellDataTextView
@synthesize returnKeyType;
@synthesize validator;
-@synthesize inputFilter;
+@synthesize filter;
#pragma mark - Init/Dealloc
//==============================================================================
@@ -46,7 +46,7 @@ - (id) initWithObject:(NSObject *)aObject key:(NSString *)aKey
- (void) dealloc
{
[validator release];
- [inputFilter release];
+ [filter release];
[super dealloc];
}
View
2 MUKit/MUTableDisposer/Cells/CellSimple/MUCellTextField.m
@@ -68,7 +68,7 @@ - (void) setupCellData:(MUCellData *)aCellData
textField.enabled = cellDataTextField.enableEdit;
textField.validator = cellDataTextField.validator;
- textField.inputTextFilter = cellDataTextField.inputFilter;
+ textField.filter = cellDataTextField.filter;
if ([cellDataTextField.title length])
{
View
2 MUKit/MUTableDisposer/Cells/CellSimple/MUCellTextView.m
@@ -82,7 +82,7 @@ - (void) setupCellData:(MUCellData *)aCellData
textView.editable = self.cellData.enableEdit;
textView.validator = cellDataTextView.validator;
- textView.inputTextFilter = cellDataTextView.inputFilter;
+ textView.filter = cellDataTextView.filter;
// title
titleLabel.frame = CGRectMake(10, 0, self.bounds.size.width - 20, titleHeight);
View
12 MUKitTest.xcodeproj/project.pbxproj
@@ -77,7 +77,7 @@
E64AA46B152306F70087B49E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E64AA46A152306F70087B49E /* main.m */; };
E64AA46F152306F70087B49E /* MUAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E64AA46E152306F70087B49E /* MUAppDelegate.m */; };
E64D69C6153E76F900FF5C58 /* MUBaseTableController.m in Sources */ = {isa = PBXBuildFile; fileRef = E64D69C5153E76F800FF5C58 /* MUBaseTableController.m */; };
- E64D69C9153E82B200FF5C58 /* MUInputTextFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = E64D69C8153E82B200FF5C58 /* MUInputTextFilter.m */; };
+ E64D69C9153E82B200FF5C58 /* MUFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = E64D69C8153E82B200FF5C58 /* MUFilter.m */; };
E6562936152308CF00CEC66C /* MURootControllerIPad.m in Sources */ = {isa = PBXBuildFile; fileRef = E6562929152308CF00CEC66C /* MURootControllerIPad.m */; };
E6562937152308CF00CEC66C /* MURootControllerIPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = E656292A152308CF00CEC66C /* MURootControllerIPad.xib */; };
E6562938152308CF00CEC66C /* MURootControllerIPhone.m in Sources */ = {isa = PBXBuildFile; fileRef = E656292E152308CF00CEC66C /* MURootControllerIPhone.m */; };
@@ -260,8 +260,8 @@
E64AA46E152306F70087B49E /* MUAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MUAppDelegate.m; sourceTree = "<group>"; };
E64D69C4153E76F800FF5C58 /* MUBaseTableController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MUBaseTableController.h; sourceTree = "<group>"; };
E64D69C5153E76F800FF5C58 /* MUBaseTableController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MUBaseTableController.m; sourceTree = "<group>"; };
- E64D69C7153E82B200FF5C58 /* MUInputTextFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MUInputTextFilter.h; sourceTree = "<group>"; };
- E64D69C8153E82B200FF5C58 /* MUInputTextFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MUInputTextFilter.m; sourceTree = "<group>"; };
+ E64D69C7153E82B200FF5C58 /* MUFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; path = MUFilter.h; sourceTree = "<group>"; };
+ E64D69C8153E82B200FF5C58 /* MUFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MUFilter.m; sourceTree = "<group>"; };
E6562928152308CF00CEC66C /* MURootControllerIPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MURootControllerIPad.h; sourceTree = "<group>"; };
E6562929152308CF00CEC66C /* MURootControllerIPad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MURootControllerIPad.m; sourceTree = "<group>"; };
E656292A152308CF00CEC66C /* MURootControllerIPad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MURootControllerIPad.xib; sourceTree = "<group>"; };
@@ -770,8 +770,8 @@
E65629AF152308DC00CEC66C /* MUValidator.m */,
E65629B0152308DC00CEC66C /* MUWeakRef.h */,
E65629B1152308DC00CEC66C /* MUWeakRef.m */,
- E64D69C7153E82B200FF5C58 /* MUInputTextFilter.h */,
- E64D69C8153E82B200FF5C58 /* MUInputTextFilter.m */,
+ E64D69C7153E82B200FF5C58 /* MUFilter.h */,
+ E64D69C8153E82B200FF5C58 /* MUFilter.m */,
);
path = MUCore;
sourceTree = "<group>";
@@ -1056,7 +1056,7 @@
02AF8F6315305506005B8AED /* MUTabBarController.m in Sources */,
E6337FDC153C6BE500EFBD6F /* MUKeyboardToolbar.m in Sources */,
E64D69C6153E76F900FF5C58 /* MUBaseTableController.m in Sources */,
- E64D69C9153E82B200FF5C58 /* MUInputTextFilter.m in Sources */,
+ E64D69C9153E82B200FF5C58 /* MUFilter.m in Sources */,
02EFC340155C1D7C00E2639C /* MUKeyboardAvoidingScrollController.m in Sources */,
02EFC342155C1D7C00E2639C /* MUKeyboardAvoidingTableController.m in Sources */,
02EFC344155C1D7C00E2639C /* TableViewWithMapedCells.m in Sources */,
View
10 MUKitTest/iCommon/KeyboardAvoidingTable/MUKeyboardAvoidingTableController.m
@@ -177,19 +177,19 @@ - (void)viewDidLoad
validator.errorMessage = @"Incorrect Code";
tf_05.placeholder = @"Enter Code (10~15 symbol)";
tf_05.validator = validator;
- tf_05.inputTextFilter = [[[MUInputFilterNumbreValueWithMaxLengthText alloc] initWithMaxLengthText:15] autorelease];
+ tf_05.filter = [[[MUFilterNumbers alloc] initWithMaxLengthText:15] autorelease];
validator = [[[MUValidatorLetters alloc] init] autorelease];
validator.errorMessage = @"Letters!!!";
tf_06.placeholder = @"Enter Letters";
tf_06.validator = validator;
- tf_06.inputTextFilter = [[MUInputFilterLetterValue new] autorelease];
+ tf_06.filter = [[MUFilterLetters new] autorelease];
validator = [[[MUValidatorNumber alloc] init] autorelease];
validator.errorMessage = @"Number!!!";
tf_07.placeholder = @"Enter Number";
tf_07.validator = validator;
- tf_07.inputTextFilter = [[MUInputFilterNumbreValue new] autorelease];
+ tf_07.filter = [[MUFilterNumbers new] autorelease];
validator = [[[MUValidatorURL alloc] init] autorelease];
validator.errorMessage = @"Incorrect URL";
@@ -200,13 +200,13 @@ - (void)viewDidLoad
validator.errorMessage = @"Incorrect Zip Code";
tf_09.placeholder = @"Enter US Zip Code";
tf_09.validator = validator;
- tf_09.inputTextFilter = [[[MUInputFilterNumbreValueWithMaxLengthText alloc] initWithMaxLengthText:5] autorelease];
+ tf_09.filter = [[[MUFilterNumbers alloc] initWithMaxLengthText:5] autorelease];
validator = [[[MUValidatorStringWithRange alloc] initWithRange:NSMakeRange(5,5)] autorelease];
validator.errorMessage = @"Word len 5~10";
tf_10.placeholder = @"Enter Word";
tf_10.validator = validator;
- tf_10.inputTextFilter = [[[MUInputFilterStringWithMaxLengthText alloc] initWithMaxLengthText:10] autorelease];
+ tf_10.filter = [[[MUFilter alloc] initWithMaxLengthText:10] autorelease];
validator = [[[MUValidatorIntWithRange alloc] initWithRange:NSMakeRange(16, 4)] autorelease];
validator.errorMessage = @"Incorrect Card Number!!!";

0 comments on commit df0ffe9

Please sign in to comment.
Something went wrong with that request. Please try again.