Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c7d5708f16 | |||
| dd294cc709 | |||
| cda0327def | |||
| 9a2bdf1ca0 | |||
| d8b67b5c21 | |||
| f30fa9bb31 | |||
| 9b1e7d6d4e | |||
| fac9cefc2b | |||
| d202a40824 | |||
| d185e642e0 | |||
| 743c5d289a | |||
| de86c5e60e | |||
| f52c532fec | |||
| 274892dc95 | |||
| 09b28286de | |||
| bbca57a2e6 | |||
| d29275b780 | |||
| 11f54cee17 | |||
| 418b3e4c96 | |||
| 6da2fc456c | |||
| 52be3f3531 | |||
| 5e00deb474 | |||
| 2a8ebf2af5 | |||
| 5c716a665d | |||
| 60e67b9651 | |||
| 6aac513398 | |||
| 0491752090 | |||
| c32e28f753 | |||
| 2b55aeac74 | |||
| 94959f9da8 | |||
| 25798bb123 | |||
| d6d14140cf | |||
| c036d7a06b | |||
| 51760a535a | |||
| 542191ba69 | |||
| c1b64f7828 | |||
| 8009dd8cb7 | |||
| 8d65cbe361 | |||
| 79eb596143 | |||
| 0e866a0f22 | |||
| d68166c669 | |||
| 72115e32ea | |||
| 5475ed7ed7 | |||
| 8bdeb264c1 | |||
| 437c1e4d38 | |||
| 972815d7ea | |||
| eeb165b1cc | |||
| 47dfa518c4 | |||
| bb9aceff75 | |||
| 0d24f47f75 | |||
| 7ae1a5d612 | |||
| 0db6e546c5 | |||
| 1229cb8d6a | |||
| 756fdb914b | |||
| 3df413b0fa | |||
| 97b79f1f93 | |||
| ba949c3697 | |||
| e31c6db521 | |||
| 15a4ce9d83 | |||
| 5b136eb458 |
+132
@@ -0,0 +1,132 @@
|
||||
# Change Log
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
### Latest:
|
||||
* Added XL_APP_EXTENSIONS macro to allow app extensions (@MuscleRumble #357)
|
||||
* Added shouldChangeTextInRange delegate call for UITextView. (@kiancheong #782)
|
||||
* Added support for NSFormatter (@ziogaschr, @fwhenin, @bhirt-bpl #306)
|
||||
* Added `height` property to XLFormRowDescriptor to allow setting height of individual cells.
|
||||
|
||||
### Version 3.1.2:
|
||||
* Update row in `cellForRowAtIndexPath` instead of `willDisplayCell`
|
||||
* Added cancel action to image selector (by koenpunt)
|
||||
* Other minor fixes
|
||||
|
||||
### Version 3.1.1
|
||||
* Allow setting width percentage on UITextView
|
||||
* Added custom inline row example
|
||||
* Fixed bug where XLFormImageCell was not added to project
|
||||
* Add ability to `end editing` on scroll
|
||||
* Other bugs and refactor
|
||||
|
||||
### Version 3.1.0
|
||||
* Added Carthage support
|
||||
* Added NSCoding protocol
|
||||
* Allowed HTTP connections
|
||||
* Several bugfixes and improvements.
|
||||
|
||||
### Version 3.0.2
|
||||
* Fix issue when inline pickers expand beyond table.
|
||||
|
||||
### Version 3.0.1
|
||||
|
||||
* Improvements and bug fixes.
|
||||
* Ability to left, right align textfields. Ability to set up a minimum textField width.
|
||||
* If form is being shown, assigning a new form automatically reload the tableview.
|
||||
* Update objective-c and swift example projects.
|
||||
* Swift compatibility fixes.
|
||||
* Long email validation added.
|
||||
* Fixed row copy issue, now valueTransformer value is copied.
|
||||
* Fixed step counter row layout issues.
|
||||
* Fixed issue "Last form field hides beneath enabled navigation controller's toolbar".
|
||||
* Fixed issue "Navigating between cells using bottom navigation buttons causes table cell dividers to disappear".
|
||||
* Use UIAlertController instead UIActionSheet/UIAlertView if possible.
|
||||
* Hidden and disabled rows resign first responder before changing state.
|
||||
* onChangeBlock added to rowDescriptor.
|
||||
* use tintColor as default button row color.
|
||||
* By default accessoryView is no longer shown for inline rows.
|
||||
* Fix NSBundle issues to use XLForm as dynamic framework.
|
||||
|
||||
### Version 3.0.0
|
||||
|
||||
* `hidden`, `disable` properties added to `XLFormRowDescriptor`. `@YES` `@NO` or a `NSPredicate` can be used to hide, disable de row.
|
||||
* `hidden` property added to `XLFormSectionDescriptor`. `@YES` `@NO` or a `NSPredicate` can be used to hide the section.
|
||||
* Added `XLFormRowDescriptorTypeCountDownTimerInline` and `XLFormRowDescriptorTypeCountDownTimer` row type with an example.
|
||||
* Deleted `dateFormatter` property and added support to use the `NSValueTransformer` to convert the selected object to a NSString in the XLFormDateCell class.
|
||||
|
||||
* Added `XLFormRowDescriptorTypeCountDownTimerInline` and `XLFormRowDescriptorTypeCountDownTimer` row type with an example.
|
||||
* Deleted `dateFormatter` property and added support to use the `NSValueTransformer` to convert the selected object to a NSString in the XLFormDateCell class.
|
||||
|
||||
|
||||
### Version 2.2.0
|
||||
|
||||
* Fixed "(null)" caption when `XLFormRowDescriptorTypeSelectorLeftRight` row required error message is shown.
|
||||
* Refresh the cell content instead of recreating one, when the form get back from a selection.
|
||||
* Added XLFormRowDescriptor to validations error to easily show an error mask.
|
||||
* Use row tag in validation error message if row does not have a title. It is also possible to set up a custom message if needed
|
||||
* Added a convenience method to add a XLFormRowDescriptor instance before another one.
|
||||
* Allow nil values in cellConfig and cellConfigAtConfigure.
|
||||
* Fix constraints for textFieldCell when it is configured to be right aligned.
|
||||
* Add asterisk to required segmentedCells if needed.
|
||||
* Fail validation for empty strings and NSNull on required rows.
|
||||
* Segue support added to buttons and selectors.
|
||||
* Ability to configure a storyboardId or a viewController nibName to by used by button and selector rows as presented view controller.
|
||||
* Fix scrolling to top when status bar is tapped.
|
||||
* Fix wrong type of XLFormRowDescriptorTypeDecimal row. Now it's converted to NSNumber.
|
||||
* Fix issue: XLFormRegexValidator only checks regex validation for NSStrings, not working for number.
|
||||
* Callconfigure method from awakeFromNib on XLFormBaseCell.
|
||||
* Assign form.delegate from inside setForm: method.
|
||||
* Added custom cell, validation, reordering, can insert, can delete examples.
|
||||
* Added support for inputAccessoryView. Default input accessory view allows to navigate among rows. Fully optionally and customizable.
|
||||
* Added suport for row navigation. Fully optionally and customizable.
|
||||
* beginEditing: endEditing: methods added. These method are called each time a row gains / loses firstResponder. They bring the ability to do UI changes.
|
||||
* Read Only mode added. `disable` property added to XLFormDescriptor class.
|
||||
* Rename `label` XLFormTextViewCell property as `textLabel`.
|
||||
* fix position of multivalued section accessory view.
|
||||
* Can delete, can delete, can reorder section mode added. it's possible to enable some of them, don't need to enable all modes.
|
||||
|
||||
### Version 2.1.0
|
||||
|
||||
* Change `XLFormRowDescriptorTypeText`, `XLFormRowDescriptorTypeName` and `XLFormRowDescriptorTypeTextView` keyboard type to `UIKeyboardTypeDefault`.
|
||||
* Added `XLFormRowDescriptorTypeInfo` row type and example.
|
||||
* Added `XLFormRowDescriptorTypeSelectorPopover` row type and example.
|
||||
* CI added. Created Test project into Tests folder and set up Travis.
|
||||
* Documented how to customize UI. Added an example.
|
||||
* Now XLFormViewController extends from UIViewController instead of UITableViewController.
|
||||
* Added tableView property as a XLFormViewController IBOutlet.
|
||||
* Added support for storyboard reuse identifier and nib file.
|
||||
* Button selection can be handled using a selector or block.
|
||||
* Added addAsteriskToRequiredRowsTitle property to XLFormDescriptor. NO is used as value by default.
|
||||
* Image cell has been removed because it depends on AFNetworking and now needs to be implemented as a custom cell. You can find the image custom cell in Examples/Others/CustomCells.
|
||||
|
||||
### Version 2.0.0
|
||||
|
||||
* Added `XLFormRowDescriptorTypeMultipleSelector` row type and example.
|
||||
* Added `XLFormRowDescriptorTypeSelectorPickerView` row type and example.
|
||||
* Added `XLFormRowDescriptorTypeSelectorPickerViewInline` row type and example.
|
||||
* Added generic way to create inline selector rows.
|
||||
* Ability to customize row animations.
|
||||
* `(NSDictionary *)formValues;` XLFormViewController method added in order to get raw form data.
|
||||
* Added `XLFormRowDescriptorTypeSelectorSegmentedControl` row type and example.
|
||||
* AFNetworking dependency removed.
|
||||
* Added `XLFormRowDescriptorTypeStepCounter` row type and related example.
|
||||
|
||||
|
||||
### Version 1.0.1
|
||||
|
||||
* Added storyboard example.
|
||||
* Added button `XLFormRowDescriptorTypeButton` example.
|
||||
* Documented how to add a custom row.
|
||||
* Fixed issues: [#2](https://github.com/xmartlabs/XLForm/issues/2 "#2"), [#3](https://github.com/xmartlabs/XLForm/issues/3 "#3"), [#27](https://github.com/xmartlabs/XLForm/issues/27 "#27"), [#38](https://github.com/xmartlabs/XLForm/issues/38 "#38").
|
||||
* Fixed crash caused by inline date rows. [#6](https://github.com/xmartlabs/XLForm/issues/6 "#6")
|
||||
* Fixed ipad issue *invalid cell layout*. [#10](https://github.com/xmartlabs/XLForm/issues/10 "#10")
|
||||
* New convenience methods to insert sections dinamically. [#13](https://github.com/xmartlabs/XLForm/pull/13 "#13")
|
||||
* Change default label style to `UIFontTextStyleBody`. [#18](https://github.com/xmartlabs/XLForm/issues/18 "#18")
|
||||
* Added step counter row, `XLFormRowDescriptorTypeStepCounter`.
|
||||
* Added `initWithCoder` initializer to `XLFormViewController`. [#32](https://github.com/xmartlabs/XLForm/issues/32 "#32").
|
||||
* Added a convenience method to deselect a `XLFormRowDescriptor`. `-(void)deselectFormRow:(XLFormRowDescriptor *)row;`. [#33](https://github.com/xmartlabs/XLForm/issues/33 "#33").
|
||||
|
||||
|
||||
### Version 1.0.0
|
||||
|
||||
* Initial release
|
||||
@@ -34,6 +34,7 @@
|
||||
#import "CustomRowsViewController.h"
|
||||
#import "AccessoryViewFormViewController.h"
|
||||
#import "PredicateFormViewController.h"
|
||||
#import "FormattersViewController.h"
|
||||
|
||||
NSString * const kTextFieldAndTextView = @"TextFieldAndTextView";
|
||||
NSString * const kSelectors = @"Selectors";
|
||||
@@ -46,6 +47,7 @@ NSString * const kMultivaluedOnlyReorder = @"MultivaluedOnlyReorder";
|
||||
NSString * const kMultivaluedOnlyInsert = @"MultivaluedOnlyInsert";
|
||||
NSString * const kMultivaluedOnlyDelete = @"MultivaluedOnlyDelete";
|
||||
NSString * const kValidations= @"Validations";
|
||||
NSString * const kFormatters = @"Formatters";
|
||||
|
||||
@interface ExamplesFormViewController ()
|
||||
|
||||
@@ -113,6 +115,11 @@ NSString * const kValidations= @"Validations";
|
||||
row.action.viewControllerClass = [DatesFormViewController class];
|
||||
[section addFormRow:row];
|
||||
|
||||
// NSFormatters
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kFormatters rowType:XLFormRowDescriptorTypeButton title:@"NSFormatter Support"];
|
||||
row.action.viewControllerClass = [FormattersViewController class];
|
||||
[section addFormRow:row];
|
||||
|
||||
// Others
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:kOthes rowType:XLFormRowDescriptorTypeButton title:@"Other Rows"];
|
||||
row.action.formSegueIdentifier = @"OthersFormViewControllerSegue";
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// FormattersViewController.h
|
||||
// XLForm
|
||||
//
|
||||
// Created by Freddy Henin on 12/29/14.
|
||||
// Copyright (c) 2014 Xmartlabs. All rights reserved.
|
||||
//
|
||||
|
||||
#import "XLFormViewController.h"
|
||||
|
||||
@interface FormattersViewController : XLFormViewController
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,115 @@
|
||||
//
|
||||
// FormattersViewController.m
|
||||
// XLForm
|
||||
//
|
||||
// Created by Freddy Henin on 12/29/14.
|
||||
// Copyright (c) 2014 Xmartlabs. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
#import "XLForm.h"
|
||||
|
||||
#import "FormattersViewController.h"
|
||||
|
||||
#import <SHSPhoneComponent/SHSPhoneNumberFormatter+UserConfig.h>
|
||||
|
||||
|
||||
// Simple little class to demonstraite currency formatting. Unfortunally we have to subclass
|
||||
// NSNumberFormatter to work aroundn some long known rounding bugs with NSNumberFormatter
|
||||
// http://stackoverflow.com/questions/12580162/nsstring-to-nsdate-conversion-issue
|
||||
@interface CurrencyFormatter : NSNumberFormatter
|
||||
|
||||
@property (readonly) NSDecimalNumberHandler *roundingBehavior;
|
||||
|
||||
@end
|
||||
|
||||
@implementation CurrencyFormatter
|
||||
|
||||
- (id) init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
[self setNumberStyle: NSNumberFormatterCurrencyStyle];
|
||||
[self setGeneratesDecimalNumbers:YES];
|
||||
|
||||
NSUInteger currencyScale = [self maximumFractionDigits];
|
||||
|
||||
_roundingBehavior = [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundPlain scale:currencyScale raiseOnExactness:FALSE raiseOnOverflow:TRUE raiseOnUnderflow:TRUE raiseOnDivideByZero:TRUE];
|
||||
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
//- (BOOL)getObjectValue:(id *)anObject forString:(NSString *)string errorDescription:(NSString **)error
|
||||
//{
|
||||
// NSDecimalNumber *number;
|
||||
// BOOL success = [super getObjectValue:&number forString:string errorDescription:error];
|
||||
//
|
||||
// if (success) {
|
||||
// *anObject = [number decimalNumberByRoundingAccordingToBehavior:_roundingBehavior];
|
||||
// }
|
||||
// else {
|
||||
// *anObject = nil;
|
||||
// }
|
||||
//
|
||||
// return success;
|
||||
//}
|
||||
|
||||
@end
|
||||
|
||||
@interface FormattersViewController ()
|
||||
@end
|
||||
|
||||
@implementation FormattersViewController
|
||||
|
||||
-(id)init
|
||||
{
|
||||
XLFormDescriptor * formDescriptor = [XLFormDescriptor formDescriptorWithTitle:@"Text Fields"];
|
||||
XLFormSectionDescriptor * section;
|
||||
XLFormRowDescriptor * row;
|
||||
|
||||
formDescriptor.assignFirstResponderOnShow = NO;
|
||||
|
||||
section = [XLFormSectionDescriptor formSection];
|
||||
section.title = @"NSFormatter Support";
|
||||
section.footerTitle = @"Rows can be configured to use the formatter as you type or to toggle on and off during for display/editing. You will most likely need custom NSFormatter objects to do on the fly formatting since NSNumberFormatter is pretty limited in this regard.";
|
||||
[formDescriptor addFormSection:section];
|
||||
|
||||
// Phone
|
||||
SHSPhoneNumberFormatter *formatter = [[SHSPhoneNumberFormatter alloc] init];
|
||||
[formatter setDefaultOutputPattern:@"(###) ###-####" imagePath:nil];
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"phone" rowType:XLFormRowDescriptorTypePhone title:@"US Phone"];
|
||||
row.valueFormatter = formatter;
|
||||
[row.cellConfigAtConfigure setObject:@(NSTextAlignmentRight) forKey:@"textField.textAlignment"];
|
||||
|
||||
row.useValueFormatterDuringInput = YES;
|
||||
[section addFormRow:row];
|
||||
|
||||
// Currency
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"currency" rowType:XLFormRowDescriptorTypeDecimal title:@"USD"];
|
||||
CurrencyFormatter *numberFormatter = [[CurrencyFormatter alloc] init];
|
||||
row.valueFormatter = numberFormatter;
|
||||
row.value = [NSDecimalNumber numberWithDouble:9.95];
|
||||
[row.cellConfigAtConfigure setObject:@(NSTextAlignmentRight) forKey:@"textField.textAlignment"];
|
||||
[section addFormRow:row];
|
||||
|
||||
// Accounting
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"percent" rowType:XLFormRowDescriptorTypeNumber title:@"Test Score"];
|
||||
NSNumberFormatter *acctFormatter = [[NSNumberFormatter alloc] init];
|
||||
[acctFormatter setNumberStyle:NSNumberFormatterPercentStyle];
|
||||
row.valueFormatter = acctFormatter;
|
||||
row.value = @(0.75);
|
||||
[row.cellConfigAtConfigure setObject:@(NSTextAlignmentRight) forKey:@"textField.textAlignment"];
|
||||
[section addFormRow:row];
|
||||
|
||||
section = [XLFormSectionDescriptor formSection];
|
||||
[formDescriptor addFormSection:section];
|
||||
|
||||
return [super initWithForm:formDescriptor];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -212,11 +212,13 @@ NSString *const kSelectorWithStoryboardId = @"selectorWithStoryboardId";
|
||||
mutableRightOptions = [rightOptions mutableCopy];
|
||||
[mutableRightOptions removeObjectAtIndex:1];
|
||||
leftRightSelectorOption = [XLFormLeftRightSelectorOption formLeftRightSelectorOptionWithLeftValue:[XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:@"Option 2"] httpParameterKey:@"option_2" rightOptions:mutableRightOptions];
|
||||
leftRightSelectorOption.leftValueChangePolicy = XLFormLeftRightSelectorOptionLeftValueChangePolicyChooseFirstOption;
|
||||
[leftRightSelectorOptions addObject:leftRightSelectorOption];
|
||||
|
||||
mutableRightOptions = [rightOptions mutableCopy];
|
||||
[mutableRightOptions removeObjectAtIndex:2];
|
||||
leftRightSelectorOption = [XLFormLeftRightSelectorOption formLeftRightSelectorOptionWithLeftValue:[XLFormOptionsObject formOptionsObjectWithValue:@(2) displayText:@"Option 3"] httpParameterKey:@"option_3" rightOptions:mutableRightOptions];
|
||||
leftRightSelectorOption.leftValueChangePolicy = XLFormLeftRightSelectorOptionLeftValueChangePolicyChooseLastOption;
|
||||
[leftRightSelectorOptions addObject:leftRightSelectorOption];
|
||||
|
||||
mutableRightOptions = [rightOptions mutableCopy];
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
platform :ios, '8.0'
|
||||
|
||||
target 'XLForm' do
|
||||
|
||||
pod 'XLForm', :path => '../../'
|
||||
|
||||
#Following pods are used for custom row examples
|
||||
@@ -8,3 +10,5 @@ pod 'AFNetworking', '~> 2.0', :inhibit_warnings => true
|
||||
pod 'XLData', :git => 'https://github.com/xmartlabs/XLData.git', :commit => '1f9019b56242a2019c7f7e11ec4ef823c397ebcf', :inhibit_warnings => true
|
||||
pod 'JVFloatLabeledTextField', '1.0.2', :inhibit_warnings => true
|
||||
pod 'AXRatingView', '1.0.3', :inhibit_warnings => true
|
||||
pod 'SHSPhoneComponent'
|
||||
end
|
||||
@@ -0,0 +1,78 @@
|
||||
PODS:
|
||||
- AFNetworking (2.6.3):
|
||||
- AFNetworking/NSURLConnection (= 2.6.3)
|
||||
- AFNetworking/NSURLSession (= 2.6.3)
|
||||
- AFNetworking/Reachability (= 2.6.3)
|
||||
- AFNetworking/Security (= 2.6.3)
|
||||
- AFNetworking/Serialization (= 2.6.3)
|
||||
- AFNetworking/UIKit (= 2.6.3)
|
||||
- AFNetworking/NSURLConnection (2.6.3):
|
||||
- AFNetworking/Reachability
|
||||
- AFNetworking/Security
|
||||
- AFNetworking/Serialization
|
||||
- AFNetworking/NSURLSession (2.6.3):
|
||||
- AFNetworking/Reachability
|
||||
- AFNetworking/Security
|
||||
- AFNetworking/Serialization
|
||||
- AFNetworking/Reachability (2.6.3)
|
||||
- AFNetworking/Security (2.6.3)
|
||||
- AFNetworking/Serialization (2.6.3)
|
||||
- AFNetworking/UIKit (2.6.3):
|
||||
- AFNetworking/NSURLConnection
|
||||
- AFNetworking/NSURLSession
|
||||
- AXRatingView (1.0.3)
|
||||
- JVFloatLabeledTextField (1.0.2)
|
||||
- SHSPhoneComponent (2.15)
|
||||
- XLData (2.0.0):
|
||||
- XLData/Core (= 2.0.0)
|
||||
- XLData/CoreData (= 2.0.0)
|
||||
- XLData/CoreRemote (= 2.0.0)
|
||||
- XLData/DataStore (= 2.0.0)
|
||||
- XLData/RemoteCoreData (= 2.0.0)
|
||||
- XLData/RemoteDataStore (= 2.0.0)
|
||||
- XLData/Core (2.0.0)
|
||||
- XLData/CoreData (2.0.0):
|
||||
- XLData/Core
|
||||
- XLData/CoreRemote (2.0.0):
|
||||
- AFNetworking (~> 2.0)
|
||||
- XLData/DataStore (2.0.0):
|
||||
- XLData/Core
|
||||
- XLData/RemoteCoreData (2.0.0):
|
||||
- XLData/CoreData
|
||||
- XLData/CoreRemote
|
||||
- XLData/RemoteDataStore (2.0.0):
|
||||
- XLData/CoreRemote
|
||||
- XLData/DataStore
|
||||
- XLForm (3.1.2)
|
||||
|
||||
DEPENDENCIES:
|
||||
- AFNetworking (~> 2.0)
|
||||
- AXRatingView (= 1.0.3)
|
||||
- JVFloatLabeledTextField (= 1.0.2)
|
||||
- SHSPhoneComponent
|
||||
- XLData (from `https://github.com/xmartlabs/XLData.git`, commit `1f9019b56242a2019c7f7e11ec4ef823c397ebcf`)
|
||||
- XLForm (from `../../`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
XLData:
|
||||
:commit: 1f9019b56242a2019c7f7e11ec4ef823c397ebcf
|
||||
:git: https://github.com/xmartlabs/XLData.git
|
||||
XLForm:
|
||||
:path: ../../
|
||||
|
||||
CHECKOUT OPTIONS:
|
||||
XLData:
|
||||
:commit: 1f9019b56242a2019c7f7e11ec4ef823c397ebcf
|
||||
:git: https://github.com/xmartlabs/XLData.git
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
|
||||
AXRatingView: ccaadc1bbda99a4b7e1d556059482d2b933a9f4e
|
||||
JVFloatLabeledTextField: 58a3a32cfb800e5b224f676987e7c13abf50a14d
|
||||
SHSPhoneComponent: 4cec0653a150ad63cbc52b0c8b29ce2d3c9c26f0
|
||||
XLData: df725c6179e2e0c80bf56a1ecad9afd169707a6d
|
||||
XLForm: 6bb3c20857e2983cf494cb8b4d666c2a24673d5e
|
||||
|
||||
PODFILE CHECKSUM: 80615792e859be64c95add3bb57c1596234faf95
|
||||
|
||||
COCOAPODS: 1.0.0
|
||||
@@ -33,7 +33,6 @@
|
||||
28A85D5918E346C100E81A26 /* XLFormImageSelectorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A85D5818E346C100E81A26 /* XLFormImageSelectorCell.m */; };
|
||||
28DBB04118D76FDC00FB8A8B /* MultivaluedFormViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28DBB04018D76FDC00FB8A8B /* MultivaluedFormViewController.m */; };
|
||||
28F89F2E1AA4EA5600E90218 /* ValidationExamplesFormViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28F89F2D1AA4EA5600E90218 /* ValidationExamplesFormViewController.m */; };
|
||||
2CA9A3FC06E94345A2FDE415 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F6DF43B7BBF44F72A4493E8E /* libPods.a */; };
|
||||
3C0357F01AB0D82300200C8A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3C0357EF1AB0D82300200C8A /* Images.xcassets */; };
|
||||
3C3B01D51AB741EF0027CD45 /* XLFormRatingCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3B01D31AB741EF0027CD45 /* XLFormRatingCell.m */; };
|
||||
3C3B01DA1AB7497D0027CD45 /* XLFormWeekDaysCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3B01D81AB7497D0027CD45 /* XLFormWeekDaysCell.m */; };
|
||||
@@ -41,6 +40,7 @@
|
||||
3C3B01E21AB7499A0027CD45 /* XLRatingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3B01E01AB7499A0027CD45 /* XLRatingView.m */; };
|
||||
3C3B01F01AB74BDC0027CD45 /* FloatLabeledTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3B01EF1AB74BDC0027CD45 /* FloatLabeledTextFieldCell.m */; };
|
||||
3CDAFC7A1AB0AFA4000F75B6 /* CustomRowsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CDAFC791AB0AFA4000F75B6 /* CustomRowsViewController.m */; };
|
||||
5BB6B032D80344C9E7D956CD /* libPods-XLForm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19383D268EF8024CB33FCCA4 /* libPods-XLForm.a */; };
|
||||
66B6266E1AE0055100007886 /* DateAndTimeValueTrasformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 66B6266D1AE0055100007886 /* DateAndTimeValueTrasformer.m */; };
|
||||
BF01E9281C21F0BB00BDE045 /* XLFormInlineSegmentedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BF01E9271C21F0BB00BDE045 /* XLFormInlineSegmentedCell.m */; };
|
||||
BF9DB1D51AE0436600B985E7 /* BlogExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BF9DB1D21AE0436600B985E7 /* BlogExampleViewController.m */; };
|
||||
@@ -49,9 +49,11 @@
|
||||
BFE91AFB1AE159B200DE5231 /* BasicPredicateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BFE91AFA1AE159B200DE5231 /* BasicPredicateViewController.m */; };
|
||||
D51B8B2C19126664008C0478 /* XLFormCustomCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D51B8B2B19126664008C0478 /* XLFormCustomCell.m */; };
|
||||
DEA6EF911B57D6CC000F4893 /* HTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DEA6EF901B57D6CC000F4893 /* HTTPSessionManager.m */; };
|
||||
DEB8235C1AD5529A00AF9FE2 /* FormattersViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DEB8235B1AD5529A00AF9FE2 /* FormattersViewController.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
19383D268EF8024CB33FCCA4 /* libPods-XLForm.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-XLForm.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
281E5BE719538F4A006D93C5 /* CLLocationValueTrasformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CLLocationValueTrasformer.h; path = Examples/Selectors/CustomSelectors/XLFormRowViewController/CLLocationValueTrasformer.h; sourceTree = "<group>"; };
|
||||
281E5BE819538F4A006D93C5 /* CLLocationValueTrasformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CLLocationValueTrasformer.m; path = Examples/Selectors/CustomSelectors/XLFormRowViewController/CLLocationValueTrasformer.m; sourceTree = "<group>"; };
|
||||
282EB27A1AB5FF33004A736F /* AccessoryViewFormViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AccessoryViewFormViewController.h; path = Examples/AccessoryViews/AccessoryViewFormViewController.h; sourceTree = "<group>"; };
|
||||
@@ -111,10 +113,10 @@
|
||||
3C3B01EF1AB74BDC0027CD45 /* FloatLabeledTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FloatLabeledTextFieldCell.m; path = Examples/CustomRows/FloatLabeledTextField/FloatLabeledTextFieldCell.m; sourceTree = "<group>"; };
|
||||
3CDAFC781AB0AFA4000F75B6 /* CustomRowsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomRowsViewController.h; path = Examples/CustomRows/CustomRowsViewController.h; sourceTree = "<group>"; };
|
||||
3CDAFC791AB0AFA4000F75B6 /* CustomRowsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CustomRowsViewController.m; path = Examples/CustomRows/CustomRowsViewController.m; sourceTree = "<group>"; };
|
||||
5F6FC67A75254B60005DC716 /* Pods-XLForm.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-XLForm.debug.xcconfig"; path = "Pods/Target Support Files/Pods-XLForm/Pods-XLForm.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
66B6266C1AE0055100007886 /* DateAndTimeValueTrasformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DateAndTimeValueTrasformer.h; path = Examples/Dates/DateAndTimeValueTrasformer.h; sourceTree = "<group>"; };
|
||||
66B6266D1AE0055100007886 /* DateAndTimeValueTrasformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DateAndTimeValueTrasformer.m; path = Examples/Dates/DateAndTimeValueTrasformer.m; sourceTree = "<group>"; };
|
||||
7B0D2D6A86E2A41ED22E8A35 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
976A33EE62A018A7257B4878 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
|
||||
B98C1213E7C714A861219C81 /* Pods-XLForm.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-XLForm.release.xcconfig"; path = "Pods/Target Support Files/Pods-XLForm/Pods-XLForm.release.xcconfig"; sourceTree = "<group>"; };
|
||||
BF01E9261C21F0BB00BDE045 /* XLFormInlineSegmentedCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XLFormInlineSegmentedCell.h; path = "Inline Segmented/XLFormInlineSegmentedCell.h"; sourceTree = "<group>"; };
|
||||
BF01E9271C21F0BB00BDE045 /* XLFormInlineSegmentedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XLFormInlineSegmentedCell.m; path = "Inline Segmented/XLFormInlineSegmentedCell.m"; sourceTree = "<group>"; };
|
||||
BF9DB1D11AE0436600B985E7 /* BlogExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BlogExampleViewController.h; path = Examples/PredicateExamples/BlogExampleViewController.h; sourceTree = SOURCE_ROOT; };
|
||||
@@ -127,7 +129,8 @@
|
||||
D51B8B2B19126664008C0478 /* XLFormCustomCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XLFormCustomCell.m; path = Examples/Others/CustomCells/XLFormCustomCell.m; sourceTree = "<group>"; };
|
||||
DEA6EF8F1B57D6CC000F4893 /* HTTPSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTTPSessionManager.h; path = Examples/Selectors/HTTPSessionManager.h; sourceTree = "<group>"; };
|
||||
DEA6EF901B57D6CC000F4893 /* HTTPSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTTPSessionManager.m; path = Examples/Selectors/HTTPSessionManager.m; sourceTree = "<group>"; };
|
||||
F6DF43B7BBF44F72A4493E8E /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
DEB8235A1AD5529A00AF9FE2 /* FormattersViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormattersViewController.h; sourceTree = "<group>"; };
|
||||
DEB8235B1AD5529A00AF9FE2 /* FormattersViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FormattersViewController.m; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -139,22 +142,13 @@
|
||||
2850C5FE18D0F706002B7D0A /* CoreGraphics.framework in Frameworks */,
|
||||
2850C60018D0F706002B7D0A /* UIKit.framework in Frameworks */,
|
||||
2850C5FC18D0F706002B7D0A /* Foundation.framework in Frameworks */,
|
||||
2CA9A3FC06E94345A2FDE415 /* libPods.a in Frameworks */,
|
||||
5BB6B032D80344C9E7D956CD /* libPods-XLForm.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
15E61D225B0D27FAB51BDD90 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7B0D2D6A86E2A41ED22E8A35 /* Pods.debug.xcconfig */,
|
||||
976A33EE62A018A7257B4878 /* Pods.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
282C5EEF18D33C1800A5D47C /* Inputs */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -261,7 +255,7 @@
|
||||
2850C60118D0F706002B7D0A /* XLForm */,
|
||||
2850C5FA18D0F706002B7D0A /* Frameworks */,
|
||||
2850C5F918D0F706002B7D0A /* Products */,
|
||||
15E61D225B0D27FAB51BDD90 /* Pods */,
|
||||
B6478577DDCB0DDDD433C572 /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -280,7 +274,7 @@
|
||||
2850C5FB18D0F706002B7D0A /* Foundation.framework */,
|
||||
2850C5FD18D0F706002B7D0A /* CoreGraphics.framework */,
|
||||
2850C5FF18D0F706002B7D0A /* UIKit.framework */,
|
||||
F6DF43B7BBF44F72A4493E8E /* libPods.a */,
|
||||
19383D268EF8024CB33FCCA4 /* libPods-XLForm.a */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -312,6 +306,7 @@
|
||||
282EB2791AB5FD66004A736F /* AccessoryViews */,
|
||||
3CDAFC741AB0AEE5000F75B6 /* CustomRows */,
|
||||
28F89F2B1AA4E99500E90218 /* Validations */,
|
||||
DEB823591AD5529A00AF9FE2 /* Formatters */,
|
||||
283C6B7A1999BA1B00A5283D /* UICustomization */,
|
||||
28A76624193251E500D69546 /* AppDelegate.m */,
|
||||
28A8083C190D903D009D77F8 /* StoryboardExample */,
|
||||
@@ -429,6 +424,15 @@
|
||||
name = CustomRows;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B6478577DDCB0DDDD433C572 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5F6FC67A75254B60005DC716 /* Pods-XLForm.debug.xcconfig */,
|
||||
B98C1213E7C714A861219C81 /* Pods-XLForm.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BF01E9251C21F02D00BDE045 /* Inline Segmented */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -461,6 +465,16 @@
|
||||
name = SessionManager;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
DEB823591AD5529A00AF9FE2 /* Formatters */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DEB8235A1AD5529A00AF9FE2 /* FormattersViewController.h */,
|
||||
DEB8235B1AD5529A00AF9FE2 /* FormattersViewController.m */,
|
||||
);
|
||||
name = Formatters;
|
||||
path = Examples/Formatters;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -468,12 +482,12 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2850C62418D0F707002B7D0A /* Build configuration list for PBXNativeTarget "XLForm" */;
|
||||
buildPhases = (
|
||||
0EA9FCE3DA0D444498836D37 /* Check Pods Manifest.lock */,
|
||||
EBE0335CCC7588D83B89A92A /* 📦 Check Pods Manifest.lock */,
|
||||
2850C5F418D0F706002B7D0A /* Sources */,
|
||||
2850C5F518D0F706002B7D0A /* Frameworks */,
|
||||
2850C5F618D0F706002B7D0A /* Resources */,
|
||||
CFE72E068B5F4D9BB45FB757 /* Copy Pods Resources */,
|
||||
734CC62A7A974D37CC982576 /* Embed Pods Frameworks */,
|
||||
32EB30E0A90A4E91864B1D3C /* 📦 Embed Pods Frameworks */,
|
||||
DE3D12F5596780A66C6C3D4A /* 📦 Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -528,14 +542,44 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
0EA9FCE3DA0D444498836D37 /* Check Pods Manifest.lock */ = {
|
||||
32EB30E0A90A4E91864B1D3C /* 📦 Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Check Pods Manifest.lock";
|
||||
name = "📦 Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-XLForm/Pods-XLForm-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
DE3D12F5596780A66C6C3D4A /* 📦 Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "📦 Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-XLForm/Pods-XLForm-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
EBE0335CCC7588D83B89A92A /* 📦 Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "📦 Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -543,36 +587,6 @@
|
||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
734CC62A7A974D37CC982576 /* Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
CFE72E068B5F4D9BB45FB757 /* Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
@@ -606,6 +620,7 @@
|
||||
BF01E9281C21F0BB00BDE045 /* XLFormInlineSegmentedCell.m in Sources */,
|
||||
BF9DB1D61AE0436600B985E7 /* PredicateFormViewController.m in Sources */,
|
||||
BFE91AFB1AE159B200DE5231 /* BasicPredicateViewController.m in Sources */,
|
||||
DEB8235C1AD5529A00AF9FE2 /* FormattersViewController.m in Sources */,
|
||||
2843EB5218D4CFC700F13E2B /* OthersFormViewController.m in Sources */,
|
||||
2843EB4B18D496F600F13E2B /* SelectorsFormViewController.m in Sources */,
|
||||
28468EA418EF41D300DBB015 /* InputsFormViewController.m in Sources */,
|
||||
@@ -708,7 +723,7 @@
|
||||
};
|
||||
2850C62518D0F707002B7D0A /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7B0D2D6A86E2A41ED22E8A35 /* Pods.debug.xcconfig */;
|
||||
baseConfigurationReference = 5F6FC67A75254B60005DC716 /* Pods-XLForm.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
@@ -725,10 +740,11 @@
|
||||
};
|
||||
2850C62618D0F707002B7D0A /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 976A33EE62A018A7257B4878 /* Pods.release.xcconfig */;
|
||||
baseConfigurationReference = B98C1213E7C714A861219C81 /* Pods-XLForm.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "XLForm/XLForm-Prefix.pch";
|
||||
INFOPLIST_FILE = "XLForm/XLForm-Info.plist";
|
||||
|
||||
@@ -356,11 +356,12 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2847A6BD1AAF2679000A2ABE /* Build configuration list for PBXNativeTarget "SwiftExample" */;
|
||||
buildPhases = (
|
||||
21FCE00817B1AE1029F382A4 /* Check Pods Manifest.lock */,
|
||||
21FCE00817B1AE1029F382A4 /* 📦 Check Pods Manifest.lock */,
|
||||
2847A69A1AAF2679000A2ABE /* Sources */,
|
||||
2847A69B1AAF2679000A2ABE /* Frameworks */,
|
||||
2847A69C1AAF2679000A2ABE /* Resources */,
|
||||
A0F2DA95250A4C3E69515D96 /* Copy Pods Resources */,
|
||||
A0F2DA95250A4C3E69515D96 /* 📦 Copy Pods Resources */,
|
||||
DCA1F7B1D7E04613B3E151C1 /* 📦 Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -421,14 +422,14 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
21FCE00817B1AE1029F382A4 /* Check Pods Manifest.lock */ = {
|
||||
21FCE00817B1AE1029F382A4 /* 📦 Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Check Pods Manifest.lock";
|
||||
name = "📦 Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -436,14 +437,14 @@
|
||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
A0F2DA95250A4C3E69515D96 /* Copy Pods Resources */ = {
|
||||
A0F2DA95250A4C3E69515D96 /* 📦 Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Copy Pods Resources";
|
||||
name = "📦 Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -451,6 +452,21 @@
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
DCA1F7B1D7E04613B3E151C1 /* 📦 Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "📦 Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
|
||||
@@ -38,8 +38,75 @@ What XLForm does
|
||||
|
||||
|
||||
|
||||
How to create a form
|
||||
-----------------------------
|
||||
## How to create a form
|
||||
|
||||
#### Create an instance of XLFormViewController
|
||||
|
||||
##### Swift
|
||||
|
||||
```swift
|
||||
class CalendarEventFormViewController : XLFormViewController {
|
||||
|
||||
required init(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
self.initializeForm()
|
||||
}
|
||||
|
||||
|
||||
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
|
||||
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
||||
self.initializeForm()
|
||||
}
|
||||
|
||||
func initializeForm() {
|
||||
// Implementation details covered in the next section.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
##### Objective-C
|
||||
|
||||
```objc
|
||||
#import "XLFormViewController.h"
|
||||
|
||||
@interface CalendarEventFormViewController: XLFormViewController
|
||||
|
||||
@end
|
||||
```
|
||||
|
||||
```objc
|
||||
@interface ExamplesFormViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation ExamplesFormViewController
|
||||
|
||||
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self){
|
||||
[self initializeForm];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(NSCoder *)aDecoder {
|
||||
self = [super initWithCoder:aDecoder];
|
||||
if (self){
|
||||
[self initializeForm];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)initializeForm {
|
||||
// Implementation details covered in the next section.
|
||||
}
|
||||
|
||||
@end
|
||||
```
|
||||
|
||||
##### Implementing the initializeForm method
|
||||
|
||||
To create a form we should declare it through a `XLFormDescriptor` instance and assign it to a `XLFormViewController` instance. As we said XLForm works based on a DSL that hides complex and boilerplate stuff without losing the power and flexibility of hand-made forms.
|
||||
|
||||
@@ -51,50 +118,56 @@ To define a form we use 3 classes:
|
||||
|
||||
A form definition is a `XLFormDescriptor` instance that contains one or more sections (`XLFormSectionDescriptor` instances) and each section contains several rows (`XLFormRowDescriptor` instance). As you may have noticed the DSL structure is analog to the structure of a `UITableView` (Table -->> Sections -- >> Rows). The resulting table-view form's structure (sections and rows order) mirrors the definition's structure.
|
||||
|
||||
#####Let's see part of the iOS Calendar Event Form definition.
|
||||
|
||||
##### Let's see an example implementation of initializeForm to define the iOS Calendar Event Form
|
||||
|
||||
```objc
|
||||
XLFormDescriptor * form;
|
||||
XLFormSectionDescriptor * section;
|
||||
XLFormRowDescriptor * row;
|
||||
- (void)initializeForm {
|
||||
XLFormDescriptor * form;
|
||||
XLFormSectionDescriptor * section;
|
||||
XLFormRowDescriptor * row;
|
||||
|
||||
form = [XLFormDescriptor formDescriptorWithTitle:@"Add Event"];
|
||||
form = [XLFormDescriptor formDescriptorWithTitle:@"Add Event"];
|
||||
|
||||
// First section
|
||||
section = [XLFormSectionDescriptor formSection];
|
||||
[form addFormSection:section];
|
||||
// First section
|
||||
section = [XLFormSectionDescriptor formSection];
|
||||
[form addFormSection:section];
|
||||
|
||||
// Title
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"title" rowType:XLFormRowDescriptorTypeText];
|
||||
[row.cellConfigAtConfigure setObject:@"Title" forKey:@"textField.placeholder"];
|
||||
[section addFormRow:row];
|
||||
// Title
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"title" rowType:XLFormRowDescriptorTypeText];
|
||||
[row.cellConfigAtConfigure setObject:@"Title" forKey:@"textField.placeholder"];
|
||||
[section addFormRow:row];
|
||||
|
||||
// Location
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"location" rowType:XLFormRowDescriptorTypeText];
|
||||
[row.cellConfigAtConfigure setObject:@"Location" forKey:@"textField.placeholder"];
|
||||
[section addFormRow:row];
|
||||
// Location
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"location" rowType:XLFormRowDescriptorTypeText];
|
||||
[row.cellConfigAtConfigure setObject:@"Location" forKey:@"textField.placeholder"];
|
||||
[section addFormRow:row];
|
||||
|
||||
// Second Section
|
||||
section = [XLFormSectionDescriptor formSection];
|
||||
[form addFormSection:section];
|
||||
// Second Section
|
||||
section = [XLFormSectionDescriptor formSection];
|
||||
[form addFormSection:section];
|
||||
|
||||
// All-day
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"all-day" rowType:XLFormRowDescriptorTypeBooleanSwitch title:@"All-day"];
|
||||
[section addFormRow:row];
|
||||
// All-day
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"all-day" rowType:XLFormRowDescriptorTypeBooleanSwitch title:@"All-day"];
|
||||
[section addFormRow:row];
|
||||
|
||||
// Starts
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"starts" rowType:XLFormRowDescriptorTypeDateTimeInline title:@"Starts"];
|
||||
row.value = [NSDate dateWithTimeIntervalSinceNow:60*60*24];
|
||||
[section addFormRow:row];
|
||||
// Starts
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"starts" rowType:XLFormRowDescriptorTypeDateTimeInline title:@"Starts"];
|
||||
row.value = [NSDate dateWithTimeIntervalSinceNow:60*60*24];
|
||||
[section addFormRow:row];
|
||||
}
|
||||
```
|
||||
|
||||
XLForm will load the table-view form from the previously explained definition. The most interesting part is that it will update the table-view form based on the form definition modifications.
|
||||
That means that we are able to make changes on the table-view form adding or removing section definitions or row definitions to the form definition on runtime and you will never need to care again about `NSIndexPath`, `UITableViewDelegate`, `UITableViewDataSource` or other complexities.
|
||||
|
||||
|
||||
**To see more complex form definitions take a look at the example application in the Examples folder of this repository. You can also run the examples on your own device if you wish.** XLForm **has no** dependencies over other pods, anyway the examples project makes use of some cocoapods to show advanced XLForm features.
|
||||
|
||||
## Using XLForm with Storyboards
|
||||
|
||||
* Perform the steps from **How to create a form**
|
||||
* In Interface Builder (IB), drag-and-drop a **UIViewController** onto the Storyboard
|
||||
* Associate your custom form class to the **UIViewController** using the **Identity Inspector**
|
||||
|
||||
How to run XLForm examples
|
||||
---------------------------------
|
||||
|
||||
@@ -615,6 +688,8 @@ XLForm sets up `rowDescriptor` property using the `XLFormRowDescriptor` instance
|
||||
|
||||
The developer is responsible for update its views with the `rowDescriptor` value as well as set the selected value to `rowDescriptor` from within the custom selector view controller.
|
||||
|
||||
> Note: the properties `viewControllerClass`, `viewControllerNibName` or `viewControllerStoryboardId` are mutually exclusive and are used by `XLFormButtonCell` and `XLFormSelectorCell`. If you create a custom cell then you are responsible for using them.
|
||||
|
||||
|
||||
#### Another example
|
||||
|
||||
@@ -804,7 +879,7 @@ Let's see how to change the color of the cell label:
|
||||
|
||||
```objc
|
||||
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"title" rowType:XLFormRowDescriptorTypeText];
|
||||
[row.cellConfigAtConfigure setObject:[UIColor red] forKey:@"textLabel.textColor"];
|
||||
[row.cellConfig setObject:[UIColor redColor] forKey:@"textLabel.textColor"];
|
||||
[section addFormRow:row];
|
||||
```
|
||||
|
||||
@@ -999,6 +1074,15 @@ This is how you can set them:
|
||||
[row.cellConfigAtConfigure setObject:@(UIReturnKeyGo) forKey:@"nextReturnKeyType"];
|
||||
```
|
||||
|
||||
#### How to change the height of one cell
|
||||
|
||||
If you want to change the height for all cells of one class you should subclass that cell and override the class method `formDescriptorCellHeightForRowDescriptor`.
|
||||
If you want to change the height of one individual cell then you can set that height to the `height` property of XLFormRowDescripto like this:
|
||||
```
|
||||
XLFormRowDescriptor* row = ...
|
||||
row.height = 55;
|
||||
```
|
||||
|
||||
Installation
|
||||
--------------------------
|
||||
|
||||
@@ -1010,15 +1094,7 @@ Installation
|
||||
|
||||
XLForm **has no** dependencies over other pods.
|
||||
|
||||
## Carthage
|
||||
|
||||
In your `Cartfile` add:
|
||||
|
||||
```
|
||||
github "xmartlabs/XLForm" ~> 3.0
|
||||
```
|
||||
|
||||
### How to use master branch
|
||||
#### How to use master branch
|
||||
|
||||
Often master branch contains most recent features and latest fixes. On the other hand this features was not fully tested and changes on master may occur at any time. For the previous reasons I stongly recommend to fork the repository and manage the updates from master on your own making the proper pull on demand.
|
||||
|
||||
@@ -1029,7 +1105,7 @@ To use xmartlabs master branch.....
|
||||
|
||||
You can replace the repository URL for your forked version url if you wish.
|
||||
|
||||
### How to use XLForm in Swift files
|
||||
#### How to use XLForm in Swift files
|
||||
|
||||
If you have installed XLForm with cocoapods and have set `use_frameworks!` in your Podfile, you can add `import XLForm` to any Swift file.
|
||||
|
||||
@@ -1037,6 +1113,31 @@ If you are using cocoapods but have not set `use_frameworks!` in your Podfile, a
|
||||
|
||||
For further details on how to create and configure the bridging header file visit [*Importing Objective-C into Swift*](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html "Importing Objective-C into Swift").
|
||||
|
||||
|
||||
## Carthage
|
||||
|
||||
In your `Cartfile` add:
|
||||
|
||||
```
|
||||
github "xmartlabs/XLForm" ~> 3.0
|
||||
```
|
||||
|
||||
## Using git submodules
|
||||
|
||||
* Clone XLForm as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command from your project root git folder.
|
||||
|
||||
```bash
|
||||
$ git submodule add https://github.com/xmartlabs/XLForm.git
|
||||
```
|
||||
|
||||
* Open XLForm folder that was created by the previous git submodule command and drag the XLForm.xcodeproj into the Project Navigator of your application's Xcode project.
|
||||
|
||||
* Select the XLForm.xcodeproj in the Project Navigator and verify the deployment target matches with your application deployment target.
|
||||
|
||||
* Select your project in the Xcode Navigation and then select your application target from the sidebar. Next select the "General" tab and click on the + button under the "Embedded Binaries" section.
|
||||
|
||||
* Select `XLForm.framework` and we are done!
|
||||
|
||||
Requirements
|
||||
-----------------------------
|
||||
|
||||
@@ -1048,124 +1149,7 @@ Requirements
|
||||
Release Notes
|
||||
--------------
|
||||
|
||||
Version 3.1.1
|
||||
* Allow setting width percentage on UITextView
|
||||
* Added custom inline row example
|
||||
* Fixed bug where XLFormImageCell was not added to project
|
||||
* Add ability to `end editing` on scroll
|
||||
* Other bugs and refactor
|
||||
|
||||
Version 3.1.0
|
||||
* Added Carthage support
|
||||
* Added NSCoding protocol
|
||||
* Allowed HTTP connections
|
||||
* Several bugfixes and improvements.
|
||||
|
||||
Version 3.0.2
|
||||
* Fix issue when inline pickers expand beyond table.
|
||||
|
||||
Version 3.0.1
|
||||
|
||||
* Improvements and bug fixes.
|
||||
* Ability to left, right align textfields. Ability to set up a minimum textField width.
|
||||
* If form is being shown, assigning a new form automatically reload the tableview.
|
||||
* Update objective-c and swift example projects.
|
||||
* Swift compatibility fixes.
|
||||
* Long email validation added.
|
||||
* Fixed row copy issue, now valueTransformer value is copied.
|
||||
* Fixed step counter row layout issues.
|
||||
* Fixed issue "Last form field hides beneath enabled navigation controller's toolbar".
|
||||
* Fixed issue "Navigating between cells using bottom navigation buttons causes table cell dividers to disappear".
|
||||
* Use UIAlertController instead UIActionSheet/UIAlertView if possible.
|
||||
* Hidden and disabled rows resign first responder before changing state.
|
||||
* onChangeBlock added to rowDescriptor.
|
||||
* use tintColor as default button row color.
|
||||
* By default accessoryView is no longer shown for inline rows.
|
||||
* Fix NSBundle issues to use XLForm as dynamic framework.
|
||||
|
||||
Version 3.0.0
|
||||
|
||||
* `hidden`, `disable` properties added to `XLFormRowDescriptor`. `@YES` `@NO` or a `NSPredicate` can be used to hide, disable de row.
|
||||
* `hidden` property added to `XLFormSectionDescriptor`. `@YES` `@NO` or a `NSPredicate` can be used to hide the section.
|
||||
* Added `XLFormRowDescriptorTypeCountDownTimerInline` and `XLFormRowDescriptorTypeCountDownTimer` row type with an example.
|
||||
* Deleted `dateFormatter` property and added support to use the `NSValueTransformer` to convert the selected object to a NSString in the XLFormDateCell class.
|
||||
|
||||
* Added `XLFormRowDescriptorTypeCountDownTimerInline` and `XLFormRowDescriptorTypeCountDownTimer` row type with an example.
|
||||
* Deleted `dateFormatter` property and added support to use the `NSValueTransformer` to convert the selected object to a NSString in the XLFormDateCell class.
|
||||
|
||||
|
||||
Version 2.2.0
|
||||
|
||||
* Fixed "(null)" caption when `XLFormRowDescriptorTypeSelectorLeftRight` row required error message is shown.
|
||||
* Refresh the cell content instead of recreating one, when the form get back from a selection.
|
||||
* Added XLFormRowDescriptor to validations error to easily show an error mask.
|
||||
* Use row tag in validation error message if row does not have a title. It is also possible to set up a custom message if needed
|
||||
* Added a convenience method to add a XLFormRowDescriptor instance before another one.
|
||||
* Allow nil values in cellConfig and cellConfigAtConfigure.
|
||||
* Fix constraints for textFieldCell when it is configured to be right aligned.
|
||||
* Add asterisk to required segmentedCells if needed.
|
||||
* Fail validation for empty strings and NSNull on required rows.
|
||||
* Segue support added to buttons and selectors.
|
||||
* Ability to configure a storyboardId or a viewController nibName to by used by button and selector rows as presented view controller.
|
||||
* Fix scrolling to top when status bar is tapped.
|
||||
* Fix wrong type of XLFormRowDescriptorTypeDecimal row. Now it's converted to NSNumber.
|
||||
* Fix issue: XLFormRegexValidator only checks regex validation for NSStrings, not working for number.
|
||||
* Callconfigure method from awakeFromNib on XLFormBaseCell.
|
||||
* Assign form.delegate from inside setForm: method.
|
||||
* Added custom cell, validation, reordering, can insert, can delete examples.
|
||||
* Added support for inputAccessoryView. Default input accessory view allows to navigate among rows. Fully optionally and customizable.
|
||||
* Added suport for row navigation. Fully optionally and customizable.
|
||||
* beginEditing: endEditing: methods added. These method are called each time a row gains / loses firstResponder. They bring the ability to do UI changes.
|
||||
* Read Only mode added. `disable` property added to XLFormDescriptor class.
|
||||
* Rename `label` XLFormTextViewCell property as `textLabel`.
|
||||
* fix position of multivalued section accessory view.
|
||||
* Can delete, can delete, can reorder section mode added. it's possible to enable some of them, don't need to enable all modes.
|
||||
|
||||
Version 2.1.0
|
||||
|
||||
* Change `XLFormRowDescriptorTypeText`, `XLFormRowDescriptorTypeName` and `XLFormRowDescriptorTypeTextView` keyboard type to `UIKeyboardTypeDefault`.
|
||||
* Added `XLFormRowDescriptorTypeInfo` row type and example.
|
||||
* Added `XLFormRowDescriptorTypeSelectorPopover` row type and example.
|
||||
* CI added. Created Test project into Tests folder and set up Travis.
|
||||
* Documented how to customize UI. Added an example.
|
||||
* Now XLFormViewController extends from UIViewController instead of UITableViewController.
|
||||
* Added tableView property as a XLFormViewController IBOutlet.
|
||||
* Added support for storyboard reuse identifier and nib file.
|
||||
* Button selection can be handled using a selector or block.
|
||||
* Added addAsteriskToRequiredRowsTitle property to XLFormDescriptor. NO is used as value by default.
|
||||
* Image cell has been removed because it depends on AFNetworking and now needs to be implemented as a custom cell. You can find the image custom cell in Examples/Others/CustomCells.
|
||||
|
||||
Version 2.0.0 (cocoaPod)
|
||||
|
||||
* Added `XLFormRowDescriptorTypeMultipleSelector` row type and example.
|
||||
* Added `XLFormRowDescriptorTypeSelectorPickerView` row type and example.
|
||||
* Added `XLFormRowDescriptorTypeSelectorPickerViewInline` row type and example.
|
||||
* Added generic way to create inline selector rows.
|
||||
* Ability to customize row animations.
|
||||
* `(NSDictionary *)formValues;` XLFormViewController method added in order to get raw form data.
|
||||
* Added `XLFormRowDescriptorTypeSelectorSegmentedControl` row type and example.
|
||||
* AFNetworking dependency removed.
|
||||
* Added `XLFormRowDescriptorTypeStepCounter` row type and related example.
|
||||
|
||||
|
||||
Version 1.0.1 (cocoaPod)
|
||||
|
||||
* Added storyboard example.
|
||||
* Added button `XLFormRowDescriptorTypeButton` example.
|
||||
* Documented how to add a custom row.
|
||||
* Fixed issues: [#2](https://github.com/xmartlabs/XLForm/issues/2 "#2"), [#3](https://github.com/xmartlabs/XLForm/issues/3 "#3"), [#27](https://github.com/xmartlabs/XLForm/issues/27 "#27"), [#38](https://github.com/xmartlabs/XLForm/issues/38 "#38").
|
||||
* Fixed crash caused by inline date rows. [#6](https://github.com/xmartlabs/XLForm/issues/6 "#6")
|
||||
* Fixed ipad issue *invalid cell layout*. [#10](https://github.com/xmartlabs/XLForm/issues/10 "#10")
|
||||
* New convenience methods to insert sections dinamically. [#13](https://github.com/xmartlabs/XLForm/pull/13 "#13")
|
||||
* Change default label style to `UIFontTextStyleBody`. [#18](https://github.com/xmartlabs/XLForm/issues/18 "#18")
|
||||
* Added step counter row, `XLFormRowDescriptorTypeStepCounter`.
|
||||
* Added `initWithCoder` initializer to `XLFormViewController`. [#32](https://github.com/xmartlabs/XLForm/issues/32 "#32").
|
||||
* Added a convenience method to deselect a `XLFormRowDescriptor`. `-(void)deselectFormRow:(XLFormRowDescriptor *)row;`. [#33](https://github.com/xmartlabs/XLForm/issues/33 "#33").
|
||||
|
||||
|
||||
Version 1.0.0 (cocoaPod)
|
||||
|
||||
* Initial release
|
||||
Have a look at the [CHANGELOG](https://github.com/xmartlabs/XLForm/blob/master/CHANGELOG.md)
|
||||
|
||||
Author
|
||||
-----------------
|
||||
|
||||
+5
-3
@@ -1,7 +1,9 @@
|
||||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
xcodeproj 'XLForm Tests'
|
||||
project 'XLForm Tests'
|
||||
inhibit_all_warnings!
|
||||
|
||||
platform :ios, '7.0'
|
||||
pod 'Expecta', '~> 0.3.0'
|
||||
pod 'XLForm', :path => '../'
|
||||
target 'XLForm Tests' do
|
||||
pod 'Expecta', '~> 0.3.0'
|
||||
pod 'XLForm', :path => '../'
|
||||
end
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
17538872B9BB29167787CF50 /* libPods-XLForm Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E68572C5C8328F0F177BBCA1 /* libPods-XLForm Tests.a */; };
|
||||
28657A3E1990879200CE8180 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28657A3D1990879200CE8180 /* XCTest.framework */; };
|
||||
28657A401990879200CE8180 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28657A3F1990879200CE8180 /* Foundation.framework */; };
|
||||
28657A421990879200CE8180 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28657A411990879200CE8180 /* UIKit.framework */; };
|
||||
@@ -15,7 +16,6 @@
|
||||
28657A54199154EE00CE8180 /* XLFormValidatorsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 28657A53199154EE00CE8180 /* XLFormValidatorsTests.m */; };
|
||||
3C5B9B7A1AC0BA33000AF1BA /* XLFormExampleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C5B9B791AC0BA33000AF1BA /* XLFormExampleTest.m */; };
|
||||
3C9817861AC30616003F6ABD /* UITextField+Test.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C9817851AC30616003F6ABD /* UITextField+Test.m */; };
|
||||
803CF19E12514D00A5080A99 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC7E8601D7342BFAF4C4060 /* libPods.a */; };
|
||||
BFD111841AD8323900943D23 /* XLTestHideAndShow.m in Sources */ = {isa = PBXBuildFile; fileRef = BFD111831AD8323900943D23 /* XLTestHideAndShow.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
28657A5019914F9700CE8180 /* XLTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XLTestCase.h; path = Test/XLTestCase.h; sourceTree = "<group>"; };
|
||||
28657A5119914F9700CE8180 /* XLTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XLTestCase.m; path = Test/XLTestCase.m; sourceTree = "<group>"; };
|
||||
28657A53199154EE00CE8180 /* XLFormValidatorsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XLFormValidatorsTests.m; path = Test/XLFormValidatorsTests.m; sourceTree = "<group>"; };
|
||||
35038A584FCFD0693D23F189 /* Pods-XLForm Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-XLForm Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-XLForm Tests/Pods-XLForm Tests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
3BE0FA85B15844909EF36AB4 /* Pods-XLForm Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-XLForm Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-XLForm Tests/Pods-XLForm Tests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
3C5B9B791AC0BA33000AF1BA /* XLFormExampleTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XLFormExampleTest.m; path = Test/XLFormExampleTest.m; sourceTree = "<group>"; };
|
||||
3C9817841AC30616003F6ABD /* UITextField+Test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UITextField+Test.h"; path = "Helpers/UITextField+Test.h"; sourceTree = "<group>"; };
|
||||
3C9817851AC30616003F6ABD /* UITextField+Test.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UITextField+Test.m"; path = "Helpers/UITextField+Test.m"; sourceTree = "<group>"; };
|
||||
@@ -37,6 +39,7 @@
|
||||
BFD111831AD8323900943D23 /* XLTestHideAndShow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XLTestHideAndShow.m; path = Test/XLTestHideAndShow.m; sourceTree = "<group>"; };
|
||||
C6B20EA1A9D9591335BEE81F /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
CEC7E8601D7342BFAF4C4060 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E68572C5C8328F0F177BBCA1 /* libPods-XLForm Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-XLForm Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -47,7 +50,7 @@
|
||||
28657A3E1990879200CE8180 /* XCTest.framework in Frameworks */,
|
||||
28657A421990879200CE8180 /* UIKit.framework in Frameworks */,
|
||||
28657A401990879200CE8180 /* Foundation.framework in Frameworks */,
|
||||
803CF19E12514D00A5080A99 /* libPods.a in Frameworks */,
|
||||
17538872B9BB29167787CF50 /* libPods-XLForm Tests.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -79,6 +82,7 @@
|
||||
28657A3F1990879200CE8180 /* Foundation.framework */,
|
||||
28657A411990879200CE8180 /* UIKit.framework */,
|
||||
CEC7E8601D7342BFAF4C4060 /* libPods.a */,
|
||||
E68572C5C8328F0F177BBCA1 /* libPods-XLForm Tests.a */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -129,6 +133,8 @@
|
||||
children = (
|
||||
C6B20EA1A9D9591335BEE81F /* Pods.debug.xcconfig */,
|
||||
8ADC094C94CA7ABBB8134573 /* Pods.release.xcconfig */,
|
||||
35038A584FCFD0693D23F189 /* Pods-XLForm Tests.debug.xcconfig */,
|
||||
3BE0FA85B15844909EF36AB4 /* Pods-XLForm Tests.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
@@ -140,11 +146,12 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 28657A4C1990879200CE8180 /* Build configuration list for PBXNativeTarget "XLForm Tests" */;
|
||||
buildPhases = (
|
||||
6B058765CC1143829C6943B9 /* Check Pods Manifest.lock */,
|
||||
6B058765CC1143829C6943B9 /* 📦 Check Pods Manifest.lock */,
|
||||
28657A361990879200CE8180 /* Sources */,
|
||||
28657A371990879200CE8180 /* Frameworks */,
|
||||
28657A381990879200CE8180 /* Resources */,
|
||||
3E5FCF05A57F40C6AF367F6D /* Copy Pods Resources */,
|
||||
3E5FCF05A57F40C6AF367F6D /* 📦 Copy Pods Resources */,
|
||||
6A2C507B76209618EDA57426 /* 📦 Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -192,29 +199,44 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
3E5FCF05A57F40C6AF367F6D /* Copy Pods Resources */ = {
|
||||
3E5FCF05A57F40C6AF367F6D /* 📦 Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Copy Pods Resources";
|
||||
name = "📦 Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-XLForm Tests/Pods-XLForm Tests-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
6B058765CC1143829C6943B9 /* Check Pods Manifest.lock */ = {
|
||||
6A2C507B76209618EDA57426 /* 📦 Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Check Pods Manifest.lock";
|
||||
name = "📦 Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-XLForm Tests/Pods-XLForm Tests-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
6B058765CC1143829C6943B9 /* 📦 Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "📦 Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -266,7 +288,7 @@
|
||||
};
|
||||
28657A4D1990879200CE8180 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C6B20EA1A9D9591335BEE81F /* Pods.debug.xcconfig */;
|
||||
baseConfigurationReference = 35038A584FCFD0693D23F189 /* Pods-XLForm Tests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
@@ -305,6 +327,7 @@
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "XLForm Tests/XLForm Tests-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
@@ -314,7 +337,7 @@
|
||||
};
|
||||
28657A4E1990879200CE8180 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 8ADC094C94CA7ABBB8134573 /* Pods.release.xcconfig */;
|
||||
baseConfigurationReference = 3BE0FA85B15844909EF36AB4 /* Pods-XLForm Tests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
@@ -347,6 +370,7 @@
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "XLForm Tests/XLForm Tests-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'XLForm'
|
||||
s.version = '3.1.1'
|
||||
s.version = '3.2.0'
|
||||
s.license = { :type => 'MIT' }
|
||||
s.summary = 'XLForm is the most flexible and powerful iOS library to create dynamic table-view forms.'
|
||||
s.description = <<-DESC
|
||||
|
||||
@@ -561,7 +561,7 @@
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 3.0.2;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
|
||||
@@ -46,20 +46,18 @@
|
||||
[super update];
|
||||
BOOL isDisabled = self.rowDescriptor.isDisabled;
|
||||
self.textLabel.text = self.rowDescriptor.title;
|
||||
BOOL notASimpleAction = self.rowDescriptor.action.viewControllerClass || [self.rowDescriptor.action.viewControllerStoryboardId length] != 0 || [self.rowDescriptor.action.viewControllerNibName length] != 0 || [self.rowDescriptor.action.formSegueIdentifier length] != 0 || self.rowDescriptor.action.formSegueClass;
|
||||
self.textLabel.textAlignment = notASimpleAction ? NSTextAlignmentNatural : NSTextAlignmentCenter;
|
||||
self.accessoryType = !notASimpleAction || isDisabled ? UITableViewCellAccessoryNone : UITableViewCellAccessoryDisclosureIndicator;
|
||||
BOOL simpleAction = !(self.rowDescriptor.action.viewControllerClass || [self.rowDescriptor.action.viewControllerStoryboardId length] != 0 || [self.rowDescriptor.action.viewControllerNibName length] != 0 || [self.rowDescriptor.action.formSegueIdentifier length] != 0 || self.rowDescriptor.action.formSegueClass);
|
||||
self.textLabel.textAlignment = !simpleAction ? NSTextAlignmentNatural : NSTextAlignmentCenter;
|
||||
self.accessoryType = simpleAction || isDisabled ? UITableViewCellAccessoryNone : UITableViewCellAccessoryDisclosureIndicator;
|
||||
self.editingAccessoryType = self.accessoryType;
|
||||
self.selectionStyle = isDisabled ? UITableViewCellSelectionStyleNone : UITableViewCellSelectionStyleDefault;
|
||||
|
||||
if (!notASimpleAction){
|
||||
if (simpleAction){
|
||||
CGFloat red, green, blue, alpha;
|
||||
[self.tintColor getRed:&red green:&green blue:&blue alpha:&alpha];
|
||||
self.textLabel.textColor = [UIColor colorWithRed:red green:green blue:blue alpha:(isDisabled ? 0.3 : 1.0)];
|
||||
}
|
||||
else{
|
||||
self.textLabel.textColor = nil;
|
||||
}
|
||||
|
||||
self.detailTextLabel.text = self.rowDescriptor.value;
|
||||
}
|
||||
|
||||
|
||||
@@ -227,9 +227,7 @@
|
||||
- (void)datePickerValueChanged:(UIDatePicker *)sender
|
||||
{
|
||||
self.rowDescriptor.value = sender.date;
|
||||
[self update];
|
||||
[self setNeedsLayout];
|
||||
|
||||
[self.formViewController updateFormRow:self.rowDescriptor];
|
||||
}
|
||||
|
||||
-(void)setFormDatePickerMode:(XLFormDateDatePickerMode)formDatePickerMode
|
||||
|
||||
@@ -90,6 +90,10 @@
|
||||
}]];
|
||||
}
|
||||
|
||||
[alertController addAction:[UIAlertAction actionWithTitle: NSLocalizedString(@"Cancel", nil)
|
||||
style: UIAlertActionStyleCancel
|
||||
handler: nil]];
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
alertController.modalPresentationStyle = UIModalPresentationPopover;
|
||||
alertController.popoverPresentationController.sourceView = self.contentView;
|
||||
|
||||
@@ -176,6 +176,19 @@
|
||||
return option.httpParameterKey;
|
||||
}
|
||||
|
||||
- (id) chooseNewRightValueFromOption:(XLFormLeftRightSelectorOption*)option
|
||||
{
|
||||
switch (option.leftValueChangePolicy) {
|
||||
case XLFormLeftRightSelectorOptionLeftValueChangePolicyChooseLastOption:
|
||||
return [option.rightOptions lastObject];
|
||||
case XLFormLeftRightSelectorOptionLeftValueChangePolicyChooseFirstOption:
|
||||
return [option.rightOptions firstObject];
|
||||
case XLFormLeftRightSelectorOptionLeftValueChangePolicyNullifyRightValue:
|
||||
return nil;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Actions
|
||||
|
||||
@@ -207,7 +220,7 @@
|
||||
[alertController addAction:[UIAlertAction actionWithTitle:[leftOption.leftValue displayText]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction *action) {
|
||||
weakSelf.rowDescriptor.value = nil;
|
||||
weakSelf.rowDescriptor.value = [self chooseNewRightValueFromOption:leftOption];
|
||||
weakSelf.rowDescriptor.leftRightSelectorLeftOptionSelected = [self leftOptionForDescription:[leftOption.leftValue displayText]].leftValue;
|
||||
[weakSelf.formViewController updateFormRow:weakSelf.rowDescriptor];
|
||||
}]];
|
||||
@@ -215,6 +228,7 @@
|
||||
|
||||
[self.formViewController presentViewController:alertController animated:YES completion:nil];
|
||||
}
|
||||
#ifndef XL_APP_EXTENSIONS
|
||||
else{
|
||||
UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:self.rowDescriptor.selectorTitle
|
||||
delegate:self cancelButtonTitle:nil
|
||||
@@ -231,6 +245,7 @@
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000
|
||||
@@ -242,7 +257,7 @@
|
||||
if ([actionSheet cancelButtonIndex] != buttonIndex){
|
||||
NSString * title = [actionSheet buttonTitleAtIndex:buttonIndex];
|
||||
if (![self.rowDescriptor.leftRightSelectorLeftOptionSelected isEqual:[self leftOptionForDescription:title].leftValue]){
|
||||
self.rowDescriptor.value = nil;
|
||||
self.rowDescriptor.value = [self chooseNewRightValueFromOption:[self leftOptionForDescription:title]];
|
||||
self.rowDescriptor.leftRightSelectorLeftOptionSelected = [self leftOptionForDescription:title].leftValue;
|
||||
[self.formViewController updateFormRow:self.rowDescriptor];
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
self.editingAccessoryType = self.accessoryType;
|
||||
self.selectionStyle = self.rowDescriptor.isDisabled || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeInfo] ? UITableViewCellSelectionStyleNone : UITableViewCellSelectionStyleDefault;
|
||||
self.textLabel.text = [NSString stringWithFormat:@"%@%@", self.rowDescriptor.title, self.rowDescriptor.required && self.rowDescriptor.sectionDescriptor.formDescriptor.addAsteriskToRequiredRowsTitle ? @"*" : @""];
|
||||
self.detailTextLabel.text = [self valueDisplayText];
|
||||
self.detailTextLabel.text = [self valueDisplayText];
|
||||
}
|
||||
|
||||
-(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller
|
||||
@@ -166,7 +166,7 @@
|
||||
UIViewController<XLFormRowDescriptorViewController> *selectorViewController = (UIViewController<XLFormRowDescriptorViewController> *)controllerToPresent;
|
||||
selectorViewController.rowDescriptor = self.rowDescriptor;
|
||||
selectorViewController.title = self.rowDescriptor.selectorTitle;
|
||||
|
||||
|
||||
if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorPopover]) {
|
||||
if (self.popoverController && self.popoverController.popoverVisible) {
|
||||
[self.popoverController dismissPopoverAnimated:NO];
|
||||
@@ -192,7 +192,7 @@
|
||||
XLFormOptionsViewController * optionsViewController = [[XLFormOptionsViewController alloc] initWithStyle:UITableViewStyleGrouped titleHeaderSection:nil titleFooterSection:nil];
|
||||
optionsViewController.rowDescriptor = self.rowDescriptor;
|
||||
optionsViewController.title = self.rowDescriptor.selectorTitle;
|
||||
|
||||
|
||||
if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorPopover]) {
|
||||
self.popoverController = [[UIPopoverController alloc] initWithContentViewController:optionsViewController];
|
||||
self.popoverController.delegate = self;
|
||||
@@ -212,10 +212,16 @@
|
||||
else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelector] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelectorPopover])
|
||||
{
|
||||
NSAssert(self.rowDescriptor.selectorOptions, @"selectorOptions property shopuld not be nil");
|
||||
XLFormOptionsViewController * optionsViewController = [[XLFormOptionsViewController alloc] initWithStyle:UITableViewStyleGrouped titleHeaderSection:nil titleFooterSection:nil];
|
||||
UIViewController * controllerToPresent = nil;
|
||||
XLFormOptionsViewController * optionsViewController = nil;
|
||||
if ((controllerToPresent = [self controllerToPresent])){
|
||||
optionsViewController = (XLFormOptionsViewController *)controllerToPresent;
|
||||
} else {
|
||||
optionsViewController = [[XLFormOptionsViewController alloc] initWithStyle:UITableViewStyleGrouped titleHeaderSection:nil titleFooterSection:nil];
|
||||
}
|
||||
optionsViewController.rowDescriptor = self.rowDescriptor;
|
||||
optionsViewController.title = self.rowDescriptor.selectorTitle;
|
||||
|
||||
|
||||
if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelectorPopover]) {
|
||||
self.popoverController = [[UIPopoverController alloc] initWithContentViewController:optionsViewController];
|
||||
self.popoverController.delegate = self;
|
||||
@@ -232,8 +238,8 @@
|
||||
}
|
||||
}
|
||||
else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorActionSheet]){
|
||||
|
||||
|
||||
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 80000
|
||||
UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:self.rowDescriptor.selectorTitle
|
||||
delegate:self
|
||||
@@ -269,6 +275,7 @@
|
||||
}
|
||||
[formViewController presentViewController:alertController animated:YES completion:nil];
|
||||
}
|
||||
#ifndef XL_APP_EXTENSIONS
|
||||
else{
|
||||
UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:self.rowDescriptor.selectorTitle
|
||||
delegate:self
|
||||
@@ -282,6 +289,7 @@
|
||||
actionSheet.tag = [self.rowDescriptor hash];
|
||||
[actionSheet showInView:controller.view];
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
[controller.tableView deselectRowAtIndexPath:[controller.form indexPathOfFormRow:self.rowDescriptor] animated:YES];
|
||||
}
|
||||
@@ -319,6 +327,7 @@
|
||||
[controller presentViewController:alertController animated:YES completion:nil];
|
||||
|
||||
}
|
||||
#ifndef XL_APP_EXTENSIONS
|
||||
else{
|
||||
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:self.rowDescriptor.selectorTitle
|
||||
message:nil
|
||||
@@ -332,6 +341,7 @@
|
||||
alertView.tag = [self.rowDescriptor hash];
|
||||
[alertView show];
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
[controller.tableView deselectRowAtIndexPath:[controller.form indexPathOfFormRow:self.rowDescriptor] animated:YES];
|
||||
}
|
||||
|
||||
@@ -94,12 +94,10 @@ NSString *const XLFormTextFieldLengthPercentage = @"textFieldLengthPercentage";
|
||||
if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeText]){
|
||||
self.textField.autocorrectionType = UITextAutocorrectionTypeDefault;
|
||||
self.textField.autocapitalizationType = UITextAutocapitalizationTypeSentences;
|
||||
self.textField.keyboardType = UIKeyboardTypeDefault;
|
||||
}
|
||||
else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeName]){
|
||||
self.textField.autocorrectionType = UITextAutocorrectionTypeNo;
|
||||
self.textField.autocapitalizationType = UITextAutocapitalizationTypeWords;
|
||||
self.textField.keyboardType = UIKeyboardTypeDefault;
|
||||
}
|
||||
else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeEmail]){
|
||||
self.textField.keyboardType = UIKeyboardTypeEmailAddress;
|
||||
@@ -149,7 +147,7 @@ NSString *const XLFormTextFieldLengthPercentage = @"textFieldLengthPercentage";
|
||||
|
||||
self.textLabel.text = ((self.rowDescriptor.required && self.rowDescriptor.title && self.rowDescriptor.sectionDescriptor.formDescriptor.addAsteriskToRequiredRowsTitle) ? [NSString stringWithFormat:@"%@*", self.rowDescriptor.title] : self.rowDescriptor.title);
|
||||
|
||||
self.textField.text = self.rowDescriptor.value ? [self.rowDescriptor.value displayText] : self.rowDescriptor.noValueDisplayText;
|
||||
self.textField.text = self.rowDescriptor.value ? [self.rowDescriptor displayTextValue] : self.rowDescriptor.noValueDisplayText;
|
||||
[self.textField setEnabled:!self.rowDescriptor.isDisabled];
|
||||
self.textField.textColor = self.rowDescriptor.isDisabled ? [UIColor grayColor] : [UIColor blackColor];
|
||||
self.textField.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
|
||||
@@ -202,8 +200,14 @@ NSString *const XLFormTextFieldLengthPercentage = @"textFieldLengthPercentage";
|
||||
[self.textLabel setContentCompressionResistancePriority:1000 forAxis:UILayoutConstraintAxisHorizontal];
|
||||
|
||||
// Add Constraints
|
||||
[result addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(>=11)-[_textField]-(>=11)-|" options:NSLayoutFormatAlignAllBaseline metrics:nil views:NSDictionaryOfVariableBindings(_textField)]];
|
||||
[result addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(>=11)-[_textLabel]-(>=11)-|" options:NSLayoutFormatAlignAllBaseline metrics:nil views:NSDictionaryOfVariableBindings(_textLabel)]];
|
||||
[result addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(margin)-[_textField]-(margin)-|"
|
||||
options:NSLayoutFormatAlignAllBaseline
|
||||
metrics:[NSDictionary dictionaryWithObjectsAndKeys:@(11.0), @"margin", nil]
|
||||
views:NSDictionaryOfVariableBindings(_textField)]];
|
||||
[result addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(margin)-[_textLabel]-(margin)-|"
|
||||
options:NSLayoutFormatAlignAllBaseline
|
||||
metrics:[NSDictionary dictionaryWithObjectsAndKeys:@(11.0), @"margin", nil]
|
||||
views:NSDictionaryOfVariableBindings(_textLabel)]];
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -213,10 +217,18 @@ NSString *const XLFormTextFieldLengthPercentage = @"textFieldLengthPercentage";
|
||||
if (self.dynamicCustomConstraints){
|
||||
[self.contentView removeConstraints:self.dynamicCustomConstraints];
|
||||
}
|
||||
NSDictionary * views = @{@"label": self.textLabel, @"textField": self.textField, @"image": self.imageView};
|
||||
NSMutableDictionary * views = [[NSMutableDictionary alloc] initWithDictionary: @{@"label": self.textLabel, @"textField": self.textField}];
|
||||
if (self.imageView.image){
|
||||
views[@"image"] = self.imageView;
|
||||
if (self.textLabel.text.length > 0){
|
||||
self.dynamicCustomConstraints = [NSMutableArray arrayWithArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[image]-[label]-[textField]-|" options:0 metrics:nil views:views]];
|
||||
[self.dynamicCustomConstraints addObject:[NSLayoutConstraint constraintWithItem:_textField
|
||||
attribute:NSLayoutAttributeWidth
|
||||
relatedBy:self.textFieldLengthPercentage ? NSLayoutRelationEqual : NSLayoutRelationGreaterThanOrEqual
|
||||
toItem:self.contentView
|
||||
attribute:NSLayoutAttributeWidth
|
||||
multiplier:self.textFieldLengthPercentage ? [self.textFieldLengthPercentage floatValue] : 0.3
|
||||
constant:0.0]];
|
||||
}
|
||||
else{
|
||||
self.dynamicCustomConstraints = [NSMutableArray arrayWithArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[image]-[textField]-|" options:0 metrics:nil views:views]];
|
||||
@@ -225,20 +237,19 @@ NSString *const XLFormTextFieldLengthPercentage = @"textFieldLengthPercentage";
|
||||
else{
|
||||
if (self.textLabel.text.length > 0){
|
||||
self.dynamicCustomConstraints = [NSMutableArray arrayWithArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[label]-[textField]-|" options:0 metrics:nil views:views]];
|
||||
[self.dynamicCustomConstraints addObject:[NSLayoutConstraint constraintWithItem:_textField
|
||||
attribute:NSLayoutAttributeWidth
|
||||
relatedBy:self.textFieldLengthPercentage ? NSLayoutRelationEqual : NSLayoutRelationGreaterThanOrEqual
|
||||
toItem:self.contentView
|
||||
attribute:NSLayoutAttributeWidth
|
||||
multiplier:self.textFieldLengthPercentage ? [self.textFieldLengthPercentage floatValue] : 0.3
|
||||
constant:0.0]];
|
||||
}
|
||||
else{
|
||||
self.dynamicCustomConstraints = [NSMutableArray arrayWithArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[textField]-|" options:0 metrics:nil views:views]];
|
||||
}
|
||||
}
|
||||
|
||||
[self.dynamicCustomConstraints addObject:[NSLayoutConstraint constraintWithItem:_textField
|
||||
attribute:NSLayoutAttributeWidth
|
||||
relatedBy:self.textFieldLengthPercentage ? NSLayoutRelationEqual : NSLayoutRelationGreaterThanOrEqual
|
||||
toItem:self.contentView
|
||||
attribute:NSLayoutAttributeWidth
|
||||
multiplier:self.textFieldLengthPercentage ? [self.textFieldLengthPercentage floatValue] : 0.3
|
||||
constant:0.0]];
|
||||
|
||||
[self.contentView addConstraints:self.dynamicCustomConstraints];
|
||||
[super updateConstraints];
|
||||
}
|
||||
@@ -274,11 +285,22 @@ NSString *const XLFormTextFieldLengthPercentage = @"textFieldLengthPercentage";
|
||||
{
|
||||
[self.formViewController beginEditing:self.rowDescriptor];
|
||||
[self.formViewController textFieldDidBeginEditing:textField];
|
||||
// set the input to the raw value if we have a formatter and it shouldn't be used during input
|
||||
if (self.rowDescriptor.valueFormatter) {
|
||||
self.textField.text = [self.rowDescriptor editTextValue];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)textFieldDidEndEditing:(UITextField *)textField
|
||||
{
|
||||
// process text change before we stick a formatted value in the UITextField
|
||||
[self textFieldDidChange:textField];
|
||||
|
||||
// losing input, replace the text field with the formatted value
|
||||
if (self.rowDescriptor.valueFormatter) {
|
||||
self.textField.text = [self.rowDescriptor.value displayText];
|
||||
}
|
||||
|
||||
[self.formViewController endEditing:self.rowDescriptor];
|
||||
[self.formViewController textFieldDidEndEditing:textField];
|
||||
}
|
||||
@@ -288,12 +310,33 @@ NSString *const XLFormTextFieldLengthPercentage = @"textFieldLengthPercentage";
|
||||
|
||||
- (void)textFieldDidChange:(UITextField *)textField{
|
||||
if([self.textField.text length] > 0) {
|
||||
if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeNumber] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDecimal]){
|
||||
self.rowDescriptor.value = @([self.textField.text doubleValue]);
|
||||
} else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeInteger]){
|
||||
self.rowDescriptor.value = @([self.textField.text integerValue]);
|
||||
} else {
|
||||
self.rowDescriptor.value = self.textField.text;
|
||||
BOOL didUseFormatter = NO;
|
||||
|
||||
if (self.rowDescriptor.valueFormatter && self.rowDescriptor.useValueFormatterDuringInput)
|
||||
{
|
||||
// use generic getObjectValue:forString:errorDescription and stringForObjectValue
|
||||
NSString *errorDescription = nil;
|
||||
NSString *objectValue = nil;
|
||||
|
||||
if ([ self.rowDescriptor.valueFormatter getObjectValue:&objectValue forString:textField.text errorDescription:&errorDescription]) {
|
||||
NSString *formattedValue = [self.rowDescriptor.valueFormatter stringForObjectValue:objectValue];
|
||||
|
||||
self.rowDescriptor.value = objectValue;
|
||||
textField.text = formattedValue;
|
||||
didUseFormatter = YES;
|
||||
}
|
||||
}
|
||||
|
||||
// only do this conversion if we didn't use the formatter
|
||||
if (!didUseFormatter)
|
||||
{
|
||||
if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeNumber] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDecimal]){
|
||||
self.rowDescriptor.value = [NSDecimalNumber decimalNumberWithString: self.textField.text];
|
||||
} else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeInteger]){
|
||||
self.rowDescriptor.value = @([self.textField.text integerValue]);
|
||||
} else {
|
||||
self.rowDescriptor.value = self.textField.text;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
self.rowDescriptor.value = nil;
|
||||
@@ -311,4 +354,5 @@ NSString *const XLFormTextFieldLengthPercentage = @"textFieldLengthPercentage";
|
||||
return _returnKeyType;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -206,4 +206,8 @@ NSString *const XLFormTextViewLengthPercentage = @"textViewLengthPercentage";
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
|
||||
return [self.formViewController textView:textView shouldChangeTextInRange:range replacementText:text];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -83,8 +83,10 @@ typedef NS_ENUM(NSUInteger, XLFormRowNavigationDirection) {
|
||||
@property XLFormDescriptor * form;
|
||||
@property IBOutlet UITableView * tableView;
|
||||
|
||||
-(id)initWithForm:(XLFormDescriptor *)form;
|
||||
-(id)initWithForm:(XLFormDescriptor *)form style:(UITableViewStyle)style;
|
||||
-(instancetype)initWithForm:(XLFormDescriptor *)form;
|
||||
-(instancetype)initWithForm:(XLFormDescriptor *)form style:(UITableViewStyle)style;
|
||||
-(instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;
|
||||
-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil NS_DESIGNATED_INITIALIZER;
|
||||
+(NSMutableDictionary *)cellClassesForRowDescriptorTypes;
|
||||
+(NSMutableDictionary *)inlineRowDescriptorTypesForRowDescriptorTypes;
|
||||
|
||||
|
||||
@@ -83,30 +83,27 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self){
|
||||
[self defaultInitialize];
|
||||
_form = nil;
|
||||
_tableViewStyle = UITableViewStyleGrouped;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id)initWithCoder:(NSCoder *)aDecoder
|
||||
-(instancetype)initWithCoder:(NSCoder *)aDecoder
|
||||
{
|
||||
self = [super initWithCoder:aDecoder];
|
||||
if (self){
|
||||
[self defaultInitialize];
|
||||
if (self) {
|
||||
_form = nil;
|
||||
_tableViewStyle = UITableViewStyleGrouped;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)defaultInitialize
|
||||
{
|
||||
_form = nil;
|
||||
_tableViewStyle = UITableViewStyleGrouped;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
self.tableView.delegate = nil;
|
||||
@@ -482,6 +479,7 @@
|
||||
handler:nil]];
|
||||
[self presentViewController:alertController animated:YES completion:nil];
|
||||
}
|
||||
#ifndef XL_APP_EXTENSIONS
|
||||
else{
|
||||
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"XLFormViewController_ValidationErrorTitle", nil)
|
||||
message:error.localizedDescription
|
||||
@@ -491,6 +489,7 @@
|
||||
[alertView show];
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
-(void)performFormSelector:(SEL)selector withObject:(id)sender
|
||||
@@ -615,15 +614,10 @@
|
||||
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
XLFormRowDescriptor * rowDescriptor = [self.form formRowAtIndex:indexPath];
|
||||
return [rowDescriptor cellForFormController:self];
|
||||
}
|
||||
|
||||
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
XLFormRowDescriptor * rowDescriptor = [self.form formRowAtIndex:indexPath];
|
||||
[self updateFormRow:rowDescriptor];
|
||||
return [rowDescriptor cellForFormController:self];
|
||||
}
|
||||
|
||||
|
||||
@@ -730,9 +724,10 @@
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
XLFormRowDescriptor *rowDescriptor = [self.form formRowAtIndex:indexPath];
|
||||
Class cellClass = [[rowDescriptor cellForFormController:self] class];
|
||||
if ([cellClass respondsToSelector:@selector(formDescriptorCellHeightForRowDescriptor:)]){
|
||||
return [cellClass formDescriptorCellHeightForRowDescriptor:rowDescriptor];
|
||||
[rowDescriptor cellForFormController:self];
|
||||
CGFloat height = rowDescriptor.height;
|
||||
if (height != XLFormUnspecifiedCellHeight){
|
||||
return height;
|
||||
}
|
||||
return self.tableView.rowHeight;
|
||||
}
|
||||
@@ -740,9 +735,10 @@
|
||||
-(CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
XLFormRowDescriptor *rowDescriptor = [self.form formRowAtIndex:indexPath];
|
||||
Class cellClass = [[rowDescriptor cellForFormController:self] class];
|
||||
if ([cellClass respondsToSelector:@selector(formDescriptorCellHeightForRowDescriptor:)]){
|
||||
return [cellClass formDescriptorCellHeightForRowDescriptor:rowDescriptor];
|
||||
[rowDescriptor cellForFormController:self];
|
||||
CGFloat height = rowDescriptor.height;
|
||||
if (height != XLFormUnspecifiedCellHeight){
|
||||
return height;
|
||||
}
|
||||
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")){
|
||||
return self.tableView.estimatedRowHeight;
|
||||
@@ -908,6 +904,10 @@
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark - UIScrollViewDelegate
|
||||
|
||||
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#import "XLFormValidatorProtocol.h"
|
||||
#import "XLFormValidationStatus.h"
|
||||
|
||||
extern CGFloat XLFormUnspecifiedCellHeight;
|
||||
|
||||
@class XLFormViewController;
|
||||
@class XLFormSectionDescriptor;
|
||||
@protocol XLFormValidatorProtocol;
|
||||
@@ -52,8 +54,17 @@ typedef void(^XLOnChangeBlock)(id __nullable oldValue,id __nullable newValue,XLF
|
||||
@property (nonatomic, nullable) id value;
|
||||
@property (nullable) Class valueTransformer;
|
||||
@property UITableViewCellStyle cellStyle;
|
||||
@property (nonatomic) CGFloat height;
|
||||
|
||||
@property (copy, nullable) XLOnChangeBlock onChangeBlock;
|
||||
@property BOOL useValueFormatterDuringInput;
|
||||
@property (nullable) NSFormatter *valueFormatter;
|
||||
|
||||
// returns the display text for the row descriptor, taking into account NSFormatters and default placeholder values
|
||||
- (nonnull NSString *) displayTextValue;
|
||||
|
||||
// returns the editing text value for the row descriptor, taking into account NSFormatters.
|
||||
- (nonnull NSString *) editTextValue;
|
||||
|
||||
@property (nonatomic, readonly, nonnull) NSMutableDictionary * cellConfig;
|
||||
@property (nonatomic, readonly, nonnull) NSMutableDictionary * cellConfigIfDisabled;
|
||||
@@ -78,7 +89,7 @@ typedef void(^XLOnChangeBlock)(id __nullable oldValue,id __nullable newValue,XLF
|
||||
@property (nullable) NSString *requireMsg;
|
||||
-(void)addValidator:(nonnull id<XLFormValidatorProtocol>)validator;
|
||||
-(void)removeValidator:(nonnull id<XLFormValidatorProtocol>)validator;
|
||||
-(nonnull XLFormValidationStatus *)doValidation;
|
||||
-(nullable XLFormValidationStatus *)doValidation;
|
||||
|
||||
// ===========================
|
||||
// property used for Selectors
|
||||
@@ -100,12 +111,20 @@ typedef void(^XLOnChangeBlock)(id __nullable oldValue,id __nullable newValue,XLF
|
||||
|
||||
@end
|
||||
|
||||
typedef NS_ENUM(NSUInteger, XLFormLeftRightSelectorOptionLeftValueChangePolicy)
|
||||
{
|
||||
XLFormLeftRightSelectorOptionLeftValueChangePolicyNullifyRightValue = 0,
|
||||
XLFormLeftRightSelectorOptionLeftValueChangePolicyChooseFirstOption,
|
||||
XLFormLeftRightSelectorOptionLeftValueChangePolicyChooseLastOption
|
||||
};
|
||||
|
||||
|
||||
// =====================================
|
||||
// helper object used for LEFTRIGHTSelector Descriptor
|
||||
// =====================================
|
||||
@interface XLFormLeftRightSelectorOption : NSObject
|
||||
|
||||
@property (nonatomic, assign) XLFormLeftRightSelectorOptionLeftValueChangePolicy leftValueChangePolicy;
|
||||
@property (readonly, nonnull) id leftValue;
|
||||
@property (readonly, nonnull) NSArray * rightOptions;
|
||||
@property (readonly, null_unspecified) NSString * httpParameterKey;
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
#import "XLFormRowDescriptor.h"
|
||||
#import "NSString+XLFormAdditions.h"
|
||||
|
||||
CGFloat XLFormUnspecifiedCellHeight = -1.0;
|
||||
CGFloat XLFormRowInitialHeight = -2;
|
||||
|
||||
@interface XLFormDescriptor (_XLFormRowDescriptor)
|
||||
|
||||
@property (readonly) NSDictionary* allRowsByTag;
|
||||
@@ -44,6 +47,8 @@
|
||||
|
||||
@end
|
||||
|
||||
#import "NSObject+XLFormAdditions.h"
|
||||
|
||||
@interface XLFormRowDescriptor() <NSCopying>
|
||||
|
||||
@property XLFormBaseCell * cell;
|
||||
@@ -66,6 +71,7 @@
|
||||
@synthesize cellConfig = _cellConfig;
|
||||
@synthesize cellConfigIfDisabled = _cellConfigIfDisabled;
|
||||
@synthesize cellConfigAtConfigure = _cellConfigAtConfigure;
|
||||
@synthesize height = _height;
|
||||
|
||||
-(instancetype)init
|
||||
{
|
||||
@@ -91,6 +97,7 @@
|
||||
_disablePredicateCache = nil;
|
||||
_isDirtyHidePredicateCache = YES;
|
||||
_hidePredicateCache = nil;
|
||||
_height = XLFormRowInitialHeight;
|
||||
[self addObserver:self forKeyPath:@"value" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:0];
|
||||
[self addObserver:self forKeyPath:@"disablePredicateCache" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:0];
|
||||
[self addObserver:self forKeyPath:@"hidePredicateCache" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:0];
|
||||
@@ -172,6 +179,41 @@
|
||||
return _cellConfigAtConfigure;
|
||||
}
|
||||
|
||||
-(NSString*)editTextValue
|
||||
{
|
||||
if (self.value) {
|
||||
if (self.valueFormatter) {
|
||||
if (self.useValueFormatterDuringInput) {
|
||||
return [self displayTextValue];
|
||||
}else{
|
||||
// have formatter, but we don't want to use it during editing
|
||||
return [self.value displayText];
|
||||
}
|
||||
}else{
|
||||
// have value, but no formatter, use the value's displayText
|
||||
return [self.value displayText];
|
||||
}
|
||||
}else{
|
||||
// placeholder
|
||||
return @"";
|
||||
}
|
||||
}
|
||||
|
||||
-(NSString*)displayTextValue
|
||||
{
|
||||
if (self.value) {
|
||||
if (self.valueFormatter) {
|
||||
return [self.valueFormatter stringForObjectValue:self.value];
|
||||
}
|
||||
else{
|
||||
return [self.value displayText];
|
||||
}
|
||||
}
|
||||
else {
|
||||
return self.noValueDisplayText;
|
||||
}
|
||||
}
|
||||
|
||||
-(NSString *)description
|
||||
{
|
||||
return self.tag; // [NSString stringWithFormat:@"%@ - %@ (%@)", [super description], self.tag, self.rowType];
|
||||
@@ -190,6 +232,22 @@
|
||||
_action = action;
|
||||
}
|
||||
|
||||
-(CGFloat)height
|
||||
{
|
||||
if (_height == XLFormRowInitialHeight){
|
||||
if ([[self.cell class] respondsToSelector:@selector(formDescriptorCellHeightForRowDescriptor:)]){
|
||||
return [[self.cell class] formDescriptorCellHeightForRowDescriptor:self];
|
||||
} else {
|
||||
_height = XLFormUnspecifiedCellHeight;
|
||||
}
|
||||
}
|
||||
return _height;
|
||||
}
|
||||
|
||||
-(void)setHeight:(CGFloat)height {
|
||||
_height = height;
|
||||
}
|
||||
|
||||
// In the implementation
|
||||
-(id)copyWithZone:(NSZone *)zone
|
||||
{
|
||||
@@ -203,6 +261,7 @@
|
||||
rowDescriptorCopy.required = self.isRequired;
|
||||
rowDescriptorCopy.isDirtyDisablePredicateCache = YES;
|
||||
rowDescriptorCopy.isDirtyHidePredicateCache = YES;
|
||||
rowDescriptorCopy.validators = [self.validators mutableCopy];
|
||||
|
||||
// =====================
|
||||
// properties for Button
|
||||
@@ -426,7 +485,8 @@
|
||||
|
||||
- (BOOL)valueIsEmpty
|
||||
{
|
||||
return self.value == nil || [self.value isKindOfClass:[NSNull class]] || ([self.value respondsToSelector:@selector(length)] && [self.value length]==0);
|
||||
return self.value == nil || [self.value isKindOfClass:[NSNull class]] || ([self.value respondsToSelector:@selector(length)] && [self.value length]==0) ||
|
||||
([self.value respondsToSelector:@selector(count)] && [self.value count]==0);
|
||||
}
|
||||
|
||||
-(XLFormValidationStatus *)doValidation
|
||||
|
||||
@@ -31,12 +31,12 @@
|
||||
|
||||
-(NSString *)displayText
|
||||
{
|
||||
if ([self isKindOfClass:[NSString class]] || [self isKindOfClass:[NSNumber class]]){
|
||||
return [self description];
|
||||
}
|
||||
if ([self conformsToProtocol:@protocol(XLFormOptionObject)]){
|
||||
return [(id<XLFormOptionObject>)self formDisplayText];
|
||||
}
|
||||
if ([self isKindOfClass:[NSString class]] || [self isKindOfClass:[NSNumber class]]){
|
||||
return [self description];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user