diff --git a/Examples/Inputs/InputsFormViewController.m b/Examples/Inputs/InputsFormViewController.m index 9190062..c6d4bfd 100644 --- a/Examples/Inputs/InputsFormViewController.m +++ b/Examples/Inputs/InputsFormViewController.m @@ -32,6 +32,7 @@ NSString *const kEmail = @"email"; NSString *const kTwitter = @"twitter"; NSString *const kNumber = @"number"; NSString *const kInteger = @"integer"; +NSString *const kDecimal = @"decimal"; NSString *const kPassword = @"password"; NSString *const kPhone = @"phone"; NSString *const kUrl = @"url"; @@ -78,6 +79,10 @@ NSString *const kNotes = @"notes"; // Integer row = [XLFormRowDescriptor formRowDescriptorWithTag:kInteger rowType:XLFormRowDescriptorTypeInteger title:@"Integer"]; [section addFormRow:row]; + + // Decimal + row = [XLFormRowDescriptor formRowDescriptorWithTag:kDecimal rowType:XLFormRowDescriptorTypeDecimal title:@"Decimal"]; + [section addFormRow:row]; // Password row = [XLFormRowDescriptor formRowDescriptorWithTag:kPassword rowType:XLFormRowDescriptorTypePassword title:@"Password"]; diff --git a/README.md b/README.md index 07a6591..ab0bf2c 100755 --- a/README.md +++ b/README.md @@ -158,6 +158,11 @@ static NSString *const XLFormRowDescriptorTypeInteger = @"integer"; ``` Will be represented by a `UITextField` with `UIKeyboardTypeNumberPad`. +```objc +static NSString *const XLFormRowDescriptorTypeDecimal = @"decimal"; +``` +Will be represented by a `UITextField` with `UIKeyboardTypeDecimalPad`. + ```objc static NSString *const XLFormRowDescriptorTypeTextView = @"textView"; ``` diff --git a/XLForm/XL/Cell/XLFormTextFieldCell.m b/XLForm/XL/Cell/XLFormTextFieldCell.m index 565f0c0..09ca882 100644 --- a/XLForm/XL/Cell/XLFormTextFieldCell.m +++ b/XLForm/XL/Cell/XLFormTextFieldCell.m @@ -100,6 +100,9 @@ else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeInteger]){ self.textField.keyboardType = UIKeyboardTypeNumberPad; } + else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDecimal]){ + self.textField.keyboardType = UIKeyboardTypeDecimalPad; + } else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypePassword]){ self.textField.autocorrectionType = UITextAutocorrectionTypeNo; self.textField.autocapitalizationType = UITextAutocapitalizationTypeNone; diff --git a/XLForm/XL/Controllers/XLFormViewController.m b/XLForm/XL/Controllers/XLFormViewController.m index 9e313ab..6625c0b 100755 --- a/XLForm/XL/Controllers/XLFormViewController.m +++ b/XLForm/XL/Controllers/XLFormViewController.m @@ -154,6 +154,7 @@ XLFormRowDescriptorTypePassword: [XLFormTextFieldCell class], XLFormRowDescriptorTypeNumber: [XLFormTextFieldCell class], XLFormRowDescriptorTypeInteger: [XLFormTextFieldCell class], + XLFormRowDescriptorTypeDecimal: [XLFormTextFieldCell class], XLFormRowDescriptorTypeSelectorPush: [XLFormSelectorCell class], XLFormRowDescriptorTypeSelectorPopover: [XLFormSelectorCell class], XLFormRowDescriptorTypeSelectorActionSheet: [XLFormSelectorCell class], diff --git a/XLForm/XL/XLForm.h b/XLForm/XL/XLForm.h index c7d60f4..05a5a64 100755 --- a/XLForm/XL/XLForm.h +++ b/XLForm/XL/XLForm.h @@ -76,6 +76,7 @@ static NSString *const XLFormRowDescriptorTypePhone = @"phone"; static NSString *const XLFormRowDescriptorTypeTwitter = @"twitter"; static NSString *const XLFormRowDescriptorTypeAccount = @"account"; static NSString *const XLFormRowDescriptorTypeInteger = @"integer"; +static NSString *const XLFormRowDescriptorTypeDecimal = @"decimal"; static NSString *const XLFormRowDescriptorTypeTextView = @"textView"; static NSString *const XLFormRowDescriptorTypeSelectorPush = @"selectorPush"; static NSString *const XLFormRowDescriptorTypeSelectorPopover = @"selectorPopover";