Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c32e28f753 | |||
| 2b55aeac74 | |||
| 94959f9da8 | |||
| 25798bb123 | |||
| d6d14140cf | |||
| c036d7a06b | |||
| 542191ba69 | |||
| c1b64f7828 | |||
| 8009dd8cb7 | |||
| 8d65cbe361 | |||
| 79eb596143 | |||
| 0e866a0f22 | |||
| d68166c669 | |||
| 72115e32ea | |||
| 5475ed7ed7 | |||
| 8bdeb264c1 | |||
| 437c1e4d38 | |||
| 972815d7ea | |||
| eeb165b1cc | |||
| 47dfa518c4 | |||
| bb9aceff75 | |||
| 7ae1a5d612 | |||
| 0db6e546c5 | |||
| 1229cb8d6a |
+126
@@ -0,0 +1,126 @@
|
||||
# Change Log
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
### Latest:
|
||||
* 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
|
||||
@@ -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];
|
||||
|
||||
@@ -804,7 +804,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.cellConfigAtConfigure setObject:[UIColor redColor] forKey:@"textLabel.textColor"];
|
||||
[section addFormRow:row];
|
||||
```
|
||||
|
||||
@@ -1048,124 +1048,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/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;
|
||||
|
||||
@@ -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];
|
||||
}]];
|
||||
@@ -242,7 +255,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];
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
@@ -615,15 +612,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];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -100,12 +100,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;
|
||||
|
||||
@@ -203,6 +203,7 @@
|
||||
rowDescriptorCopy.required = self.isRequired;
|
||||
rowDescriptorCopy.isDirtyDisablePredicateCache = YES;
|
||||
rowDescriptorCopy.isDirtyHidePredicateCache = YES;
|
||||
rowDescriptorCopy.validators = [self.validators copy];
|
||||
|
||||
// =====================
|
||||
// properties for Button
|
||||
|
||||
Reference in New Issue
Block a user