MHValidation 1.1

MHValidation 1.1

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布上次发布2014年12月

未声明 维护。



  • 作者
  • Mario Hahn

ios-MHValidation

alt tag

设置

安装MVValidation

[self.scrollView installMHValidationWithClasses:@[[UITextField class],
                                                  [UISwitch class],
                                                  [UISegmentedControl class],
                                                  [UITextView class]
                                                    ]
                       setCustomizationBlock:^(MHTextObjectsCustomization *customization) {

                       }];

设置AccessibilityIdentifiers

self.firstName.accessibilityIdentifier = @"Vorname";
self.secondName.accessibilityIdentifier = @"Nachname";
self.email.accessibilityIdentifier = @"E-Mail";
self.PLZ.accessibilityIdentifier = @"Postleitzahl";
self.sex.accessibilityIdentifier = @"Geschlecht";
self.allow.accessibilityIdentifier = @"Erlauben";
self.problems.accessibilityIdentifier = @"Probleme";
self.phoneNumber.accessibilityIdentifier = @"Telefonnummer";    

验证

    //Regex Validation
  MHValidationItem *emailValidation = [[MHValidationItem alloc]initWithObject:self.email
                                                                regexString:MHValidationRegexEmail];


 [self.scrollView validateWithNONMandatoryTextObjects:@[self.secondName]
                   validateObjectsWithMHRegexObjects:@[emailValidation]
                               switchesWhichMustBeON:nil
                                  curruptObjectBlock:^(NSArray *curruptItem) {

                                  } successBlock:^(NSString *emailString, NSDictionary *valueKeyDict, NSArray *object, bool isFirstRegistration) {


                                  }];