395 Commits

Author SHA1 Message Date
Roman Podymov ceca40bb06 Nullability (#1091) 2023-06-29 10:17:03 -03:00
Martin Barreto 8335af6d83 Update README.md 2023-03-17 18:07:43 -03:00
Martin Barreto 6cf22d3cf2 Add files via upload 2023-03-17 18:05:55 -03:00
Enrique Galindo cd5d983b1a Create FUNDING.yml 2022-09-01 13:10:11 -03:00
Mathias Claassen 870afc5660 Version bump 4.3.0 (#1080) 2021-03-24 10:27:47 -03:00
Nick Reffitt ded97b8328 Add datePicker style property to XLFormDateCell (#1078)
Co-authored-by: Nick <nick@nicks-air.mynet>
2020-11-18 10:00:10 -03:00
Mathias Claassen 74bde2185b Fix Cocoapods source (#1077) 2020-10-12 09:22:50 -03:00
Mathias Claassen d299fe32cb Version bump 4.2.0 (#1076) 2020-10-09 10:59:04 -03:00
Kyle Hankinson 234a135f08 Fixes Carthage to master branch (#1075)
* + Fix for simulator issue/carthage build issue.

* + Headers public.

Co-authored-by: Kyle Hankinson <kyle.hankinson@gmail.com>
2020-10-09 09:13:04 -03:00
Eneko Alonso 0e5da84980 Add support for distribution via Swift Package Manager (SwiftPM) (#1073)
* Add Package.swift for distribution via SwiftPM

* Update publicHeadersPath

* Remove publicHeadersPath

* Flattened file structure

* Update project references

* Clean up

* Update README with instructions for installing via SwiftPM

* Fix typo

Co-authored-by: Mathias Claassen <mathiasclaassen7@gmail.com>

Co-authored-by: Mathias Claassen <mathiasclaassen7@gmail.com>
2020-09-23 09:31:38 -03:00
Mathias Claassen 3dd39ed7bc Version bump 4.1.0 (#1060) 2019-10-02 09:52:47 -03:00
Quintz Gábor 45d363fb0c iOS 13 dark mode support. (#1057) 2019-09-23 10:49:46 -03:00
Mathias Claassen 21f97ce9a6 Swift 5 updates in Examples and change Travis to use Xcode 11 (#1058) 2019-09-20 10:23:58 -03:00
mrcararia f2383b7903 Fix crash when .Nib is inside a framework bundle. (#1050) 2019-05-14 12:00:33 -03:00
Mathias Claassen 6ac31155f8 release 4.0.1 (#1049) 2019-04-15 11:07:06 -03:00
Liraz S 151003d8e5 Memory and stability fixes to XLForm (#1045)
* selectorCell display repair

Unable to display when value than apples first selectorOptions

* fixed crash

* fixed memory leaks

* Cell disappears while inline picker is open

* Fixes crash on update

* check object object equal

* codereview

* fixed memory leaks

* fixed memory leaks [2]

* updated logic

* fixed memory leaks

* fix for crash #1043

* fix for crash #1044

* fix for issue #1044

* fix for issue #1044

* fixed mistake

* fixed observation if lib uses in drawer controller

* fixed kvo crash

* reverted last fix

* cleanup

* fixed kvo

* fix for crash #1043

* reverted https://github.com/xmartlabs/XLForm/pull/1045#discussion_r255965033

* reverted #948

* fixed firstResponder logic

* codereview in Descriptors

* codereview
2019-03-25 12:20:16 -03:00
Mathias Claassen b5bdda8e80 Update Readme (#1046) 2019-03-14 13:40:30 -03:00
Bruno Agatte 81aca9c49c Update XLFormRowDescriptor.m to support <Class>.self for custom cells (#1041) 2019-01-08 10:59:18 -03:00
Ju d8ece1410d Fix crash when using swift custom cells with xib files (#1038) (#1040) 2019-01-07 15:57:31 -03:00
Nikita Razumnuy fdca5f7543 fix: can't update placeholder color using setNeedsDisplay in XLFormTextView (#1024) 2018-08-23 11:20:17 -03:00
Martin Barreto 204cad6045 update swift example 2017-10-26 14:36:33 -03:00
Martin Barreto e68b57cded update XLForm tests 2017-10-26 14:36:33 -03:00
Martin Barreto 0bc600d5a7 fix travis 2017-10-26 14:36:33 -03:00
pera c2d721f098 minor fixes 2017-10-26 14:36:33 -03:00
pera 2485332846 Updates README.md, CHANGELOG.md & podspec. 2017-10-26 14:36:33 -03:00
pera 20b661c41e - Adds support for Xcode9
- Deprecation of UIAlertView, UIActionSheet & UIPopoverController
2017-10-26 14:36:33 -03:00
MiMo42 1e2b5137d6 Fixed crash when trying to insert row in section at index 0 (#964) 2017-06-08 11:47:26 -03:00
Miguel Revetria 43abac5c3f Fixes #893, setting rowDescriptor to the serach result controller (#961) 2017-05-25 10:20:36 -03:00
MiMo42 77db6b9492 nullability warning fixed (#952) 2017-04-26 10:21:35 -03:00
Mathias Claassen 74b26c1e64 make properties of XLFormOptionsObject writable (#955) 2017-04-25 11:55:54 -03:00
Mathias Claassen 085cf31e52 Updated Readme Eureka introduction (#954) 2017-04-25 10:48:47 -03:00
FatalDizz 313e5d5d40 Added method to set a title for form errors (#951) 2017-04-19 11:46:34 -03:00
Mathias Claassen f7777d9d27 Add Header and Footer section to Readme FAQ (#942) 2017-04-05 09:46:52 -03:00
Mathias Claassen 578dea99dd Use the correct locale in date row (not only date picker) (#935) 2017-04-05 09:23:41 -03:00
Santiago Castro 1da30107dc Fix README headings due to GitHub change (#937)
GitHub changed its Markdown processor to stop supporting heading without spaces https://gist.github.com/vmarkovtsev/59cd7349d41cf804b9a8775388e681f8
2017-03-21 09:18:22 -03:00
Mathias Claassen 4674c3abaf Make moveRowAtIndexPath:toIndexPath: public in XLFormSectionDescriptor to allow to reorder rows programmatically. (#929) 2017-02-22 12:58:47 -03:00
Felix Dumit 5ca54fd949 Fix use of formatter in Info Cells (#916)
Adds example with infocell and bytecount formatter
2017-01-16 18:15:42 -03:00
Mathias Claassen e64e5b4885 update Travis file to use Xcode 8.2 (#920) 2017-01-12 10:24:37 -03:00
Mathias Claassen b28c902d73 release version 3.3.0 2016-11-17 11:10:10 -03:00
Mathias Claassen dc5f1e6dcd Merge pull request #895 from dvkch/master
Fix for #884
2016-11-03 11:33:16 -03:00
Stanislas Chevallier 55e440bc57 Fix: #884 by setting the UIDatePicker timeZone to GMT+0 when in countdown mode 2016-11-02 13:42:51 +01:00
Martin Barreto be2fb864be Update README.md 2016-10-21 18:14:17 -03:00
Mathias Claassen cdd498ebc7 Merge pull request #866 from xmartlabs/Swift3
Update Swift example to Swift 3 syntax
2016-10-20 14:46:21 -03:00
Mathias Claassen cd43abc3f0 Merge pull request #882 from kiancheong/OptionsRow-Deselect
OptionsRow-Deselect
2016-10-18 16:06:49 -03:00
kiancheong f1a83512d1 Prevents setting cell's accessoryType to UITableViewCellAccessoryNone if the rowDescriptor's required value is true.
This fixes the ability to deselect options when using XLFormRowDescriptorTypeSelectorPush.
2016-10-14 09:08:25 +08:00
Mathias Claassen 00ccf60895 Merge pull request #883 from kiancheong/bigsprocket-styling
bigsprocket-styling
2016-10-13 10:57:39 -03:00
kiancheong 27a172eb65 Synthesize cellConfigForSelector. 2016-10-11 19:31:45 +08:00
Kyle Davis e62404d24b remove unnecessary nil check 2016-10-11 12:57:16 +08:00
Kyle Davis d1aff91e63 Support styling of XLFormOptionViewController cells 2016-10-11 12:57:14 +08:00
Mathias Claassen a0a8cf793c Update Swift example to Swift 3 syntax 2016-09-15 13:33:38 -03:00
Mathias Claassen bb81e88572 Merge pull request #864 from choefele/master
Limit number of characters in XLFormTextFieldCell and XLFormTextViewCell
2016-09-07 10:31:50 -03:00
Claus Höfele 64ab7ccac0 Add property in XLFormTextViewCell to limit number of characters 2016-09-05 20:37:57 +02:00
Claus Höfele 9baeda1b0d Add property in XLFormTextFieldCell to limit number of characters
Implements #855
2016-09-05 18:52:23 +02:00
Mathias Claassen 6879f01230 Merge pull request #832 from xmartlabs/fix/constant
change XLFormUnspecifiedHeight constant to not collide with Automatic…
2016-07-22 11:34:30 -03:00
Mathias Claassen 50e9efe783 change XLFormUnspecifiedHeight constant to not collide with Automatic dimension 2016-07-22 11:34:01 -03:00
Mathias Claassen bf819ba0ed Merge pull request #831 from ablexie/master
Add locale property to date cell for inline cells
2016-07-22 11:26:50 -03:00
ablexie 087bbf089c datePicker.locale property public to developer,for example,
_birthdayRow = [XLFormRowDescriptor formRowDescriptorWithTag:kBirthdayTag rowType:XLFormRowDescriptorTypeDateInline title:@"Birthday"];
[_birthdayRow.cellConfig setObject:[[NSLocale alloc] initWithLocaleIdentifier:@"en"] forKey:@"locale"];
2016-07-21 10:29:17 +08:00
Mathias Claassen eac2f816d7 Merge pull request #819 from 3a4oT/master
Refactored '-(id)init..' to '- (instancetype)init...'
2016-07-07 11:23:43 -03:00
Mathias Claassen b19bf9bafc Merge pull request #817 from 3a4oT/patch-2
Update 'initializeForm' example.
2016-07-07 11:18:00 -03:00
Petro Rovenskyy ce869235bc Refactored '-(id)init' to '- (instancetype)init' 2016-07-04 21:50:17 +03:00
Petro Rovenskyy bb93c90c2d Update 'initializeForm' example.
Copy and paste the example of  ```initializeForm``` and feel the power of XLForm immediately. =)
2016-07-01 15:47:22 +03:00
Mathias Claassen 7b50e19cf6 Merge pull request #814 from 3a4oT/patch-1
Update pod badge
2016-06-30 10:12:56 -03:00
Petro Rovenskyy 8eefa8afd9 Update pod badge 2016-06-30 15:27:48 +03:00
Mathias Claassen ca53315145 Merge pull request #810 from jeanmartin/master
[fixes #452] respect the currentLocale when parsing decimal values
2016-06-28 09:44:14 -03:00
Jan Schwenzien c3263f7645 [fixes #452] respect the currentLocale when parsing decimal values 2016-06-27 22:04:51 +02:00
Mathias Claassen fbf800fc21 Merge pull request #806 from jimmyti/master
Fixed selector action sheet to use the row's value transformer
2016-06-24 09:54:33 -03:00
Jimmy Ti fbc08a7094 Remove the fix for suppressing "Empty snapshot" warnings when presenting action sheets 2016-06-23 23:10:57 +10:00
Jimmy Ti f1f8a21bf0 Updated code to actually use the optionTitle variable 2016-06-21 00:18:33 +10:00
Jimmy Ti 694c08beee Fixed selector action sheet to use the row's value transformer 2016-06-20 21:19:20 +10:00
Mathias Claassen c7d5708f16 update pod version 2016-06-16 10:34:54 -03:00
Mathias Claassen dd294cc709 Merge pull request #804 from xmartlabs/fix/multiEmpty
added count to empty check. Helpful to validate multiple selectors be…
2016-06-13 17:24:08 -03:00
Mathias Claassen cda0327def added count to empty check. Helpful to validate multiple selectors being empty 2016-06-13 17:23:44 -03:00
Mathias Claassen 9a2bdf1ca0 Merge pull request #797 from xmartlabs/fix/decimals
Fix decimal number formatting. closes #514
2016-06-02 13:46:49 -03:00
Mathias Claassen d8b67b5c21 Fix decimal number formatting. closes #514 2016-06-02 13:46:25 -03:00
Mathias Claassen f30fa9bb31 Merge pull request #796 from xmartlabs/feature/cellHeight
Added height property to XLFormRowDescriptor
2016-06-02 12:52:47 -03:00
Mathias Claassen 9b1e7d6d4e Added height property to XLFormRowDescriptor 2016-06-02 12:41:12 -03:00
Mathias Claassen fac9cefc2b Merge pull request #652 from droidlabs/custom-multiselect
Row with multiple selector should support custom controller
2016-06-02 11:14:23 -03:00
Mathias Claassen d202a40824 Merge pull request #794 from xmartlabs/readmeUpdate
updated readme with some comments. Fixes #771, fixes #727, fixes #696
2016-06-01 15:16:15 -03:00
Mathias Claassen d185e642e0 updated readme with some comments. Fixes #771, fixes #727, fixes #696 2016-06-01 15:15:35 -03:00
Mathias Claassen 743c5d289a Merge pull request #695 from realestate-com-au/hotfix/code-sign
Changed Release config to use iPhone Distribution code sign identity
2016-06-01 14:20:54 -03:00
Mathias Claassen de86c5e60e Merge pull request #306 from ziogaschr/add-support-NSFormatter
Add support for NSFormatter.
 closes #77 , closes #195 , closes #176 closes #64
2016-05-31 12:15:00 -03:00
Chris Ziogas f52c532fec Add support for NSFormatter 2016-05-31 17:57:18 +03:00
Mathias Claassen 274892dc95 Merge pull request #792 from xmartlabs/fix/validation
Do validation can be nullable. fixes #705
2016-05-31 11:54:29 -03:00
Mathias Claassen 09b28286de Do validation can be nullable. fixes #705 2016-05-31 11:54:06 -03:00
Mathias Claassen bbca57a2e6 Merge pull request #456 from conradwt/master
Update project README
2016-05-31 11:34:35 -03:00
Mathias Claassen d29275b780 Merge pull request #523 from MuscleRumble/appextensions
Fixed #357 by adding XL_APP_EXTENSIONS macro so that XLForm can be used in App Extensions
2016-05-31 11:30:01 -03:00
Mathias Claassen 11f54cee17 Merge pull request #686 from alejandrogarin/numberFormatter
Controlling formatting output when the rowType is XLFormRowDescriptorTypeNumber or XLFormRowDescriptorTypeDecimal
2016-05-31 11:16:24 -03:00
Mathias Claassen 418b3e4c96 Merge pull request #782 from kiancheong/UITextView-ShouldChange-Delegate
Added shouldChangeTextInRange delegate call for UITextView.
2016-05-31 11:03:13 -03:00
Mathias Claassen 6da2fc456c Merge pull request #791 from xmartlabs/fix/value2CellStyle
fix crash when using cell style Value2. closes #770
2016-05-30 17:25:09 -03:00
Mathias Claassen 52be3f3531 fix crash when using cell style Value2. closes #770 2016-05-30 17:14:13 -03:00
Mathias Claassen 5e00deb474 Merge pull request #790 from xmartlabs/fix/textFieldPercentage
Fix when the textFieldPercentage is applied. Closes #776
2016-05-30 16:46:37 -03:00
Mathias Claassen 2a8ebf2af5 Fix when the textFieldPercentage is applied. Closes #776 2016-05-30 16:46:09 -03:00
Mathias Claassen 5c716a665d Merge pull request #789 from mbjacks/master
fix crash when adding a validator to a copied row descriptor
2016-05-30 16:21:51 -03:00
Matt Jackson 60e67b9651 fix crash when adding a validator to a copied row descriptor 2016-05-27 14:20:56 -07:00
Mathias Claassen 6aac513398 Merge pull request #753 from jpmhouston/example-podfile
updated example podfile for cocoapods 1.0 compatibility
2016-05-24 16:58:11 -03:00
Mathias Claassen 0491752090 update pod spec for new release 2016-05-24 16:56:15 -03:00
Mathias Claassen c32e28f753 Merge pull request #785 from xmartlabs/fix/buttonDisabled
fix button cell disabled state.
2016-05-24 16:45:37 -03:00
Mathias Claassen 2b55aeac74 Merge pull request #786 from xmartlabs/fix/updateRow
Update row in `cellForRowAtIndexPath` instead of `willDisplayCell`.
2016-05-24 16:37:25 -03:00
Mathias Claassen 94959f9da8 Merge pull request #788 from xmartlabs/fix/TestPods
fixed tests pod spec
2016-05-24 16:23:36 -03:00
Mathias Claassen 25798bb123 fixed tests pod spec 2016-05-24 16:23:15 -03:00
Mathias Claassen d6d14140cf Update row in cellForRowAtIndexPath instead of willDisplayCell.
Add Changelog
2016-05-23 13:09:54 -03:00
Mathias Claassen c036d7a06b fix button cell disabled state. closes #780 2016-05-23 12:40:07 -03:00
kiancheong 51760a535a Added shouldChangeTextInRange delegate call for UITextView. 2016-05-11 11:13:17 +08:00
Mathias Claassen 542191ba69 Merge pull request #779 from xmartlabs/fix/designatedInitializers
fixed designated initialiser setting back to nib name and coder
2016-05-06 09:31:42 -03:00
Mathias Claassen c1b64f7828 fixed designated initialiser setting back to nib name and coder 2016-05-06 09:31:01 -03:00
Mathias Claassen 8009dd8cb7 Merge pull request #775 from SiarheiFedartsou/master
XLFormLeftRightSelectorOption left value change policy
2016-05-05 18:04:41 -03:00
Mathias Claassen 8d65cbe361 Merge pull request #777 from xmartlabs/fix/defaultKeyboardtype
Removed the setting of default keyboard type in text and name row.
2016-05-05 13:49:16 -03:00
Mathias Claassen 79eb596143 Removed the setting of default keyboard type in text and name row. 2016-05-05 11:37:44 -03:00
Mathias Claassen 0e866a0f22 Merge pull request #773 from koenpunt/patch-1
Add cancel action to image selector
2016-05-04 10:28:12 -03:00
Mathias Claassen d68166c669 Merge pull request #774 from hirad/swift-friendly-inits
Swift-friendly init methods
2016-05-04 10:25:35 -03:00
Siarhei Fiedartsou 72115e32ea iOS 7 fix 2016-04-29 17:13:05 +03:00
Siarhei Fiedartsou 5475ed7ed7 small fix in XLFormLeftRightSelectorOptionLeftValueChangePolicy enum 2016-04-29 16:54:56 +03:00
Siarhei Fiedartsou 8bdeb264c1 XLFormLeftRightSelectorOptionLeftValueChangePolicy added 2016-04-29 16:54:39 +03:00
Hirad Motamed 437c1e4d38 Current a XLFormViewController-subclass in Swift cannot have a custom init (it will crash at runtime with an 'unimplemented initializer' error). This fix adds designated initializer markings on the view controller and refactors them to all call the designated initializer. 2016-04-27 15:54:41 -07:00
Koen Punt 972815d7ea Add cancel action to image selector 2016-04-26 12:18:23 +02:00
Martin Barreto eeb165b1cc Merge pull request #759 from Drusy/master
Fix typo in README for Objective-C code
2016-04-06 12:37:38 -03:00
Kévin Renella 47dfa518c4 Fix typo in README for Objective-C code
The red color is [UIColor redColor]
2016-04-01 09:13:40 +02:00
Mathias Claassen bb9aceff75 Merge pull request #751 from bartvandendriessche/xlformdatecell_should_apply_cellconfiguration
XLFormDateCell applies cellConfiguration on value change
2016-03-29 09:59:24 -03:00
Pierre Houston 0d24f47f75 updated podfile for compatibility with cocoapods 1.0, did pod deintegrate on project to remove cruft
- fixes warnings on 'pod install': 'The dependency ... is not used in any concrete target'
2016-03-22 18:33:01 -07:00
Bart Vandendriessche 7ae1a5d612 XLFormDateCell applies cellConfiguration on value change
Previously, XLCFormDateCell would not invoke `updateFormRow` on its
`formViewController`.

This caused an issue where custom cell settings in `cellConfig` would
get overriden whenever the date changes.
2016-03-21 15:54:28 +01:00
Mathias Claassen 0db6e546c5 Merge pull request #735 from xmartlabs/fix/rowCopy
added validators copy to rowDescriptor copyWithZone.
2016-02-18 17:18:21 -03:00
Mathias Claassen 1229cb8d6a added validators copy to rowDescriptor copyWithZone.
Fixes #729
2016-02-18 17:17:56 -03:00
Mathias Claassen 4203e465f9 release version 3.1.1 2016-02-16 17:48:36 -03:00
Mathias Claassen 554893068d Merge pull request #733 from xmartlabs/fix/actionSheet
fixed crash when launching action sheet from iOS 9
2016-02-15 17:48:25 -03:00
Mathias Claassen b218344519 fixed crash when launching action sheet from iOS 9 2016-02-15 17:34:54 -03:00
Mathias Claassen 639235ec4d Merge pull request #732 from xmartlabs/fix/setRowDescriptor
Setting row descriptor will not fire cell config. This is done when u…
2016-02-15 17:32:34 -03:00
Mathias Claassen 94e3e57d48 Setting row descriptor will not fire cell config. This is done when updating the row. 2016-02-15 17:06:10 -03:00
Mathias Claassen 2eac764cad Merge pull request #707 from 27629678/master
fixed a crash
2016-02-15 16:25:41 -03:00
Mathias Claassen c85896cff2 Merge pull request #730 from ReadmeCritic/master
Correct the spelling of CocoaPods in README
2016-02-15 11:02:19 -03:00
ReadmeCritic bd5e239852 Correct the spelling of CocoaPods in README 2016-02-12 22:47:34 -08:00
Mathias Claassen baf470bf66 Merge pull request #692 from popina/master
Add an option to end editing the tableview on scroll
2016-02-12 10:16:43 -03:00
Mathias Claassen 4fd80c36f1 Merge pull request #701 from Vortec4800/pickerFix
Fixed normal and inline picker views to use row's value transformer
2016-02-12 10:13:13 -03:00
Mathias Claassen 1bffeb636f Merge pull request #694 from realestate-com-au/hotfix/deployment-target
Changed the minimum deployment target to 8.0
2016-02-09 10:18:30 -03:00
Mathias Claassen f6b1b4af75 Merge pull request #713 from xmartlabs/refactor
Removed Duplicated folder `Examples` under `Examples/Swift`
2016-01-27 12:07:56 -03:00
Mathias Claassen 001f63363c Removed Duplicated folder Examples under Examples/Swift
closes #698
2016-01-25 18:45:05 -03:00
yuxiaohua f379ee6ed9 fix bug: fixed UIViewController's instance, which does not inherit from XLFormViewController, using subclass of XLFormBaseCell will crash when its getFirstResponder method is invoked. 2016-01-25 17:47:20 +08:00
Tobias Hagemann 756fdb914b Merge branch 'master' of https://github.com/xmartlabs/XLForm into appextensions 2016-01-16 11:29:29 +01:00
Cory Imdieke 8b7507a690 Fixed normal and inline picker views to use row's value transformer for display text 2016-01-14 10:25:41 -06:00
Iskander Haziev 3df413b0fa Row with multiple selector should support custom controller 2016-01-05 17:18:40 +03:00
Stephen Yao 97b79f1f93 Changed Release config to distribution profile for code signing
(cherry picked from commit c4d7f7c9ef5a3a5d6799a8ff6e6a34872ea4b7bd)
2016-01-04 14:35:35 +11:00
Stephen Yao 763a2b12c0 Changed the minimum deployment target to 8.0 to support iOS 8 for developers installing the library through a git submodule 2016-01-04 14:02:25 +11:00
Martin Barreto 3d2b7a28f9 Merge pull request #687 from 27629678/master
fix no containsString: method in NSString under iOS8_0
2015-12-30 10:12:16 -03:00
yuxiaohua 3b0c113fe8 fix no containsString: method in NSString under iOS8_0 2015-12-29 09:44:12 +08:00
Martin Barreto f40357a193 Merge pull request #676 from xmartlabs/feature/customInlineRow
Added custom inline row example in Objective C and Swift.
2015-12-28 16:32:14 -03:00
Alejandro Garin ba949c3697 check if self conform to protocol XLFormOptionObject before checking if the object is kind of class NSString or NSNumber. This allow better control in the formatted output if the object is a NSNumber 2015-12-28 15:00:44 -03:00
Fonkymasto 5afb5e00a4 end editing on scroll is an option 2015-12-28 14:45:35 +01:00
Mathias Claassen 340683b106 Merge pull request #681 from realestate-com-au/master
Fix build error ‘XLFormImageCell.h’ file not found by moving XLFormImageCell from project header to public header
2015-12-22 09:59:39 -03:00
Jacky Li 6caa5b32f7 Fix build error ‘XLFormImageCell.h’ file not found by moving XLFormImageCell from project header to public header 2015-12-22 10:41:27 +11:00
Mathias Claassen 7865939994 Merge pull request #670 from loongman/master
Fix build error "‘XLFormImageCell.h’ file not found" by including XLF…
2015-12-21 16:40:10 -03:00
Mathias Claassen 7adfdb3219 Added custom inline row example in Objective C and Swift. 2015-12-17 18:15:04 -03:00
Mathias Claassen 9de9b69f04 Merge pull request #674 from xmartlabs/feature/textViewpercentage
allow setting the width percentage of an UITextView. Closes #534
2015-12-16 16:09:28 -03:00
Mathias Claassen 55176682d0 allow setting the width percentage of an UITextView. Closes #534 2015-12-15 12:58:49 -03:00
Mathias Claassen eaaba3247f Merge pull request #673 from xmartlabs/fix/readmeDelegates
update readme delegate section
2015-12-15 11:26:42 -03:00
Mathias Claassen 5a6c6bb33a update readme delegate section 2015-12-15 11:26:15 -03:00
Mathias Claassen 3a5ec757a5 Merge pull request #672 from xmartlabs/fix/predicateException
Try to remove the most exception when defining the hidden and disable…
2015-12-15 10:38:18 -03:00
Mathias Claassen 8fe5d15665 Merge pull request #671 from xmartlabs/fix/swiftExamples
order example groups alphabetically. Replace formSegueIdenfifiers in …
2015-12-15 10:38:03 -03:00
Mathias Claassen 9ed0e4be8d Try to remove the most exception when defining the hidden and disabled predicates. Will still throw an exception when defining forward dependencies 2015-12-15 10:16:51 -03:00
Mathias Claassen b13aa96ad7 order example groups alphabetically. Replace formSegueIdenfifiers in SwiftExample 2015-12-15 10:15:14 -03:00
loongman 0d97964006 Fix build error "‘XLFormImageCell.h’ file not found" by including XLFormImageCell into project file. 2015-12-15 11:43:23 +08:00
Mathias Claassen bd2a64b881 update version to 3.1.0 2015-12-14 18:10:45 -03:00
Mathias Claassen 403a63ec1f Merge pull request #669 from xmartlabs/feature/buttonCellStyle
Button row style must not be default any more.
2015-12-14 18:01:03 -03:00
Mathias Claassen 4d3d916b07 Button row style must not be default any more.
Can display value on right of button cell.
Closes #595, fixes #
2015-12-14 17:59:48 -03:00
Martin Barreto 6ef46a6026 Merge pull request #668 from xmartlabs/feature/returnKeyType
fixed return key type so that it will be used by navigation. Fixes #180
2015-12-14 17:09:59 -03:00
Mathias Claassen 5f376c5e85 fixed return key type so that it will be used by navigation. Fixes #180 2015-12-14 16:33:45 -03:00
Mathias Claassen 0ca45c77c4 Merge pull request #667 from winzig/master
Adding Swift example code for XLFormRowDescriptorTypeImage
2015-12-14 14:30:49 -03:00
Tom Winzig 2c3c6f6089 Adding Swift example code for XLFormRowDescriptorTypeImage
Based on example code in pull request #645
2015-12-11 13:03:32 -08:00
Martin Barreto 31ecb76df2 Update Rakefile 2015-12-11 17:11:06 -03:00
Mathias Claassen e98e09c8c6 Merge pull request #665 from xmartlabs/feature/allowHttp
allow http connections
2015-12-11 17:03:21 -03:00
Mathias Claassen 82c6bf29e1 Merge pull request #568 from hariseldon78/patch-3
Update XLFormRowDescriptor.h
2015-12-11 16:56:14 -03:00
Mathias Claassen 772ab0c53e Merge pull request #565 from chrisballinger/cell_bundle
Support cell xibs in different bundle than class
2015-12-11 16:53:34 -03:00
Mathias Claassen 6aba1f17ed Merge pull request #666 from xmartlabs/fix/segueIdentifier
fix segueIdentifier name. Fixes #585
2015-12-11 14:55:39 -03:00
Mathias Claassen 970c64620d Update .travis.yml 2015-12-11 14:53:15 -03:00
Mathias Claassen ccffa8600b fix segueIdentifier name. Fixes #585 2015-12-11 14:48:10 -03:00
Mathias Claassen cb01471cdc allow http connections 2015-12-11 14:30:27 -03:00
Martin Barreto 103e71e508 Merge pull request #645 from bmichotte/XLFormRowDescriptorTypeImage
Add XLFormRowDescriptorTypeImage
2015-11-30 15:56:11 -03:00
Benjamin Michotte 77b119d4d5 Add XLFormRowDescriptorTypeImage 2015-11-15 13:01:25 +01:00
Martin Barreto f2d5882614 Merge pull request #563 from tommypeps/feature/XLFormOptionsObjectImplementNSCoding
add NSCoding protocol a XLFormOptionsObject class
2015-11-13 01:45:19 -03:00
Martin Barreto ac0d5991e0 improve RTL language support. 2015-11-13 00:33:28 -03:00
Martin Barreto 33715f3154 Merge pull request #641 from mbjacks/master
prevent XLFormInlineSelectorCell from removing the row beneath when not first responder
2015-11-12 20:37:12 -03:00
Matt Jackson cd506db478 prevent XLFormInlineSelectorCell from removing the row beneath when not first responder 2015-11-12 15:25:15 -08:00
Martin Barreto 9a89d1bd5c Merge pull request #640 from xmartlabs/pbeast-master
Pbeast master
2015-11-12 20:09:24 -03:00
Martin Barreto 8495a150ed close #632 2015-11-12 20:12:26 -03:00
Martin Barreto 8c4ecfb86b Merge pull request #635 from tomtaylor/carthage-support
Added framework and Carthage support
2015-11-12 19:01:54 -03:00
Martin Barreto 3661646d54 fix #629 2015-11-12 17:16:34 -03:00
Martin Barreto 3f1bb84308 upgrade travis Xcode version to 7 2015-11-12 16:46:12 -03:00
Martin Barreto 8c12875aa2 Merge pull request #639 from xmartlabs/fix/cellLayoutMargins
fix #554 and #628.
2015-11-12 15:50:54 -03:00
Martin Barreto fa203c250e fix #554 and #628. 2015-11-12 15:53:38 -03:00
Martin Barreto f60922b38a Merge pull request #577 from xmartlabs/fix/layoutConstraints554
fixed layout constraints when working with iPad or big iPhones. close…
2015-11-12 15:16:16 -03:00
Tom Taylor d18edfbae2 Tidied up master header, adding imports for missing public headers. 2015-11-07 13:59:20 +00:00
Tom Taylor 1347ce56ee Add Carthage documentation to README. 2015-11-07 13:51:06 +00:00
Tom Taylor 9dc985bf3b Add Carthage support. 2015-11-02 21:14:51 +00:00
Pavel Yankelevich 764e3f9bc6 XLFormButtonCell -> textLabel -> textAlignment changed to NSTextAlignmentNatural. Looks much better for RTL languages 2015-11-01 15:33:01 +02:00
Martin Barreto a4fc47d5b0 clean up swift example code 2015-09-30 12:58:23 -03:00
Martin Barreto 38ef82c4df clean up swift code. 2015-09-30 00:13:31 -03:00
Martin Barreto 53f60c3287 clean up swift example project 2015-09-29 18:02:05 -03:00
Martin Barreto 95fe4f2cbc Merge branch 'master' of github.com:xmartlabs/XLForm 2015-09-29 16:20:36 -03:00
Martin Barreto 19e286bee9 Merge pull request #590 from noodlewerk/develop
Update to Swift 2.0
2015-09-29 16:11:57 -03:00
Martin Barreto 0f83bf6e1b Xcode 7 changes 2015-09-29 16:03:32 -03:00
Martin Barreto 9d20dbbf42 Merge branch 'master' of github.com:xmartlabs/XLForm 2015-09-29 16:01:21 -03:00
Martin Barreto 7a602ab61b minor change 2015-09-29 16:01:12 -03:00
Martin Barreto 1904ca3e10 Announcing Eureka - Elegant iOS Forms in pure Swift 2 2015-09-29 12:56:33 -03:00
Bruno Scheele f521bce859 Update to Swift 2.0 2015-09-29 14:08:13 +02:00
Mathias Claassen f2d4146782 fixed layout constraints when working with iPad or big iPhones. closes #554. 2015-09-24 17:38:20 -03:00
Roberto Previdi 06fd66c537 Update XLFormRowDescriptor.h 2015-09-19 13:41:24 +02:00
Tobias Hagemann e31c6db521 Merge branch 'master' of https://github.com/xmartlabs/XLForm into appextensions 2015-09-18 17:49:06 +02:00
mats-claassen 61430b0194 Merge pull request #557 from pdenis1/bug553
fixes #553. closes #553
2015-09-18 10:13:27 -03:00
Chris Ballinger ab8b4c979e Support cell xibs in different bundle than class 2015-09-17 19:54:58 -07:00
Jose Roldan Jimenez dbe81fe484 add NSCoding protocol a XLFormOptionsObject class 2015-09-17 12:38:36 +02:00
Martin Barreto 08eaf70f62 Merge pull request #560 from dfinzer/update-cell
Change XLFormDateCell to call update when value changes
2015-09-16 20:21:04 -03:00
Devin Finzer 134e764100 Change XLFormDateCell to call update when value changes, so that subclasses can change the UI properly 2015-09-16 16:01:00 -07:00
Phil Denis f2be2d3c29 fix bug 553 - Setting row of type XLFormRowDescriptorTypeSelectorPickerViewInline to disabled removes the next row from the form 2015-09-14 10:50:07 -06:00
Mathias Claassen e196fc711b Merge branch 'master' of github.com:xmartlabs/XLForm 2015-09-03 14:10:03 -03:00
Mathias Claassen 368501511d minor code cleanup 2015-09-03 14:09:52 -03:00
mats-claassen d88235b028 Merge pull request #536 from davidrothera/master
Add zipCode to XLFormRowDescriptorType's
2015-09-03 14:07:33 -03:00
David Rothera 23b93a1a70 Add zipCode to XLFormRowDescriptorType's 2015-09-03 12:46:47 +01:00
Tobias Hagemann 15a4ce9d83 Fixed #357 by adding XL_APP_EXTENSIONS macro so that XLForm can be used in App Extensions 2015-08-25 16:41:56 +02:00
Martin Barreto 1738fb8e35 update version 2015-08-17 21:36:11 -03:00
Mathias Claassen c3be940cc4 updated readme for cell configuration 2015-08-17 14:44:01 -03:00
Mathias Claassen dddbb74e95 Readme FAQ update 2015-08-17 14:01:51 -03:00
mats-claassen ef90f35a0f Merge pull request #505 from xmartlabs/fix/issue485
Fix/issue485
2015-08-14 17:51:47 -03:00
Mathias Claassen c03878e656 Merge branch 'master' into fix/issue485 2015-08-14 17:51:05 -03:00
Mathias Claassen 853254d75e Updated inline picker scrolling algorithm
closes #485
2015-08-14 17:50:30 -03:00
mats-claassen 460b116018 Merge pull request #504 from xmartlabs/fix/issue497
Fixed selector push value update bug.
2015-08-14 12:43:30 -03:00
Mathias Claassen 6a501e21fb Fixed selector push value update bug.
closes #497
2015-08-14 12:41:40 -03:00
Martin Barreto 6725d0a9b4 call setNeedsUpdateConstraints to make sure updateConstraints method is called. fix #486 2015-08-02 17:01:26 -03:00
Martin Barreto daaf720c29 fix #484 2015-08-01 21:21:59 -03:00
Martin Barreto bcd9ef118e Merge pull request #482 from Cee/master
Fix a typo
2015-08-01 17:32:34 -03:00
Cee cb9d40ba3a Fix a typo 2015-08-01 23:48:27 +08:00
Martin Barreto afcf2071ed Merge pull request #481 from xmartlabs/fix/issue465
Fix/issue465
2015-07-31 21:29:57 -03:00
Mathias Claassen 12b7012a1b Updated fix. Added CountDownTimer to inline row list 2015-07-31 12:20:02 -03:00
Mathias Claassen 8632b5bb42 Fixed issue #465 2015-07-30 10:55:02 -03:00
Martin Barreto ff2d869ee0 Merge pull request #474 from xmartlabs/feature/newpod
new pod version v3.0.1
2015-07-29 15:37:15 -03:00
Martin Barreto 486595922f new pod versin v3.0.1 2015-07-29 15:37:49 -03:00
Martin Barreto 9138c413f1 Merge pull request #473 from xmartlabs/fix/issue393
Fix issue #393
2015-07-28 21:03:02 -03:00
Martin Barreto 96c0999bf7 Merge pull request #470 from xmartlabs/issue#325
Issue #325 fix
2015-07-28 21:00:47 -03:00
Martin Barreto 79c14e3346 Use the metadata to know which are the inline rows. 2015-07-28 20:57:55 -03:00
Martin Barreto a28b595abd Merge pull request #471 from xmartlabs/fix/predicateparsing
Added "()" characters to separators when parsing strings to form pred…
2015-07-28 20:29:42 -03:00
Mathias Claassen 9de19aa0d8 Fix issue #393 2015-07-28 15:28:50 -03:00
Martin Pastorin d2a99cf8ce Merge pull request #472 from xmartlabs/issue#168
issue #168 - set row's textfield length
2015-07-28 14:37:33 -03:00
pastorin 029d88a901 issue #168 - set row's textfield length 2015-07-28 14:33:15 -03:00
Mathias Claassen d454cc284d Added "()" characters to separators when parsing strings to form predicates 2015-07-28 11:49:11 -03:00
pastorin 612807d9c3 Issue #325 fix
Accessory view should not be displayed on Inline date pickers
2015-07-28 11:21:47 -03:00
Martin Barreto c8ebb733ce fix #434 2015-07-28 00:08:14 -03:00
Martin Barreto 175f10397b Merge pull request #467 from stevemoser/patch-1
Remove setting the root VC in init
2015-07-27 22:48:18 -03:00
mats-claassen 094715028c Merge pull request #469 from xmartlabs/fix/hiddenAndDisabledRows
on change block
2015-07-27 15:43:54 -03:00
Mathias Claassen 169f9f9778 Modified onChangeBlock to send rowDescriptor 2015-07-27 15:39:34 -03:00
Mathias Claassen 9bc80c6c0d on change block 2015-07-27 13:55:25 -03:00
Martin Barreto ecc9ec45fb Merge pull request #466 from xmartlabs/issue#460
issue #460 fix
2015-07-27 13:15:59 -03:00
mats-claassen d479a91f47 Merge pull request #468 from xmartlabs/fix/hiddenAndDisabledRows
Hidden and disabled rows resign first responder before changing state
2015-07-27 12:42:25 -03:00
Mathias Claassen 014030a99e Hidden and disabled rows resign first responder before changing state 2015-07-27 12:38:24 -03:00
Steve Moser deb34b01b0 Remove setting the root VC in init
For the event example it is already set in the storyboard so it is not needed here.
2015-07-27 11:15:14 -04:00
pastorin 79d9412ea3 issue #460 fix 2015-07-27 11:04:49 -03:00
Martin Barreto a2feb45ad7 Merge pull request #462 from AlexZd/master
[PATCH] Allow Developers to use XLForm in their Frameworks
2015-07-27 00:21:06 -03:00
Martin Barreto bea7afcb60 Merge pull request #458 from xmartlabs/AlertController
iOS8 and above - Replace UIAlertView and UIActionSheet for UIAlertController
2015-07-25 01:02:26 -03:00
Martin Barreto 1854bd49a4 minor fix. 2015-07-25 00:58:12 -03:00
Martin Barreto bb1d4bedc8 Use new Alert/Style controller class when possible. 2015-07-25 00:39:11 -03:00
Martin Barreto ebf4915899 fix doc typo 2015-07-24 16:24:00 -03:00
pastorin 22c8f06d43 iOS8 and above - Replace UIAlertView and UIActionSheet for UIAlertController 2015-07-24 15:13:53 -03:00
Conrad Taylor 5b136eb458 Enhance the copy for creating a form and add a section for Storyboard users. 2015-07-23 13:19:54 -07:00
Martin Barreto 47aa759602 Merge pull request #455 from xmartlabs/StepCounterChanges
Improve StepCounter
2015-07-23 15:35:03 -03:00
pastorin da241efcc0 - Add StepCounter documentation
- Add StepCounter custom values example
- Fix XLFormStepCounterCell bug
2015-07-23 15:33:38 -03:00
Martin Barreto 09176bff39 Merge pull request #454 from xmartlabs/issue#398
issue #398 fix
2015-07-23 13:05:22 -03:00
Martin Barreto d3fc9b2093 Merge pull request #453 from xmartlabs/issue#386
issue #386 fix
2015-07-23 12:45:37 -03:00
pastorin 8c9351cd12 issue #398 fix 2015-07-23 12:37:26 -03:00
pastorin 560aec29c6 issue #386 fix 2015-07-23 11:27:18 -03:00
Martin Barreto 941f8fcfc3 Merge pull request #449 from xmartlabs/fix/TextFieldLayouts
Fix/text field layouts
2015-07-22 17:23:07 -03:00
pastorin 65c5431761 issue #409 fix 2015-07-22 17:18:34 -03:00
pastorin 1c1c95408f Merge branch 'master' of https://github.com/xmartlabs/XLForm into fix/TextFieldLayouts 2015-07-22 17:08:03 -03:00
Martin Pastorin cda07b2a64 Merge pull request #448 from xmartlabs/issue#429Constraints
issue #429 fix
2015-07-22 15:54:31 -03:00
pastorin 6fac42b190 issue #429 fix 2015-07-22 15:42:43 -03:00
Martin Barreto 4a641c4a7c Merge pull request #444 from openhood/keep-valueTransformer-on-copy
Ensure XLFormRowDescriptor valueTransform is kept on copy
2015-07-22 13:47:45 -03:00
Jonathan Tron a36ae6d90a Ensure XLFormRowDescriptor valueTransform is kept on copy 2015-07-22 17:38:16 +02:00
Martin Barreto 60657c0cf8 Merge pull request #441 from tommypeps/fixed#422
email long
2015-07-21 20:20:09 -03:00
Martin Barreto a114e9bda5 Merge pull request #440 from iOSCowboy/patch-1
Define 'DSL' in README file
2015-07-21 20:17:22 -03:00
Hector Zarate 4113135298 Define 'DSL' in README file 2015-07-21 22:55:12 +02:00
tommypeps 9503cbe8ed email long 2015-07-21 22:50:54 +02:00
Martin Barreto 36fa5e7071 Update README.md 2015-07-21 00:27:30 -03:00
Martin Barreto 6566ef81f8 Merge pull request #438 from xmartlabs/feature/swift1_2
Xcode 6.2 & swift1.2 support
2015-07-20 23:39:46 -03:00
Martin Barreto f019da0edc build version update. 2015-07-20 23:30:29 -03:00
Martin Barreto 20ca33e2e8 swift fixes. 2015-07-20 22:50:13 -03:00
mikeEllis 31f2fce646 swift 1.2 fixes 2015-07-20 17:19:00 -03:00
Martin Barreto 39280687e8 Merge pull request #432 from santiagofm/replace-xldataloader-with-xldata
replace xldataloader in objc examples with xldata
2015-07-17 16:52:41 -03:00
Santiago Fernandez 76b9d85154 update to xldata 2.0.0 2015-07-17 16:31:04 -03:00
Santiago Fernandez e6661b6526 replace xldataloader in objc examples with xldata 2015-07-16 10:58:02 -03:00
Martin Barreto 6e4574836b Merge branch 'master' of github.com:xmartlabs/XLForm 2015-07-15 01:25:29 -03:00
Martin Barreto 3822ed74e5 reload form whenever self.form is assigned. 2015-07-15 01:25:18 -03:00
Martin Barreto 49a2fb8f96 Merge pull request #425 from kevindeleon/patch-1
Fixes spelling error in requested change.
2015-07-14 12:55:35 -03:00
Martin Barreto 7929580f5d Merge pull request #427 from kevindeleon/patch-3
Figured these same spelling errors were here as well
2015-07-14 12:53:28 -03:00
Martin Barreto 03d8b0a35c Merge pull request #426 from kevindeleon/patch-2
fixes a few more spelling errors.
2015-07-14 12:53:07 -03:00
Kevin deLeon 7bbfab3c6b fixes a spelling error I missed. 2015-07-14 08:58:07 -05:00
Kevin deLeon 84a2f55609 Figured these same spelling errors were here as well 2015-07-14 08:55:36 -05:00
Kevin deLeon 8273745356 fixes a few more spelling errors. 2015-07-14 08:52:38 -05:00
Kevin deLeon 2e3e267bfe Fixes spelling error in requested change. 2015-07-14 08:50:01 -05:00
Martin Barreto 4c68391763 Update README.md 2015-07-10 22:34:06 -03:00
Sebastian Vogelsang 94f22d9b54 made textFields within XLFormTextFieldCells a min. width of 1/3 screen width. That way very long labels cannot squeeze the textField until input becomes impossible. Also labels are multi-line now. 2015-07-09 15:15:10 +02:00
Martin Barreto d94b027c17 minor example project fix. row tag (key) was wrong. 2015-06-20 11:24:00 -03:00
Martin Barreto 549a6be69f #389 2015-06-19 11:33:54 -03:00
Martin Barreto 49e30831fe Removed XLDataLoader dependency from swift example project. 2015-06-18 19:22:44 -03:00
Martin Barreto a025671a7c minor fix. 2015-06-18 19:09:01 -03:00
Martin Barreto d938ae2ff2 #384 fix. 2015-06-17 10:52:42 -05:00
Martin Barreto ec32aa367f Merge pull request #400 from Babylonpartners/bugfix/long-text-value-fix
title labels should be always visible
2015-06-17 07:45:42 -05:00
Tim Preuß 10d97e6521 title labels should be always visible, even if the entered text is very long 2015-06-17 09:59:33 +01:00
AlexZd 3a71cfe6e2 [PATCH] Allow Developers to use XLForm in their Frameworks 2015-06-11 17:37:57 +04:00
Martin Barreto 73a2d52754 Merge pull request #383 from haaakon/master
Clearify how to install with cocoapods when use_frameworks is set
2015-06-09 09:00:17 -07:00
Håkon Bogen 9805fdca06 Clearify how to install with cocoapods when use_frameworks is set
Also updating the title, there is no such thing as a "Swift project", there is Swift files and Objective-C files, you can use both in any project.
2015-06-07 17:47:05 +02:00
Martin Barreto ef057d9276 Merge pull request #371 from bojan/master
The Swift example was not compilable
2015-05-29 02:49:02 -03:00
Bojan Dimovski 12f0666a01 Add a missing local variable in the Swift example, that was making the code uncompilable. 2015-05-28 10:13:02 +02:00
Bojan Dimovski fde42a24c9 Fix a typo in the perform selector method name. 2015-05-28 10:11:21 +02:00
Martin Barreto 395ad92609 Merge pull request #364 from xmartlabs/examples/swift
Swift Examples added.
2015-05-22 11:27:22 -03:00
Martin Barreto 8583c62371 Merge branch 'examples/swift' of github.com:xmartlabs/XLForm into examples/swift 2015-05-21 22:17:35 -03:00
Martin Barreto f1da656aed minor fix. 2015-05-21 22:16:28 -03:00
Martin Barreto f02bcf92c5 Merge pull request #362 from ericcgu/examples/swift
Swift Update to Enum + If Statement to Switch
2015-05-21 17:46:01 -03:00
Eric Gu (@ericguuu) c0e9260930 Update to Swift Enum 2015-05-21 16:30:40 -04:00
Eric Gu (@ericguuu) 69b70c657d Use Swift Enum + If Statement to Switch Statement 2015-05-21 16:29:07 -04:00
Eric Gu (@ericguuu) 9589061a0d Merge pull request #2 from xmartlabs/examples/swift
Examples/swift
2015-05-21 16:12:06 -04:00
Martin Barreto f4044f6259 Merge pull request #360 from ericcgu/patch-1
Add Swift to README
2015-05-21 15:37:20 -03:00
Eric Gu (@ericguuu) ff2f0283ff Add Swift to README 2015-05-21 13:06:15 -04:00
Martin Barreto 9fada5f4f9 swift examples added. 2015-05-21 12:46:38 -03:00
Martin Barreto 3b54dee1fe delete unnecessary XLFormRowDescriptor initializer and disabled selector example. 2015-05-21 12:42:40 -03:00
Martin Barreto 514807c473 clean up code. 2015-04-27 11:20:19 -03:00
Martin Barreto 2702ca48c6 Merge branch 'master' of github.com:xmartlabs/XLForm 2015-04-25 18:43:47 -03:00
Martin Barreto f329a71340 FloatLabeledTextFieldCell minor fix 2015-04-25 18:42:50 -03:00
mats-claassen 9e9289801b Merge pull request #339 from xmartlabs/ios_7_compatibility_fix
Fixed error with function that was not available on iOS 7 and before.
2015-04-24 15:29:01 -03:00
Mathias Claassen 1169554708 Fixed error with function that was not available on iOS 7 and before. 2015-04-24 15:28:15 -03:00
Martin Barreto f2408e86a5 merge 2015-04-24 01:39:12 -03:00
Martin Barreto b085dcb325 minor fixes. 2015-04-24 01:35:03 -03:00
mats-claassen d67eb7f762 Merge pull request #332 from xmartlabs/countdown_issue_fix
Fixed issue #330 with countdown timer. It did not check the first change...
2015-04-22 14:58:34 -03:00
Mathias Claassen 8bbbef613b Fixed issue #330 with countdown timer. It did not check the first change. 2015-04-22 14:57:18 -03:00
mats-claassen 6a7040e531 Merge pull request #331 from xmartlabs/readme_update_FAQ
Added FAQ question for issue #329
2015-04-22 12:36:09 -03:00
Mathias Claassen 73abfd53c2 Added FAQ question for issue #329 2015-04-22 12:33:23 -03:00
mats-claassen 6e5427d7a4 Merge pull request #328 from xmartlabs/textFieldLayoutFix
Fixed issue with layout in iOS v7.1 (#324).
2015-04-21 12:17:44 -03:00
Mathias Claassen 23c315b479 Fixed issue with layout in iOS v7.1 (#324). 2015-04-21 12:16:34 -03:00
Martin Barreto e14ed978c0 Merge pull request #317 from xmartlabs/deprecated
Fix NSHourCalendarUnit and NSMinuteCalendarUnit deprecated
2015-04-20 16:14:34 -03:00
Martin Barreto fb653663e8 Merge pull request #320 from xmartlabs/accessoryTypeIssue
Fix accessoryType limitations (issue #312)
2015-04-17 23:05:17 -03:00
Martin Barreto c5b88338cb Update XLFormButtonCell.m 2015-04-17 23:02:56 -03:00
Martin Barreto 8bd5656c67 delete podfile.lock 2015-04-17 21:23:21 -03:00
mats-claassen f6f51ea555 Merge pull request #319 from xmartlabs/duplicateSymbol
fix duplicate symbols (issue #311)
2015-04-17 16:13:12 -03:00
mats-claassen c17c6ff8dd Merge pull request #321 from xmartlabs/predicate_examples
Added more predicate examples and corrected minor things in readme.
2015-04-17 16:02:53 -03:00
Mathias Claassen 2782937274 Added more predicate examples and corrected minor things in readme. 2015-04-17 15:51:29 -03:00
pastorin 581fdbf561 Fix accessoryType limitations (issue #312) 2015-04-17 14:46:03 -03:00
pastorin 588a0b8734 fix duplicate symbols (issue #311) 2015-04-17 11:43:15 -03:00
pastorin e2118cba30 Fix NSHourCalendarUnit and NSMinuteCalendarUnit deprecated 2015-04-17 10:07:03 -03:00
Martin Barreto b817d1270e Merge branch 'predicate_rowDescriptor' 2015-04-17 04:41:17 -03:00
Martin Barreto 289603f952 merge 2015-04-17 04:40:10 -03:00
Martin Barreto eb4b1d67ca merge 2015-04-17 04:28:01 -03:00
Martin Barreto 5629922247 merge 2015-04-17 04:04:59 -03:00
Martin Barreto d5da7f807a comment out unused variables 2015-04-17 03:43:51 -03:00
Martin Barreto 802fb9a7c4 Merge branch 'predicate_rowDescriptor' of github.com:xmartlabs/XLForm into predicate_rowDescriptor 2015-04-17 03:39:30 -03:00
Martin Barreto 5bb7a4d82d fix unit test, make UITableView loads its cells on iOS 8.3 2015-04-17 03:39:03 -03:00
Martin Barreto 68d5d367d5 Merge pull request #315 from santiagofm/master
fixed formRowDescriptorValueHasChanged: not being called when datepicker...
2015-04-16 16:32:07 -03:00
Santiago Fernandez 6af0912cf7 fixed formRowDescriptorValueHasChanged: not being called when datepicker value changed 2015-04-16 16:28:24 -03:00
Mathias Claassen b6da136929 Merge branch 'predicate_rowDescriptor' of github.com:xmartlabs/XLForm into predicate_rowDescriptor 2015-04-16 16:25:45 -03:00
Mathias Claassen c3683c7ad7 added new predicate example for blog 2015-04-16 16:24:49 -03:00
Martin Barreto 9bc2f91d6b Merge pull request #314 from xmartlabs/addCountDownTimerType
Add count down timer type
2015-04-16 14:14:01 -03:00
pastorin 8ff180f6f4 minor change 2015-04-16 13:20:34 -03:00
pastorin 054f1803f0 add DateValueTransformer 2015-04-16 13:13:34 -03:00
Martin Barreto 27f0f78938 rename test file. 2015-04-16 13:05:49 -03:00
Martin Barreto b738d826f9 add observers at initialization time. 2015-04-16 02:15:14 -03:00
Martin Barreto 2ac23999fb Merge branch 'predicate_rowDescriptor' of github.com:xmartlabs/XLForm into predicate_rowDescriptor 2015-04-15 19:36:02 -03:00
Martin Barreto e8edb426c2 minor 2015-04-15 19:35:35 -03:00
Mathias Claassen 57fe1a64e2 bad_access bug removed 2015-04-15 15:46:06 -03:00
pastorin a8094d48b8 * 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.
2015-04-15 15:23:54 -03:00
Mathias Claassen 730ec7ba58 tests 2015-04-15 13:41:43 -03:00
Martin Barreto 04b7ee6035 merge 2015-04-15 02:31:50 -03:00
Martin Barreto f0b7080a80 polish code. 2015-04-15 02:21:14 -03:00
Mathias Claassen ca201ba888 clean up code 2015-04-14 16:22:13 -03:00
Mathias Claassen 28e74bd134 doc 2015-04-14 11:23:58 -03:00
Martin Barreto 8b552c9632 minor 2015-04-14 02:28:40 -03:00
Martin Barreto bf9f11d307 Merge branch 'predicate_rowDescriptor' of github.com:xmartlabs/XLForm into predicate_rowDescriptor 2015-04-14 00:42:48 -03:00
Martin Barreto 05bd37f55a update icons. 2015-04-14 00:42:19 -03:00
Mathias Claassen 75558762bc Merge branch 'predicate_rowDescriptor' of github.com:xmartlabs/XLForm into predicate_rowDescriptor
Conflicts:
	XLForm/XL/Descriptors/XLFormDescriptor.m
	XLForm/XL/Descriptors/XLFormRowDescriptor.m
	XLForm/XL/Descriptors/XLFormSectionDescriptor.m
2015-04-13 15:44:21 -03:00
Mathias Claassen d84f09bf45 added test for disabled and hidden predicate property 2015-04-13 10:11:39 -03:00
Martin Barreto 6a275dbb56 Clean up code. Change interfaces to expose less methods. 2015-04-13 00:35:45 -03:00
Martin Barreto 998a4bc382 Merge branch 'master' into predicate_rowDescriptor 2015-04-12 20:53:00 -03:00
Martin Barreto 9143d6bd90 Merge branch 'master' of github.com:xmartlabs/XLForm 2015-04-12 20:33:06 -03:00
Martin Barreto 74be7af750 clean up code. 2015-04-12 20:32:41 -03:00
Mathias Claassen d43ff5c93d Hide / show predicates 2015-04-09 17:22:39 -03:00
Mathias Claassen d2a323feca hidden & disabled predicate added 2015-04-08 15:09:33 -03:00
Mathias Claassen da40cfaf5d predicates for disabling rows + example 2015-04-06 15:44:48 -03:00
Martin Barreto 176c7bebbe Merge pull request #297 from colmdoyle/master
Update Podfile of examples
2015-04-01 13:28:23 -03:00
Colm Doyle 94edd0015e Update Podfile of examples 2015-04-01 14:20:03 +01:00
Martin Barreto d5d10baa41 Merge branch 'master' of github.com:xmartlabs/XLForm 2015-03-30 18:52:23 -03:00
Martin Barreto 8de760e951 update README. 2015-03-30 18:49:36 -03:00
Martin Barreto 6f83343d6f 2.2.0 release notes. 2015-03-28 17:01:35 -03:00
Martin Barreto 8063c91e2d v2.2.0 2015-03-26 13:04:43 -03:00
Martin Barreto 4fb2cb15a2 Merge pull request #290 from xmartlabs/feature/reordering_rows
Add ability to either insert, delete or reorder table view cells. It supports standalone rows and also inline rows ;). Add ability to insert rows using a button row added at the end of the section. Update Examples. Clean up code.
2015-03-25 01:30:42 -03:00
Martin Barreto b5b71d5ddf Add ability to either insert, delete or reorder table view cells. It supports standalone rows and also inline rows ;). Add ability to insert rows using a button row added at the end of the section. Update Examples. Clean up code. 2015-03-25 01:29:08 -03:00
Martin Barreto 16160b431f Merge branch 'master' of github.com:xmartlabs/XLForm into feature/reordering_rows 2015-03-21 14:59:08 -03:00
Martin Barreto 2857ab3060 Merge pull request #280 from xmartlabs/disabled-form
Ability to disable the form. Ability to customize disabled rows. Bug fixes.
2015-03-20 14:19:29 -03:00
Martin Barreto 176b301087 Clean up code.
Disabled rows example added.
Ability to customize disable rows properties.
Bug fixes.
2015-03-20 14:08:02 -03:00
Borba 51e2adc1b3 update accessory view when reorder a cell or delete one 2015-03-20 13:15:15 -03:00
Borba 67daaae929 add section options and ordering rows 2015-03-20 12:32:49 -03:00
Martin Barreto 552624bbbf Merge branch 'master' of github.com:xmartlabs/XLForm into disabled-form 2015-03-18 01:01:19 -03:00
Borba a209c72e84 Merge remote-tracking branch 'origin/master' into disabled-form 2015-03-17 19:45:15 -03:00
Borba bea831dfba add disable on Form 2015-03-17 19:43:43 -03:00
271 changed files with 13716 additions and 4739 deletions
+13
View File
@@ -0,0 +1,13 @@
# These are supported funding model platforms
github: xmartlabs # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
+2 -2
View File
@@ -19,5 +19,5 @@ DerivedData
#CocoaPods
Pods
Tests/Pods
Tests/Podfile.lock
Podfile.lock
*.xcworkspace
+3 -3
View File
@@ -1,7 +1,7 @@
language: objective-c
osx_image: xcode12
before_install:
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
- gem install cocoapods --quiet
- gem install xcpretty --quiet
- cd Tests && pod install && cd $TRAVIS_BUILD_DIR
script: rake test
+158
View File
@@ -0,0 +1,158 @@
# Change Log
All notable changes to this project will be documented in this file.
### Version 4.3.0:
* Add datePicker style property to XLFormDateCell (#1078)
### Version 4.2.0:
* Support for Swift Package Manager (#1073)
* Fix Carthage build (#1075)
### Version 4.1.0:
* Fix crash when .Nib is inside a framework bundle. (#1050)
* iOS 13 dark mode support. (#1057)
* Updates for Swift 5 in Examples
### Version 4.0.1:
* Memory improvements and fixes.
* Other minor fixes
### Version 4.0.0:
* Adds support for Xcode 9.
* Deprecated UIAlertView, UIActionSheet, UIPopoverController.
* Bumped minimum iOS version to 9.0.
### Version 3.3.0:
* Added `cellConfigForSelector` to style XLFormOptionsViewController
* Added properties to **limit number of characters** in `XLFormTextFieldCell` and `XLFormTextViewCell`
* Minor fixes
### Version 3.2.0:
* 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
@@ -26,16 +26,22 @@
#import "XLForm.h"
#import "AccessoryViewFormViewController.h"
//This macro defines if we use predicates to hide rows or do it manually the old way.
//Just comment out if you want it to run without predicates.
#define USE_PREDICATES_FOR_HIDING
@interface AccessoryViewFormViewController ()
@end
@implementation AccessoryViewFormViewController
{
#ifndef USE_PREDICATES_FOR_HIDING
XLFormRowDescriptor * _rowShowAccessoryView;
XLFormRowDescriptor * _rowStopDisableRow;
XLFormRowDescriptor * _rowStopInlineRow;
XLFormRowDescriptor * _rowSkipCanNotBecomeFirstResponderRow;
#endif
}
@@ -54,6 +60,8 @@ NSString * kAccessoryViewCheck = @"check";
NSString * kAccessoryViewNotes = @"notes";
-(id)init
{
self = [super init];
@@ -69,7 +77,7 @@ NSString * kAccessoryViewNotes = @"notes";
formDescriptor.rowNavigationOptions = XLFormRowNavigationOptionEnabled;
XLFormSectionDescriptor * section;
XLFormRowDescriptor * row;
XLFormRowDescriptor * switchRow;
// Configuration section
section = [XLFormSectionDescriptor formSectionWithTitle:@"Row Navigation Settings"];
@@ -77,33 +85,54 @@ NSString * kAccessoryViewNotes = @"notes";
[formDescriptor addFormSection:section];
// RowNavigationEnabled
row = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewRowNavigationEnabled rowType:XLFormRowDescriptorTypeBooleanSwitch title:@"Row Navigation Enabled?"];
row.value = @YES;
[section addFormRow:row];
switchRow = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewRowNavigationEnabled rowType:XLFormRowDescriptorTypeBooleanSwitch title:@"Row Navigation Enabled?"];
switchRow.value = @YES;
[section addFormRow:switchRow];
// RowNavigationShowAccessoryView
_rowShowAccessoryView = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewRowNavigationShowAccessoryView rowType:XLFormRowDescriptorTypeBooleanCheck title:@"Show input accessory view?"];
_rowShowAccessoryView.value = @((formDescriptor.rowNavigationOptions & XLFormRowNavigationOptionEnabled) == XLFormRowNavigationOptionEnabled);
[section addFormRow:_rowShowAccessoryView];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewRowNavigationShowAccessoryView rowType:XLFormRowDescriptorTypeBooleanCheck title:@"Show input accessory row?"];
row.value = @((formDescriptor.rowNavigationOptions & XLFormRowNavigationOptionEnabled) == XLFormRowNavigationOptionEnabled);
[section addFormRow:row];
#ifdef USE_PREDICATES_FOR_HIDING
row.hidden = [NSString stringWithFormat:@"$%@ == 0", switchRow];
#else
_rowShowAccessoryView = row;
#endif
// RowNavigationStopDisableRow
_rowStopDisableRow = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewRowNavigationStopDisableRow rowType:XLFormRowDescriptorTypeBooleanCheck title:@"Stop when reach disabled row?"];
_rowStopDisableRow.value = @((formDescriptor.rowNavigationOptions & XLFormRowNavigationOptionStopDisableRow) == XLFormRowNavigationOptionStopDisableRow);
[section addFormRow:_rowStopDisableRow];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewRowNavigationStopDisableRow rowType:XLFormRowDescriptorTypeBooleanCheck title:@"Stop when reach disabled row?"];
row.value = @((formDescriptor.rowNavigationOptions & XLFormRowNavigationOptionStopDisableRow) == XLFormRowNavigationOptionStopDisableRow);
[section addFormRow:row];
#ifdef USE_PREDICATES_FOR_HIDING
row.hidden = [NSString stringWithFormat:@"$%@ == 0", switchRow];
#else
_rowStopDisableRow = row;
#endif
// RowNavigationStopInlineRow
_rowStopInlineRow = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewRowNavigationStopInlineRow rowType:XLFormRowDescriptorTypeBooleanCheck title:@"Stop when reach inline row?"];
_rowStopInlineRow.value = @((formDescriptor.rowNavigationOptions & XLFormRowNavigationOptionStopInlineRow) == XLFormRowNavigationOptionStopInlineRow);
[section addFormRow:_rowStopInlineRow];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewRowNavigationStopInlineRow rowType:XLFormRowDescriptorTypeBooleanCheck title:@"Stop when reach inline row?"];
row.value = @((formDescriptor.rowNavigationOptions & XLFormRowNavigationOptionStopInlineRow) == XLFormRowNavigationOptionStopInlineRow);
[section addFormRow:row];
#ifdef USE_PREDICATES_FOR_HIDING
row.hidden = [NSString stringWithFormat:@"$%@ == 0", switchRow];
#else
_rowStopInlineRow = row;
#endif
// RowNavigationSkipCanNotBecomeFirstResponderRow
_rowSkipCanNotBecomeFirstResponderRow = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewRowNavigationSkipCanNotBecomeFirstResponderRow rowType:XLFormRowDescriptorTypeBooleanCheck title:@"Skip Can Not Become First Responder Row?"];
_rowSkipCanNotBecomeFirstResponderRow.value = @((formDescriptor.rowNavigationOptions & XLFormRowNavigationOptionSkipCanNotBecomeFirstResponderRow) == XLFormRowNavigationOptionSkipCanNotBecomeFirstResponderRow);
[section addFormRow:_rowSkipCanNotBecomeFirstResponderRow];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewRowNavigationSkipCanNotBecomeFirstResponderRow rowType:XLFormRowDescriptorTypeBooleanCheck title:@"Skip Can Not Become First Responder Row?"];
row.value = @((formDescriptor.rowNavigationOptions & XLFormRowNavigationOptionSkipCanNotBecomeFirstResponderRow) == XLFormRowNavigationOptionSkipCanNotBecomeFirstResponderRow);
[section addFormRow:row];
#ifdef USE_PREDICATES_FOR_HIDING
row.hidden = [NSString stringWithFormat:@"$%@ == 0", switchRow];
#else
_rowSkipCanNotBecomeFirstResponderRow = row;
#endif
// Basic Information - Section
section = [XLFormSectionDescriptor formSectionWithTitle:@"TextField Types"];
section.footerTitle = @"This is a long text that will appear on section footer";
section = [XLFormSectionDescriptor formSection];
[formDescriptor addFormSection:section];
// Name
@@ -119,7 +148,7 @@ NSString * kAccessoryViewNotes = @"notes";
// Twitter
row = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewTwitter rowType:XLFormRowDescriptorTypeTwitter title:@"Twitter"];
row.disabled = YES;
row.disabled = @YES;
row.value = @"@no_editable";
[section addFormRow:row];
@@ -140,10 +169,10 @@ NSString * kAccessoryViewNotes = @"notes";
[row.cellConfigAtConfigure setObject:@"TEXT VIEW EXAMPLE" forKey:@"textView.placeholder"];
[section addFormRow:row];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewCheck rowType:XLFormRowDescriptorTypeBooleanCheck title:@"Ckeck"];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewCheck rowType:XLFormRowDescriptorTypeBooleanCheck title:@"Check"];
[section addFormRow:row];
section = [XLFormSectionDescriptor formSectionWithTitle:@"TextView With Label Example"];
section = [XLFormSectionDescriptor formSection];
[formDescriptor addFormSection:section];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kAccessoryViewNotes rowType:XLFormRowDescriptorTypeTextView title:@"Notes"];
[section addFormRow:row];
@@ -158,6 +187,7 @@ NSString * kAccessoryViewNotes = @"notes";
-(void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)rowDescriptor oldValue:(id)oldValue newValue:(id)newValue
{
[super formRowDescriptorValueHasChanged:rowDescriptor oldValue:oldValue newValue:newValue];
#ifndef USE_PREDICATES_FOR_HIDING
NSString * kRowNavigationEnabled = @"kRowNavigationEnabled";
if ([rowDescriptor.tag isEqualToString:kRowNavigationEnabled]){
if ([[rowDescriptor.value valueData] isEqual:@NO]){
@@ -180,7 +210,9 @@ NSString * kAccessoryViewNotes = @"notes";
}
}
else if ([rowDescriptor.tag isEqualToString:kAccessoryViewRowNavigationStopDisableRow]){
else
#endif
if ([rowDescriptor.tag isEqualToString:kAccessoryViewRowNavigationStopDisableRow]){
if ([[rowDescriptor.value valueData] isEqual:@(YES)]){
self.form.rowNavigationOptions = self.form.rowNavigationOptions | XLFormRowNavigationOptionStopDisableRow;
}
+1 -1
View File
@@ -2,7 +2,7 @@
// AppDelegate.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
+1 -2
View File
@@ -2,7 +2,7 @@
// AppDelegate.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -23,7 +23,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "CoreDataStore.h"
#import "ExamplesFormViewController.h"
#import "AppDelegate.h"
@@ -1,7 +1,7 @@
// CustomRowsViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
// CustomRowsViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -27,11 +27,15 @@
#import "XLFormWeekDaysCell.h"
#import "XLFormRatingCell.h"
#import "FloatLabeledTextFieldCell.h"
#import "XLFormCustomCell.h"
#import "XLFormInlineSegmentedCell.h"
static NSString * const kCustomRowFirstRatingTag = @"CustomRowFirstRatingTag";
static NSString * const kCustomRowSecondRatingTag = @"CustomRowSecondRatingTag";
static NSString * const kCustomRowFloatLabeledTextFieldTag = @"CustomRowFloatLabeledTextFieldTag";
static NSString * const kCustomRowWeekdays = @"CustomRowWeekdays";
static NSString * const kCustomInline = @"kCustomInline";
static NSString * const kCustomRowText = @"kCustomText";
@implementation CustomRowsViewController
@@ -69,6 +73,12 @@ static NSString * const kCustomRowWeekdays = @"CustomRowWeekdays";
row = [XLFormRowDescriptor formRowDescriptorWithTag:kCustomRowFloatLabeledTextFieldTag rowType:XLFormRowDescriptorTypeFloatLabeledTextField title:@"Title"];
[section addFormRow:row];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kCustomRowFloatLabeledTextFieldTag rowType:XLFormRowDescriptorTypeFloatLabeledTextField title:@"First Name"];
[section addFormRow:row];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kCustomRowFloatLabeledTextFieldTag rowType:XLFormRowDescriptorTypeFloatLabeledTextField title:@"Last Name"];
[section addFormRow:row];
// Section Weekdays
section = [XLFormSectionDescriptor formSectionWithTitle:@"Weekdays"];
[form addFormSection:section];
@@ -86,6 +96,25 @@ static NSString * const kCustomRowWeekdays = @"CustomRowWeekdays";
};
[section addFormRow:row];
// Custom Inline Segmented row
section = [XLFormSectionDescriptor formSectionWithTitle:@"Custom Inline"];
[form addFormSection:section];
// Inline segmented
row = [XLFormRowDescriptor formRowDescriptorWithTag:kCustomInline rowType:XLFormRowDescriptorTypeSegmentedInline];
row.title = @"You support...";
row.selectorOptions = @[@"Uruguay", @"Brazil", @"Argentina", @"Chile"];
row.value = @"Uruguay";
[section addFormRow:row];
section = [XLFormSectionDescriptor formSection];
[form addFormSection:section];
XLFormRowDescriptor *customRowDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kCustomRowText rowType:@"XLFormRowDescriptorTypeCustom"];
// Must set custom cell or add custom cell to cellClassesForRowDescriptorTypes dictionary before XLFormViewController loaded
customRowDescriptor.cellClass = [XLFormCustomCell class];
[section addFormRow:customRowDescriptor];
self.form = form;
}
@@ -1,7 +1,7 @@
// FloatLabeledTextFieldCell.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
// FloatLabeledTextFieldCell.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -31,7 +31,6 @@
NSString * const XLFormRowDescriptorTypeFloatLabeledTextField = @"XLFormRowDescriptorTypeFloatLabeledTextField";
const static CGFloat kHMargin = 15.0f;
const static CGFloat kVMargin = 8.0f;
const static CGFloat kFloatingLabelFontSize = 11.0f;
@@ -77,13 +76,19 @@ const static CGFloat kFloatingLabelFontSize = 11.0f;
self.floatLabeledTextField.attributedPlaceholder =
[[NSAttributedString alloc] initWithString:self.rowDescriptor.title
attributes:@{NSForegroundColorAttributeName: [UIColor darkGrayColor]}];
attributes:@{NSForegroundColorAttributeName: [UIColor lightGrayColor]}];
self.floatLabeledTextField.text = self.rowDescriptor.value ? [self.rowDescriptor.value displayText] : self.rowDescriptor.noValueDisplayText;
[self.floatLabeledTextField setEnabled:!self.rowDescriptor.disabled];
[self.floatLabeledTextField setEnabled:!self.rowDescriptor.isDisabled];
self.floatLabeledTextField.textColor = self.rowDescriptor.disabled ? [UIColor grayColor] : [UIColor blackColor];
self.floatLabeledTextField.floatingLabelTextColor = [UIColor lightGrayColor];
[self.floatLabeledTextField setAlpha:((self.rowDescriptor.isDisabled) ? .6 : 1)];
}
-(BOOL)formDescriptorCellCanBecomeFirstResponder
{
return !self.rowDescriptor.isDisabled;
}
-(BOOL)formDescriptorCellBecomeFirstResponder
@@ -91,12 +96,6 @@ const static CGFloat kFloatingLabelFontSize = 11.0f;
return [self.floatLabeledTextField becomeFirstResponder];
}
-(BOOL)formDescriptorCellResignFirstResponder
{
return [self.floatLabeledTextField resignFirstResponder];
}
#pragma mark - UITextFieldDelegate
- (BOOL)textFieldShouldClear:(UITextField *)textField
@@ -155,10 +154,9 @@ const static CGFloat kFloatingLabelFontSize = 11.0f;
NSMutableArray * result = [[NSMutableArray alloc] init];
NSDictionary * views = @{@"floatLabeledTextField": self.floatLabeledTextField};
NSDictionary *metrics = @{@"hMargin":@(kHMargin),
@"vMargin":@(kVMargin)};
NSDictionary *metrics = @{@"vMargin":@(kVMargin)};
[result addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(hMargin)-[floatLabeledTextField]-(hMargin)-|"
[result addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[floatLabeledTextField]-|"
options:0
metrics:metrics
views:views]];
@@ -1,7 +1,7 @@
// XLRatingView.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
// XLRatingView.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -55,11 +55,8 @@
- (void)customize
{
UIColor * grayColor = [UIColor colorWithRed:(205/255.0) green:(201/255.0) blue:(201/255.0) alpha:1];
self.baseColor = grayColor;
UIColor * goldColor = [UIColor colorWithRed:(255/255.0) green:(215/255.0) blue:0 alpha:1];
self.highlightColor = goldColor;
self.baseColor = [UIColor colorWithRed:(205/255.0) green:(201/255.0) blue:(201/255.0) alpha:1];
self.highlightColor = [UIColor colorWithRed:(255/255.0) green:(215/255.0) blue:0 alpha:1];
self.markFont = [UIFont systemFontOfSize:23.0f];
self.translatesAutoresizingMaskIntoConstraints = NO;
self.stepInterval = 1.0f;
@@ -1,7 +1,7 @@
// XLFormRatingCell.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -28,6 +28,7 @@
extern NSString * const XLFormRowDescriptorTypeRate;
@interface XLFormRatingCell : XLFormBaseCell
@property (weak, nonatomic) IBOutlet UILabel *rateTitle;
@property (weak, nonatomic) IBOutlet XLRatingView *ratingView;
@@ -1,7 +1,7 @@
// XLFormRatingCell.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -47,6 +47,9 @@ NSString * const XLFormRowDescriptorTypeRate = @"XLFormRowDescriptorTypeRate";
self.ratingView.value = [self.rowDescriptor.value floatValue];
self.rateTitle.text = self.rowDescriptor.title;
[self.ratingView setAlpha:((self.rowDescriptor.isDisabled) ? .6 : 1)];
[self.rateTitle setAlpha:((self.rowDescriptor.isDisabled) ? .6 : 1)];
}
#pragma mark - Events
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
@@ -10,11 +11,12 @@
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="OGo-4x-YLf" customClass="XLFormRatingCell">
<rect key="frame" x="0.0" y="0.0" width="478" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="OGo-4x-YLf" id="hV6-xt-6pq">
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" tableViewCell="OGo-4x-YLf" id="hV6-xt-6pq">
<rect key="frame" x="0.0" y="0.0" width="478" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yhI-dj-sRk" customClass="XLRatingView">
<rect key="frame" x="353" y="11" width="115" height="22"/>
<rect key="frame" x="355" y="11" width="115" height="22"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="22" id="85e-Ov-qM7"/>
@@ -22,28 +24,21 @@
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rate" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vxp-gw-YTt">
<rect key="frame" x="15" y="11" width="338" height="21"/>
<rect key="frame" x="8" y="11" width="347" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="IK4-8e-SFs"/>
<constraint firstAttribute="width" constant="150" id="hNG-F9-1wj"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
<variation key="default">
<mask key="constraints">
<exclude reference="hNG-F9-1wj"/>
</mask>
</variation>
</label>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="Vxp-gw-YTt" secondAttribute="bottom" constant="11" id="0Qz-iR-Tzb"/>
<constraint firstAttribute="centerY" secondItem="Vxp-gw-YTt" secondAttribute="centerY" id="4Vh-2e-m2p"/>
<constraint firstAttribute="trailing" secondItem="yhI-dj-sRk" secondAttribute="trailing" constant="10" id="NPC-r7-JFl"/>
<constraint firstAttribute="centerY" secondItem="yhI-dj-sRk" secondAttribute="centerY" id="Vw4-h8-wId"/>
<constraint firstItem="Vxp-gw-YTt" firstAttribute="leading" secondItem="hV6-xt-6pq" secondAttribute="leading" constant="15" id="Xgq-Cy-zLQ"/>
<constraint firstAttribute="trailingMargin" secondItem="yhI-dj-sRk" secondAttribute="trailing" id="W8E-PI-peE"/>
<constraint firstItem="Vxp-gw-YTt" firstAttribute="top" secondItem="hV6-xt-6pq" secondAttribute="top" constant="11" id="bgO-t8-Rjz"/>
<constraint firstItem="Vxp-gw-YTt" firstAttribute="leading" secondItem="hV6-xt-6pq" secondAttribute="leadingMargin" id="mVS-0p-p0O"/>
<constraint firstItem="yhI-dj-sRk" firstAttribute="leading" secondItem="Vxp-gw-YTt" secondAttribute="trailing" id="n0B-tg-Pik"/>
</constraints>
</tableViewCellContentView>
@@ -1,7 +1,7 @@
// XLFormWeekDaysCell.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,7 +1,7 @@
// XLFormWeekDaysCell.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -100,6 +100,14 @@ NSString *const kSaturday = @"saturday";
self.thursdayButton.selected = [[value objectForKey:kThursday] boolValue];
self.fridayButton.selected = [[value objectForKey:kFriday] boolValue];
self.saturdayButton.selected = [[value objectForKey:kSaturday] boolValue];
[self.sundayButton setAlpha:((self.rowDescriptor.isDisabled) ? .6 : 1)];
[self.mondayButton setAlpha:self.sundayButton.alpha];
[self.tuesdayButton setAlpha:self.sundayButton.alpha];
[self.wednesdayButton setAlpha:self.sundayButton.alpha];
[self.thursdayButton setAlpha:self.sundayButton.alpha];
[self.fridayButton setAlpha:self.sundayButton.alpha];
[self.saturdayButton setAlpha:self.sundayButton.alpha];
}
-(NSString *)getDayFormButton:(id)sender
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
@@ -10,11 +11,12 @@
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="60" id="piA-L5-eiN" customClass="XLFormWeekDaysCell">
<rect key="frame" x="0.0" y="0.0" width="382" height="50"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="piA-L5-eiN" id="Yr6-3E-keb">
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" tableViewCell="piA-L5-eiN" id="Yr6-3E-keb">
<rect key="frame" x="0.0" y="0.0" width="382" height="49"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZAg-Me-yKR">
<rect key="frame" x="5" y="0.0" width="53" height="49"/>
<rect key="frame" x="8" y="0.0" width="52" height="49"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<state key="normal" title="S">
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
@@ -28,14 +30,14 @@
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UjQ-Cw-7wH" userLabel="separator 1">
<rect key="frame" x="58" y="10" width="1" height="29"/>
<rect key="frame" x="60" y="10" width="1" height="29"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="K3N-3h-MZr"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="N3w-qP-kRZ">
<rect key="frame" x="58" y="0.0" width="53" height="49"/>
<rect key="frame" x="60" y="0.0" width="53" height="49"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<state key="normal" title="M">
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
@@ -46,14 +48,14 @@
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kwc-0w-V51" userLabel="separator 2">
<rect key="frame" x="111" y="10" width="1" height="29"/>
<rect key="frame" x="113" y="10" width="1" height="29"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="3mE-sT-ql1"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cPl-47-rS8">
<rect key="frame" x="111" y="0.0" width="53" height="49"/>
<rect key="frame" x="113" y="0.0" width="52" height="49"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<state key="normal" title="T">
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
@@ -64,14 +66,14 @@
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="EiN-2p-Oig" userLabel="separator 3">
<rect key="frame" x="164" y="10" width="1" height="29"/>
<rect key="frame" x="165" y="10" width="1" height="29"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="JyW-GC-0A7"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6iC-Cl-RyI">
<rect key="frame" x="164" y="0.0" width="54" height="49"/>
<rect key="frame" x="165" y="0.0" width="52" height="49"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<state key="normal" title="W">
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
@@ -82,14 +84,14 @@
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bRc-5e-QAH" userLabel="separator 4">
<rect key="frame" x="218" y="10" width="1" height="29"/>
<rect key="frame" x="217" y="10" width="1" height="29"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="W9F-iR-Leh"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eTo-Ip-reh">
<rect key="frame" x="218" y="0.0" width="53" height="49"/>
<rect key="frame" x="217" y="0.0" width="52" height="49"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<state key="normal" title="T">
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
@@ -100,14 +102,14 @@
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dHj-rj-mjh" userLabel="separator 5">
<rect key="frame" x="271" y="10" width="1" height="29"/>
<rect key="frame" x="269" y="10" width="1" height="29"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="h5U-x0-9nJ"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Wjb-tu-QEo">
<rect key="frame" x="271" y="0.0" width="53" height="49"/>
<rect key="frame" x="269" y="0.0" width="53" height="49"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<state key="normal" title="F">
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
@@ -118,14 +120,14 @@
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L7g-lu-boa" userLabel="separator 6">
<rect key="frame" x="324" y="10" width="1" height="29"/>
<rect key="frame" x="322" y="10" width="1" height="29"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="81t-Xh-wZT"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LNf-b4-GYP">
<rect key="frame" x="324" y="0.0" width="53" height="49"/>
<rect key="frame" x="322" y="0.0" width="52" height="49"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<state key="normal" title="S">
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
@@ -137,15 +139,9 @@
</button>
</subviews>
<constraints>
<constraint firstItem="ZAg-Me-yKR" firstAttribute="leading" secondItem="Yr6-3E-keb" secondAttribute="leading" constant="5" id="0EB-cP-ogn"/>
<constraint firstItem="6iC-Cl-RyI" firstAttribute="width" secondItem="cPl-47-rS8" secondAttribute="width" id="1ZI-HN-9ew"/>
<constraint firstItem="cPl-47-rS8" firstAttribute="leading" secondItem="N3w-qP-kRZ" secondAttribute="trailing" id="1pQ-h0-SEG"/>
<constraint firstItem="eTo-Ip-reh" firstAttribute="leading" secondItem="6iC-Cl-RyI" secondAttribute="trailing" constant="1" id="2UA-Ao-KZF"/>
<constraint firstItem="dHj-rj-mjh" firstAttribute="height" secondItem="L7g-lu-boa" secondAttribute="height" id="4dj-Xx-ksP"/>
<constraint firstAttribute="bottom" secondItem="EiN-2p-Oig" secondAttribute="bottom" constant="10" id="5eK-Bu-wpU"/>
<constraint firstItem="N3w-qP-kRZ" firstAttribute="leading" secondItem="ZAg-Me-yKR" secondAttribute="trailing" id="67F-sV-r6W"/>
<constraint firstItem="Wjb-tu-QEo" firstAttribute="leading" secondItem="dHj-rj-mjh" secondAttribute="trailing" id="6ZX-Ub-2vw"/>
<constraint firstItem="EiN-2p-Oig" firstAttribute="height" secondItem="bRc-5e-QAH" secondAttribute="height" id="7Um-cV-f7p"/>
<constraint firstItem="LNf-b4-GYP" firstAttribute="trailing" secondItem="Yr6-3E-keb" secondAttribute="trailingMargin" id="7Kc-RO-8KK"/>
<constraint firstItem="LNf-b4-GYP" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="7YT-x4-m88"/>
<constraint firstItem="6iC-Cl-RyI" firstAttribute="trailing" secondItem="bRc-5e-QAH" secondAttribute="leading" id="ABd-MQ-9sp"/>
<constraint firstAttribute="bottom" secondItem="UjQ-Cw-7wH" secondAttribute="bottom" constant="10" id="ASC-xR-Yxa"/>
@@ -153,87 +149,43 @@
<constraint firstItem="6iC-Cl-RyI" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="Aac-10-vTs"/>
<constraint firstItem="eTo-Ip-reh" firstAttribute="leading" secondItem="6iC-Cl-RyI" secondAttribute="trailing" id="BL5-PL-pac"/>
<constraint firstAttribute="bottom" secondItem="ZAg-Me-yKR" secondAttribute="bottom" id="BeZ-ar-qMN"/>
<constraint firstItem="dHj-rj-mjh" firstAttribute="height" secondItem="bRc-5e-QAH" secondAttribute="height" id="DYn-Cd-g5H"/>
<constraint firstAttribute="bottom" secondItem="kwc-0w-V51" secondAttribute="bottom" constant="10" id="EXu-BP-ftM"/>
<constraint firstAttribute="bottom" secondItem="LNf-b4-GYP" secondAttribute="bottom" id="EYe-ne-rqO"/>
<constraint firstItem="cPl-47-rS8" firstAttribute="leading" secondItem="N3w-qP-kRZ" secondAttribute="trailing" id="Fo8-Tp-bkn"/>
<constraint firstItem="dHj-rj-mjh" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="GYq-pf-vR0"/>
<constraint firstItem="cPl-47-rS8" firstAttribute="leading" secondItem="UjQ-Cw-7wH" secondAttribute="trailing" constant="72" id="HQ2-jA-X9g"/>
<constraint firstItem="Wjb-tu-QEo" firstAttribute="leading" secondItem="eTo-Ip-reh" secondAttribute="trailing" id="I0s-Ze-pwV"/>
<constraint firstAttribute="bottom" secondItem="bRc-5e-QAH" secondAttribute="bottom" constant="10" id="InL-Hk-twg"/>
<constraint firstItem="UjQ-Cw-7wH" firstAttribute="leading" secondItem="ZAg-Me-yKR" secondAttribute="trailing" id="Jj4-jg-rdr"/>
<constraint firstItem="6iC-Cl-RyI" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" id="KQe-Ei-8jY"/>
<constraint firstItem="cPl-47-rS8" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="Kw5-3R-qXs"/>
<constraint firstItem="bRc-5e-QAH" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="MXG-vB-U8F"/>
<constraint firstItem="ZAg-Me-yKR" firstAttribute="width" secondItem="N3w-qP-kRZ" secondAttribute="width" id="Mem-UJ-5Js"/>
<constraint firstItem="L7g-lu-boa" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="OVT-GJ-zq8"/>
<constraint firstItem="kwc-0w-V51" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" constant="25" id="OYQ-8o-3j8"/>
<constraint firstItem="N3w-qP-kRZ" firstAttribute="width" secondItem="cPl-47-rS8" secondAttribute="width" id="Pl6-Xd-Krq"/>
<constraint firstItem="Wjb-tu-QEo" firstAttribute="width" secondItem="LNf-b4-GYP" secondAttribute="width" id="Pro-fg-wBA"/>
<constraint firstAttribute="bottom" secondItem="6iC-Cl-RyI" secondAttribute="bottom" id="Q5M-8N-hIh"/>
<constraint firstItem="UjQ-Cw-7wH" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="RGn-ja-FRD"/>
<constraint firstAttribute="trailing" secondItem="LNf-b4-GYP" secondAttribute="trailing" constant="5" id="RlS-d5-rIx"/>
<constraint firstItem="kwc-0w-V51" firstAttribute="trailing" secondItem="cPl-47-rS8" secondAttribute="leading" id="Rs4-Pl-R8X"/>
<constraint firstItem="eTo-Ip-reh" firstAttribute="leading" secondItem="bRc-5e-QAH" secondAttribute="trailing" id="SO9-U6-cVO"/>
<constraint firstAttribute="bottom" secondItem="N3w-qP-kRZ" secondAttribute="bottom" id="STf-aE-Y2E"/>
<constraint firstAttribute="bottom" secondItem="kwc-0w-V51" secondAttribute="bottom" constant="10" id="SWG-oy-aZJ"/>
<constraint firstItem="kwc-0w-V51" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="TAb-IV-m7A"/>
<constraint firstAttribute="bottom" secondItem="cPl-47-rS8" secondAttribute="bottom" id="Tmp-md-564"/>
<constraint firstItem="kwc-0w-V51" firstAttribute="height" secondItem="UjQ-Cw-7wH" secondAttribute="height" id="Uli-Qb-6Om"/>
<constraint firstItem="6iC-Cl-RyI" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" id="VcV-kz-XBb"/>
<constraint firstItem="eTo-Ip-reh" firstAttribute="width" secondItem="6iC-Cl-RyI" secondAttribute="width" id="X0k-jG-o63"/>
<constraint firstItem="Wjb-tu-QEo" firstAttribute="leading" secondItem="eTo-Ip-reh" secondAttribute="trailing" id="cOc-P1-ZhU"/>
<constraint firstItem="LNf-b4-GYP" firstAttribute="leading" secondItem="Wjb-tu-QEo" secondAttribute="trailing" id="dSr-cr-ebR"/>
<constraint firstItem="EiN-2p-Oig" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="fgT-6k-CaP"/>
<constraint firstItem="LNf-b4-GYP" firstAttribute="leading" secondItem="Wjb-tu-QEo" secondAttribute="trailing" id="gNl-wJ-ujY"/>
<constraint firstItem="ZAg-Me-yKR" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="glN-lT-q1z"/>
<constraint firstItem="eTo-Ip-reh" firstAttribute="width" secondItem="Wjb-tu-QEo" secondAttribute="width" id="hEH-9C-pGZ"/>
<constraint firstItem="EiN-2p-Oig" firstAttribute="height" secondItem="kwc-0w-V51" secondAttribute="height" id="hOI-fd-H7m"/>
<constraint firstItem="eTo-Ip-reh" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="i5C-wG-rRN"/>
<constraint firstItem="eTo-Ip-reh" firstAttribute="trailing" secondItem="dHj-rj-mjh" secondAttribute="leading" id="jsw-H6-2gQ"/>
<constraint firstItem="kwc-0w-V51" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" id="lQE-r9-9JT"/>
<constraint firstAttribute="bottom" secondItem="L7g-lu-boa" secondAttribute="bottom" constant="10" id="lv1-xB-0zR"/>
<constraint firstItem="kwc-0w-V51" firstAttribute="leading" secondItem="N3w-qP-kRZ" secondAttribute="trailing" id="oQe-Qf-9ZO"/>
<constraint firstItem="Wjb-tu-QEo" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="pn7-s8-fDj"/>
<constraint firstItem="EiN-2p-Oig" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" id="qIf-aB-2ZY"/>
<constraint firstItem="6iC-Cl-RyI" firstAttribute="leading" secondItem="EiN-2p-Oig" secondAttribute="trailing" id="sAE-Nl-Puc"/>
<constraint firstItem="LNf-b4-GYP" firstAttribute="leading" secondItem="L7g-lu-boa" secondAttribute="trailing" id="t1q-Nc-vbg"/>
<constraint firstItem="kwc-0w-V51" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" constant="10" id="tVL-uj-6Ma"/>
<constraint firstItem="Wjb-tu-QEo" firstAttribute="trailing" secondItem="L7g-lu-boa" secondAttribute="leading" id="u3Q-pF-E3A"/>
<constraint firstAttribute="bottom" secondItem="Wjb-tu-QEo" secondAttribute="bottom" id="uh4-LM-Ieo"/>
<constraint firstItem="kwc-0w-V51" firstAttribute="leading" secondItem="cPl-47-rS8" secondAttribute="trailing" constant="25" id="vrx-0B-GOB"/>
<constraint firstItem="ZAg-Me-yKR" firstAttribute="leading" secondItem="Yr6-3E-keb" secondAttribute="leadingMargin" id="w9K-VP-JpE"/>
<constraint firstAttribute="bottom" secondItem="eTo-Ip-reh" secondAttribute="bottom" id="xIu-Vy-Nff"/>
<constraint firstItem="N3w-qP-kRZ" firstAttribute="leading" secondItem="UjQ-Cw-7wH" secondAttribute="trailing" id="xWy-Uf-QEm"/>
<constraint firstItem="N3w-qP-kRZ" firstAttribute="leading" secondItem="ZAg-Me-yKR" secondAttribute="trailing" id="xsx-BM-yQ5"/>
<constraint firstItem="N3w-qP-kRZ" firstAttribute="top" secondItem="Yr6-3E-keb" secondAttribute="top" id="yEX-Wv-CZQ"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="67F-sV-r6W"/>
<exclude reference="xWy-Uf-QEm"/>
<exclude reference="1pQ-h0-SEG"/>
<exclude reference="HQ2-jA-X9g"/>
<exclude reference="OYQ-8o-3j8"/>
<exclude reference="Rs4-Pl-R8X"/>
<exclude reference="SWG-oy-aZJ"/>
<exclude reference="TAb-IV-m7A"/>
<exclude reference="Uli-Qb-6Om"/>
<exclude reference="lQE-r9-9JT"/>
<exclude reference="vrx-0B-GOB"/>
<exclude reference="KQe-Ei-8jY"/>
<exclude reference="sAE-Nl-Puc"/>
<exclude reference="7Um-cV-f7p"/>
<exclude reference="hOI-fd-H7m"/>
<exclude reference="2UA-Ao-KZF"/>
<exclude reference="SO9-U6-cVO"/>
<exclude reference="6ZX-Ub-2vw"/>
<exclude reference="cOc-P1-ZhU"/>
<exclude reference="4dj-Xx-ksP"/>
<exclude reference="DYn-Cd-g5H"/>
<exclude reference="dSr-cr-ebR"/>
<exclude reference="t1q-Nc-vbg"/>
</mask>
</variation>
</tableViewCellContentView>
<connections>
<outlet property="fridayButton" destination="Wjb-tu-QEo" id="AcP-Qg-i9P"/>
@@ -244,7 +196,7 @@
<outlet property="tuesdayButton" destination="cPl-47-rS8" id="wIn-mO-cUx"/>
<outlet property="wednesdayButton" destination="6iC-Cl-RyI" id="GQe-Oy-pcd"/>
</connections>
<point key="canvasLocation" x="296" y="222"/>
<point key="canvasLocation" x="443" y="197"/>
</tableViewCell>
</objects>
</document>
@@ -0,0 +1,35 @@
//
// DateAndTimeValueTransformer.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Foundation/Foundation.h>
@interface DateValueTrasformer : NSValueTransformer
@end
@interface DateTimeValueTrasformer : NSValueTransformer
@end
@interface DateAndTimeValueTrasformer : NSValueTransformer
@end
@@ -0,0 +1,89 @@
//
// DateAndTimeValueTransformer.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "DateAndTimeValueTrasformer.h"
@implementation DateValueTrasformer
+ (Class)transformedValueClass
{
return [NSString class];
}
+ (BOOL)allowsReverseTransformation
{
return NO;
}
- (id)transformedValue:(id)value
{
if (!value) return nil;
if ([value isKindOfClass:[NSDate class]]){
NSDate * date = (NSDate *)value;
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateStyle:NSDateFormatterFullStyle];
[dateFormatter setTimeStyle:NSDateFormatterNoStyle];
return [dateFormatter stringFromDate:date];
}
return nil;
}
@end
@implementation DateTimeValueTrasformer
+ (Class)transformedValueClass
{
return [NSString class];
}
+ (BOOL)allowsReverseTransformation
{
return NO;
}
- (id)transformedValue:(id)value
{
if (!value) return nil;
if ([value isKindOfClass:[NSDate class]]){
NSDate * date = (NSDate *)value;
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
[dateFormatter setTimeStyle:NSDateFormatterShortStyle];
return [dateFormatter stringFromDate:date];
}
return nil;
}
@end
@implementation DateAndTimeValueTrasformer
@end
@@ -2,7 +2,7 @@
// DatesFormViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// DatesFormViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -26,13 +26,16 @@
NSString *const kDateInline = @"dateInline";
NSString *const kTimeInline = @"timeInline";
NSString *const kDateTimeInline = @"dateTimeInline";
NSString *const kCountDownTimerInline = @"countDownTimerInline";
NSString *const kDatePicker = @"datePicker";
NSString *const kDate = @"date";
NSString *const kTime = @"time";
NSString *const kDateTime = @"dateTime";
NSString *const kCountDownTimer = @"countDownTimer";
#import "DatesFormViewController.h"
@interface DatesFormViewController() <XLFormDescriptorDelegate>
@end
@implementation DatesFormViewController
@@ -43,9 +46,10 @@ NSString *const kDateTime = @"dateTime";
if (self){
XLFormDescriptor * form;
XLFormSectionDescriptor * section;
XLFormRowDescriptor * row;
form = [XLFormDescriptor formDescriptorWithTitle:@"Dates"];
form = [XLFormDescriptor formDescriptorWithTitle:@"Date & Time"];
section = [XLFormSectionDescriptor formSectionWithTitle:@"Inline Dates"];
[form addFormSection:section];
@@ -53,18 +57,29 @@ NSString *const kDateTime = @"dateTime";
// Date
row = [XLFormRowDescriptor formRowDescriptorWithTag:kDateInline rowType:XLFormRowDescriptorTypeDateInline title:@"Date"];
row.value = [NSDate new];
[row.cellConfigAtConfigure setObject:[NSLocale localeWithLocaleIdentifier:@"FR_fr" ] forKey:@"locale"];
[section addFormRow:row];
// DateTime
// Time
row = [XLFormRowDescriptor formRowDescriptorWithTag:kTimeInline rowType:XLFormRowDescriptorTypeTimeInline title:@"Time"];
row.value = [NSDate new];
[section addFormRow:row];
// Time
// DateTime
row = [XLFormRowDescriptor formRowDescriptorWithTag:kDateTimeInline rowType:XLFormRowDescriptorTypeDateTimeInline title:@"Date Time"];
row.value = [NSDate new];
[section addFormRow:row];
// CountDownTimer
row = [XLFormRowDescriptor formRowDescriptorWithTag:kCountDownTimerInline rowType:XLFormRowDescriptorTypeCountDownTimerInline title:@"Countdown Timer"];
NSDateComponents * dateComp = [NSDateComponents new];
dateComp.hour = 0;
dateComp.minute = 7;
dateComp.timeZone = [NSTimeZone systemTimeZone];
NSCalendar * calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
row.value = [calendar dateFromComponents:dateComp];
[section addFormRow:row];
section = [XLFormSectionDescriptor formSectionWithTitle:@"Dates"];
[form addFormSection:section];
@@ -76,32 +91,76 @@ NSString *const kDateTime = @"dateTime";
[row.cellConfigAtConfigure setObject:[NSDate dateWithTimeIntervalSinceNow:(60*60*24*3)] forKey:@"maximumDate"];
[section addFormRow:row];
// DateTime
// Time
row = [XLFormRowDescriptor formRowDescriptorWithTag:kTime rowType:XLFormRowDescriptorTypeTime title:@"Time"];
[row.cellConfigAtConfigure setObject:@(10) forKey:@"minuteInterval"];
row.value = [NSDate new];
[section addFormRow:row];
// Time
// DateTime
row = [XLFormRowDescriptor formRowDescriptorWithTag:kDateTime rowType:XLFormRowDescriptorTypeDateTime title:@"Date Time"];
row.value = [NSDate new];
[section addFormRow:row];
// CountDownTimer
row = [XLFormRowDescriptor formRowDescriptorWithTag:kCountDownTimerInline rowType:XLFormRowDescriptorTypeCountDownTimer title:@"Countdown Timer"];
row.value = [calendar dateFromComponents:dateComp];
[section addFormRow:row];
section = [XLFormSectionDescriptor formSectionWithTitle:@"Disabled Dates"];
section.footerTitle = @"DatesFormViewController.h";
//section.footerTitle = @"DatesFormViewController.h";
[form addFormSection:section];
// Date
row = [XLFormRowDescriptor formRowDescriptorWithTag:kDate rowType:XLFormRowDescriptorTypeDate title:@"Date"];
row.disabled = YES;
row.disabled = @YES;
row.required = YES;
row.value = [NSDate new];
[section addFormRow:row];
// DatePicker
section = [XLFormSectionDescriptor formSectionWithTitle:@"DatePicker"];
[form addFormSection:section];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kDatePicker rowType:XLFormRowDescriptorTypeDatePicker];
[row.cellConfigAtConfigure setObject:@(UIDatePickerModeDate) forKey:@"datePicker.datePickerMode"];
row.value = [NSDate new];
[section addFormRow:row];
self.form = form;
}
return self;
}
-(void)viewDidLoad
{
[super viewDidLoad];
UIBarButtonItem * barButton = [[UIBarButtonItem alloc] initWithTitle:@"Disable" style:UIBarButtonItemStylePlain
target:self
action:@selector(disableEnable:)];
barButton.possibleTitles = [NSSet setWithObjects:@"Disable", @"Enable", nil];
self.navigationItem.rightBarButtonItem = barButton;
}
-(void)disableEnable:(UIBarButtonItem *)button
{
self.form.disabled = !self.form.disabled;
[button setTitle:(self.form.disabled ? @"Enable" : @"Disable")];
[self.tableView endEditing:YES];
[self.tableView reloadData];
}
-(void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)formRow oldValue:(id)oldValue newValue:(id)newValue
{
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:@"DatePicker"
message:@"Value Has changed!"
preferredStyle:UIAlertControllerStyleAlert];
[alertController addAction:[UIAlertAction actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:nil]];
[self presentViewController:alertController animated:YES completion:nil];
}
@end
@@ -2,7 +2,7 @@
// ExamplesFormViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// ExamplesFormViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -33,13 +33,21 @@
#import "UICustomizationFormViewController.h"
#import "CustomRowsViewController.h"
#import "AccessoryViewFormViewController.h"
#import "PredicateFormViewController.h"
#import "FormattersViewController.h"
NSString * const kTextFieldAndTextView = @"TextFieldAndTextView";
NSString * const kSelectors = @"Selectors";
NSString * const kOthes = @"Others";
NSString * const kDates = @"Dates";
NSString * const kPredicates = @"BasicPredicates";
NSString * const kBlogExample = @"BlogPredicates";
NSString * const kMultivalued = @"Multivalued";
NSString * const kMultivaluedOnlyReorder = @"MultivaluedOnlyReorder";
NSString * const kMultivaluedOnlyInsert = @"MultivaluedOnlyInsert";
NSString * const kMultivaluedOnlyDelete = @"MultivaluedOnlyDelete";
NSString * const kValidations= @"Validations";
NSString * const kFormatters = @"Formatters";
@interface ExamplesFormViewController ()
@@ -83,7 +91,7 @@ NSString * const kValidations= @"Validations";
// NativeEventFormViewController
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"realExamples" rowType:XLFormRowDescriptorTypeButton title:@"iOS Calendar Event Form"];
row.action.formSegueIdenfifier = @"NativeEventNavigationViewControllerSegue";
row.action.formSegueIdentifier = @"NativeEventNavigationViewControllerSegue";
[section addFormRow:row];
@@ -99,27 +107,45 @@ NSString * const kValidations= @"Validations";
// Selectors
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectors rowType:XLFormRowDescriptorTypeButton title:@"Selectors"];
row.action.formSegueIdenfifier = @"SelectorsFormViewControllerSegue";
row.action.formSegueIdentifier = @"SelectorsFormViewControllerSegue";
[section addFormRow:row];
// Dates
row = [XLFormRowDescriptor formRowDescriptorWithTag:kDates rowType:XLFormRowDescriptorTypeButton title:@"Dates"];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kDates rowType:XLFormRowDescriptorTypeButton title:@"Date & Time"];
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.formSegueIdenfifier = @"OthersFormViewControllerSegue";
row.action.formSegueIdentifier = @"OthersFormViewControllerSegue";
[section addFormRow:row];
section = [XLFormSectionDescriptor formSectionWithTitle:@"Multivalued example"];
[form addFormSection:section];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kMultivalued rowType:XLFormRowDescriptorTypeButton title:@"MultiValued Sections"];
row.action.viewControllerClass = [MultiValuedFormViewController class];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kMultivalued rowType:XLFormRowDescriptorTypeButton title:@"Multivalued Sections"];
row.action.viewControllerClass = [MultivaluedFormViewController class];
[section addFormRow:row];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kMultivaluedOnlyReorder rowType:XLFormRowDescriptorTypeButton title:@"Multivalued Only Reorder"];
row.action.viewControllerClass = [MultivaluedOnlyReorderViewController class];
[section addFormRow:row];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kMultivaluedOnlyInsert rowType:XLFormRowDescriptorTypeButton title:@"Multivalued Only Insert"];
row.action.viewControllerClass = [MultivaluedOnlyInserViewController class];
[section addFormRow:row];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kMultivaluedOnlyDelete rowType:XLFormRowDescriptorTypeButton title:@"Multivalued Only Delete"];
row.action.viewControllerClass = [MultivaluedOnlyDeleteViewController class];
[section addFormRow:row];
section = [XLFormSectionDescriptor formSectionWithTitle:@"UI Customization"];
[form addFormSection:section];
@@ -147,7 +173,22 @@ NSString * const kValidations= @"Validations";
[form addFormSection:section];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kValidations rowType:XLFormRowDescriptorTypeButton title:@"Validation Examples"];
row.action.formSegueIdenfifier = @"ValidationExamplesFormViewControllerSegue";
row.action.formSegueIdentifier = @"ValidationExamplesFormViewControllerSegue";
[section addFormRow:row];
section = [XLFormSectionDescriptor formSectionWithTitle:@"Using Predicates"];
[form addFormSection:section];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kPredicates rowType:XLFormRowDescriptorTypeButton title:@"Very basic predicates"];
row.action.formSegueIdentifier = @"BasicPredicateViewControllerSegue";
[section addFormRow:row];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kPredicates rowType:XLFormRowDescriptorTypeButton title:@"Blog Example Hide predicates"];
row.action.formSegueIdentifier = @"BlogExampleViewSegue";
[section addFormRow:row];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kPredicates rowType:XLFormRowDescriptorTypeButton title:@"Another example"];
row.action.formSegueIdentifier = @"PredicateFormViewControllerSegue";
[section addFormRow:row];
self.form = form;
@@ -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,120 @@
//
// 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, strong) 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];
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"megabytes" rowType:XLFormRowDescriptorTypeInfo title:@"Megabytes"];
row.valueFormatter = [NSByteCountFormatter new];
row.value = @(1024);
[section addFormRow:row];
section = [XLFormSectionDescriptor formSection];
[formDescriptor addFormSection:section];
return [super initWithForm:formDescriptor];
}
@end
@@ -2,7 +2,7 @@
// InputsFormViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// InputsFormViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -30,6 +30,7 @@
NSString *const kName = @"name";
NSString *const kEmail = @"email";
NSString *const kTwitter = @"twitter";
NSString *const kZipCode = @"zipCode";
NSString *const kNumber = @"number";
NSString *const kInteger = @"integer";
NSString *const kDecimal = @"decimal";
@@ -68,10 +69,14 @@ NSString *const kNotes = @"notes";
// Twitter
row = [XLFormRowDescriptor formRowDescriptorWithTag:kTwitter rowType:XLFormRowDescriptorTypeTwitter title:@"Twitter"];
row.disabled = YES;
row.disabled = @YES;
row.value = @"@no_editable";
[section addFormRow:row];
// Zip Code
row = [XLFormRowDescriptor formRowDescriptorWithTag:kZipCode rowType:XLFormRowDescriptorTypeZipCode title:@"Zip Code"];
[section addFormRow:row];
// Number
row = [XLFormRowDescriptor formRowDescriptorWithTag:kNumber rowType:XLFormRowDescriptorTypeNumber title:@"Number"];
[section addFormRow:row];
@@ -110,14 +115,6 @@ NSString *const kNotes = @"notes";
row = [XLFormRowDescriptor formRowDescriptorWithTag:kNotes rowType:XLFormRowDescriptorTypeTextView title:@"Notes"];
[section addFormRow:row];
section = [XLFormSectionDescriptor formSectionWithTitle:@"Dynamic Text View"];
[formDescriptor addFormSection:section];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kTextView rowType:XLFormRowDescriptorTypeDynamicTextView];
[row.cellConfigAtConfigure setObject:@"DYNAMIC TEXT VIEW EXAMPLE" forKey:@"textView.placeholder"];
[row.cellConfigAtConfigure setObject:@(50) forKey:@"defaultHeight"];
[section addFormRow:row];
return [super initWithForm:formDescriptor];
}
@@ -129,7 +126,7 @@ NSString *const kNotes = @"notes";
}
-(IBAction)savePressed:(UIBarButtonItem * __unused)button
-(void)savePressed:(UIBarButtonItem * __unused)button
{
NSArray * validationErrors = [self formValidationErrors];
if (validationErrors.count > 0){
@@ -137,8 +134,14 @@ NSString *const kNotes = @"notes";
return;
}
[self.tableView endEditing:YES];
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Valid Form", nil) message:@"No errors found" delegate:self cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil];
[alertView show];
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Valid Form", nil)
message:@"No errors found"
preferredStyle:UIAlertControllerStyleAlert];
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
style:UIAlertActionStyleDefault
handler:nil]];
[self presentViewController:alertController animated:YES completion:nil];
}
@end
@@ -2,7 +2,7 @@
// MultiValuedFormViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -25,6 +25,21 @@
#import "XLFormViewController.h"
@interface MultiValuedFormViewController : XLFormViewController
@interface MultivaluedFormViewController : XLFormViewController
@end
@interface MultivaluedOnlyReorderViewController : XLFormViewController
@end
@interface MultivaluedOnlyInserViewController : XLFormViewController
@end
@interface MultivaluedOnlyDeleteViewController : XLFormViewController
@end
@@ -2,7 +2,7 @@
// MultiValuedFormViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -25,10 +25,10 @@
#import "XLForm.h"
#import "SelectorsFormViewController.h"
#import "MultiValuedFormViewController.h"
#import "MultivaluedFormViewController.h"
@implementation MultiValuedFormViewController
@implementation MultivaluedFormViewController
- (id)init
{
@@ -36,61 +36,41 @@
XLFormSectionDescriptor * section;
XLFormRowDescriptor * row;
NSArray * nameList = @[@"family", @"male", @"female", @"client"];
form = [XLFormDescriptor formDescriptorWithTitle:@"Multivalued Examples"];
form = [XLFormDescriptor formDescriptorWithTitle:@"MultiValued Examples"];
// MultivaluedSection section
section = [XLFormSectionDescriptor formSectionWithTitle:@"MultiValued TextField" multivaluedSection:YES];
section.multiValuedTag = @"textFieldRow";
// Multivalued section
section = [XLFormSectionDescriptor formSectionWithTitle:@"Multivalued TextField"
sectionOptions:XLFormSectionOptionCanReorder | XLFormSectionOptionCanInsert | XLFormSectionOptionCanDelete
sectionInsertMode:XLFormSectionInsertModeButton];
section.multivaluedAddButton.title = @"Add New Tag";
section.footerTitle = @"XLFormSectionInsertModeButton sectionType adds a 'Add Item' (Add New Tag) button row as last cell.";
// set up the row template
row = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeName];
[[row cellConfig] setObject:@"Tag Name" forKey:@"textField.placeholder"];
section.multivaluedRowTemplate = row;
[form addFormSection:section];
for (NSString * tag in nameList) {
// add a row to the section, the row will be used to crete new rows.
row = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeText];
[[row cellConfig] setObject:@"Add a new tag" forKey:@"textField.placeholder"];
row.value = [tag copy];
[section addFormRow:row];
}
// add a row to the section, the row will be used to crete new rows.
row = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeText];
[[row cellConfig] setObject:@"Add a new tag" forKey:@"textField.placeholder"];
[section addFormRow:row];
// Another MultivaluedSection section
section = [XLFormSectionDescriptor formSectionWithTitle:@"MultiValued ActionSheet Selector example" multivaluedSection:YES];
section.multiValuedTag = @"actionSheetSelector";
// Another Multivalued section
section = [XLFormSectionDescriptor formSectionWithTitle:@"Multivalued ActionSheet Selector example"
sectionOptions:XLFormSectionOptionCanInsert | XLFormSectionOptionCanDelete];
section.footerTitle = @"XLFormSectionInsertModeLastRow sectionType adds a '+' icon inside last table view cell allowing us to add a new row.";
[form addFormSection:section];
row = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeSelectorActionSheet title:@"Tap to select.."];
row.selectorOptions = @[[XLFormOptionsObject formOptionsObjectWithValue:@(0) displayText:@"Option 1"],
[XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:@"Option 2"],
[XLFormOptionsObject formOptionsObjectWithValue:@(2) displayText:@"Option 3"],
[XLFormOptionsObject formOptionsObjectWithValue:@(3) displayText:@"Option 4"],
[XLFormOptionsObject formOptionsObjectWithValue:@(4) displayText:@"Option 5"]
];
row.selectorOptions = @[@"Option 1", @"Option 2", @"Option 3", @"Option 4", @"Option 5"];
[section addFormRow:row];
// Another one
section = [XLFormSectionDescriptor formSectionWithTitle:@"MultiValued Push Selector example" multivaluedSection:YES];
section.footerTitle = @"MultiValuedFormViewController.h";
section.multiValuedTag = @"multivaluedPushSelector";
section = [XLFormSectionDescriptor formSectionWithTitle:@"Multivalued Push Selector example"
sectionOptions:XLFormSectionOptionCanInsert | XLFormSectionOptionCanDelete | XLFormSectionOptionCanReorder
sectionInsertMode:XLFormSectionInsertModeButton];
section.footerTitle = @"MultivaluedFormViewController.h";
[form addFormSection:section];
row = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeSelectorPush title:@"Tap to select ;).."];
row.selectorOptions = @[[XLFormOptionsObject formOptionsObjectWithValue:@(0) displayText:@"Option 1"],
[XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:@"Option 2"],
[XLFormOptionsObject formOptionsObjectWithValue:@(2) displayText:@"Option 3"]
];
row.selectorOptions = @[@"Option 1", @"Option 2", @"Option 3"];
section.multivaluedRowTemplate = [row copy];
[section addFormRow:row];
return [super initWithForm:form];
}
@@ -105,32 +85,202 @@
-(void)addDidTouch:(UIBarButtonItem * __unused)sender
{
UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Remove Last Section" otherButtonTitles:@"Add a section at the end", nil];
[actionSheet showInView:self.view];
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:nil
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
style:UIAlertActionStyleCancel
handler:nil]];
__weak __typeof(self)weakSelf = self;
[alertController addAction:[UIAlertAction actionWithTitle:@"Remove Last Section"
style:UIAlertActionStyleDestructive
handler:^(UIAlertAction *action) {
if (weakSelf.form.formSections.count > 0){
// remove last section
[weakSelf.form removeFormSectionAtIndex:(weakSelf.form.formSections.count - 1)];
}
}]];
}
#pragma mark - UIActionSheetDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if ([actionSheet destructiveButtonIndex] == buttonIndex){
if (self.form.formSections.count > 0){
// remove last section
[self.form removeFormSectionAtIndex:(self.form.formSections.count - 1)];
}
}
else if ([[actionSheet buttonTitleAtIndex:buttonIndex] isEqualToString:@"Add a section at the end"]){
// add a new section
XLFormSectionDescriptor * newSection = [XLFormSectionDescriptor formSectionWithTitle:[NSString stringWithFormat:@"Section created at %@", [NSDateFormatter localizedStringFromDate:[NSDate new] dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterShortStyle]] multivaluedSection:YES];
newSection.multiValuedTag = [NSString stringWithFormat:@"multivaluedPushSelector_%@", @(self.form.formSections.count)];
XLFormRowDescriptor * newRow = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeSelectorPush title:@"Tap to select ;).."];
newRow.selectorOptions = @[[XLFormOptionsObject formOptionsObjectWithValue:@(0) displayText:@"Option 1"],
[XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:@"Option 2"],
[XLFormOptionsObject formOptionsObjectWithValue:@(2) displayText:@"Option 3"]];
[newSection addFormRow:newRow];
[self.form addFormSection:newSection];
}
[alertController addAction:[UIAlertAction actionWithTitle:@"Add a section at the end"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
// add a new section
XLFormSectionDescriptor * newSection = [XLFormSectionDescriptor formSectionWithTitle:[NSString stringWithFormat:@"Section created at %@", [NSDateFormatter localizedStringFromDate:[NSDate new] dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterShortStyle]] sectionOptions:XLFormSectionOptionCanInsert | XLFormSectionOptionCanDelete];
newSection.multivaluedTag = [NSString stringWithFormat:@"multivaluedPushSelector_%@", @(weakSelf.form.formSections.count)];
XLFormRowDescriptor * newRow = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeSelectorPush title:@"Tap to select ;).."];
newRow.selectorOptions = @[@"Option 1", @"Option 2", @"Option 3"];
[newSection addFormRow:newRow];
[weakSelf.form addFormSection:newSection];
}]];
[alertController addAction:[UIAlertAction actionWithTitle:self.form.isDisabled ? @"Enable Form" : @"Disable Form"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
weakSelf.form.disabled = !weakSelf.form.disabled;
[weakSelf.tableView endEditing:YES];
[weakSelf.tableView reloadData];
}]];
[self presentViewController:alertController animated:YES completion:nil];
}
@end
@implementation MultivaluedOnlyReorderViewController
- (id)init
{
NSTimeInterval secondsPerDay = 24 * 60 * 60;
NSArray * list = @[@"Today", @"Yesterday", @"Before Yesterday"];
XLFormDescriptor * form;
XLFormSectionDescriptor * section;
form = [XLFormDescriptor formDescriptorWithTitle:@"Only Reorder Examples"];
// Multivalued Section with inline rows - section set up to support only reordering
section = [XLFormSectionDescriptor formSectionWithTitle:@"Reordering Inline Rows"
sectionOptions:XLFormSectionOptionCanReorder];
section.footerTitle = @"XLFormRowDescriptorTypeDateInline row type";
[form addFormSection:section];
[list enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
XLFormRowDescriptor * row = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeDateInline];
row.value = [NSDate dateWithTimeIntervalSinceNow:(-secondsPerDay * idx)];
row.title = obj;
[section addFormRow:row];
}];
// Multivalued Section with common rows - section set up to support only reordering
section = [XLFormSectionDescriptor formSectionWithTitle:@"Reordering Rows"
sectionOptions:XLFormSectionOptionCanReorder];
section.footerTitle = @"XLFormRowDescriptorTypeInfo row type";
[form addFormSection:section];
[list enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
XLFormRowDescriptor * row = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeInfo];
row.value = [NSDateFormatter localizedStringFromDate:[NSDate dateWithTimeIntervalSinceNow:(-secondsPerDay * idx)] dateStyle:NSDateFormatterMediumStyle timeStyle:NSDateFormatterNoStyle];
row.title = obj;
[section addFormRow:row];
}];
return [super initWithForm:form];
}
@end
@implementation MultivaluedOnlyInserViewController
- (id)init
{
XLFormDescriptor * form;
XLFormSectionDescriptor * section;
XLFormRowDescriptor * row;
NSArray * nameList = @[@"family", @"male", @"female", @"client"];
form = [XLFormDescriptor formDescriptorWithTitle:@"Multivalued Only Insert"];
section = [XLFormSectionDescriptor formSectionWithTitle:@"XLFormSectionInsertModeButton"
sectionOptions:XLFormSectionOptionCanInsert
sectionInsertMode:XLFormSectionInsertModeButton];
[form addFormSection:section];
row = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeText];
[[row cellConfig] setObject:@"Add a new tag" forKey:@"textField.placeholder"];
section.multivaluedRowTemplate = row;
section = [XLFormSectionDescriptor formSectionWithTitle:@"XLFormSectionInsertModeButton With Inline Cells"
sectionOptions:XLFormSectionOptionCanInsert
sectionInsertMode:XLFormSectionInsertModeButton];
[form addFormSection:section];
row = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeDateInline];
row.value = [NSDate new];
row.title = @"Date";
section.multivaluedRowTemplate = row;
section = [XLFormSectionDescriptor formSectionWithTitle:@"XLFormSectionInsertModeLastRow"
sectionOptions:XLFormSectionOptionCanInsert
sectionInsertMode:XLFormSectionInsertModeLastRow];
[form addFormSection:section];
for (NSString * tag in nameList) {
// add a row to the section, the row will be used to crete new rows.
row = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeText];
[[row cellConfig] setObject:@"Add a new tag" forKey:@"textField.placeholder"];
row.value = tag;
[section addFormRow:row];
}
return [super initWithForm:form];
}
@end
@implementation MultivaluedOnlyDeleteViewController
- (id)init
{
XLFormDescriptor * form;
XLFormSectionDescriptor * section;
XLFormRowDescriptor * row;
NSArray * nameList = @[@"family", @"male", @"female", @"client"];
form = [XLFormDescriptor formDescriptor];
// MultivaluedSection section
section = [XLFormSectionDescriptor formSectionWithTitle:@""
sectionOptions:XLFormSectionOptionCanDelete];
section.footerTitle = @"you can swipe to delete when table.editing = NO (Not Editing)";
[form addFormSection:section];
for (NSString * tag in nameList) {
row = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeText];
[[row cellConfig] setObject:@"Add a new tag" forKey:@"textField.placeholder"];
row.value = [tag copy];
[section addFormRow:row];
}
// Multivalued Section with inline row.
section = [XLFormSectionDescriptor formSectionWithTitle:@""
sectionOptions:XLFormSectionOptionCanDelete];
section.footerTitle = @"you can swipe to delete when table.editing = NO (Not Editing)";
[form addFormSection:section];
for (NSUInteger i = 0; i < 4; i++) {
row = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeSelectorPickerViewInline];
row.title = @"Tap to select";
row.value = @"client";
row.selectorOptions = nameList;
[section addFormRow:row];
}
return [super initWithForm:form];
}
-(void)viewDidLoad
{
[super viewDidLoad];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Editing" style:UIBarButtonItemStylePlain target:self action:@selector(toggleEditing:)];
}
-(void)toggleEditing:(UIBarButtonItem *)barButtonItem
{
[self.tableView setEditing:!self.tableView.editing animated:YES];
[barButtonItem setTitle:(self.tableView.editing ? @"Editing" : @"Not Editing")];
}
@end
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 5.1 MiB

@@ -2,7 +2,7 @@
// XLFormCustomCell.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// XLFormCustomCell.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -30,23 +30,20 @@
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
// Initialization code
}
return self;
}
- (void)configure
{
[super configure];
//override
UIFont *labelFont = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1];
UIFontDescriptor *fontDesc = [labelFont fontDescriptor];
UIFontDescriptor *fontBoldDesc = [fontDesc fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitBold];
self.textLabel.font = [UIFont fontWithDescriptor:fontBoldDesc size:0.0f];
}
- (void)update
{
[super update];
// override
self.textLabel.text = @"Am a custom cell, select me!";
}
@@ -55,54 +52,9 @@
{
// custom code here
// i.e new behaviour when cell has been selected
self.textLabel.text = @"I can do any custom behaviour...";
self.textLabel.text = [self.textLabel.text isEqualToString:@"I can do any custom behaviour..."] ? @"Am a custom cell, select me!" : @"I can do any custom behaviour...";
self.rowDescriptor.value = self.textLabel.text;
[self.formViewController.tableView selectRowAtIndexPath:nil animated:YES scrollPosition:UITableViewScrollPositionNone];
}
/*
+(CGFloat)formDescriptorCellHeightForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor
{
// return custom cell size
return 40;
}
*/
/*
-(BOOL)formDescriptorCellBecomeFirstResponder
{
// custom code
return YES;
}
*/
/*
-(NSError *)formDescriptorCellLocalValidation
{
// custom error handler
// compare with a custom property if it should return a error
// i.e some textfield is empty etc...
if (self.rowDescriptor.required){
return [[NSError alloc] initWithDomain:XLFormErrorDomain code:XLFormErrorCodeRequired userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedString(@"%@ can't be empty", nil), self.rowDescriptor.title] }];
}
return nil;
}
*/
/*
-(NSString *)formDescriptorHttpParameterName
{
// custom code
}
*/
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
*/
@end
@@ -2,7 +2,7 @@
// XLFormImageSelectorCell.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// XLFormImageSelectorCell.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -32,7 +32,7 @@
NSString *const kFormImageSelectorCellDefaultImage = @"defaultImage";
NSString *const kFormImageSelectorCellImageRequest = @"imageRequest";
@interface XLFormImageSelectorCell() <UIActionSheetDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate>
@interface XLFormImageSelectorCell() <UINavigationControllerDelegate, UIImagePickerControllerDelegate>
@property (nonatomic) UIImage * defaultImage;
@property (nonatomic) NSURLRequest * imageRequest;
@@ -82,7 +82,6 @@ NSString *const kFormImageSelectorCellImageRequest = @"imageRequest";
NSLog(@"Failed to download image");
}];
}
[self.textLabel setFont:[UIFont preferredFontForTextStyle:UIFontTextStyleBody]];
}
@@ -93,12 +92,36 @@ NSString *const kFormImageSelectorCellImageRequest = @"imageRequest";
-(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller
{
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:self.rowDescriptor.selectorTitle delegate:self
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
destructiveButtonTitle:nil
otherButtonTitles:NSLocalizedString(@"XLFormImageSelectorCell_ChooseExistingPhoto", @"Choose Existing Photo"), NSLocalizedString(@"XLFormImageSelectorCell_TakePicture", @"Take a Picture"), nil];
actionSheet.tag = self.tag;
[actionSheet showInView:self.formViewController.view];
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:self.rowDescriptor.selectorTitle
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
style:UIAlertActionStyleCancel
handler:nil]];
__weak __typeof(self)weakSelf = self;
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"XLFormImageSelectorCell_ChooseExistingPhoto", @"Choose Existing Photo")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
UIImagePickerController * imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.delegate = weakSelf;
imagePickerController.allowsEditing = YES;
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerController.mediaTypes = @[(NSString *)kUTTypeImage];
[weakSelf.formViewController presentViewController:imagePickerController animated:YES completion:nil];
}]];
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"XLFormImageSelectorCell_TakePicture", @"Take a Picture")
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
UIImagePickerController * imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.delegate = weakSelf;
imagePickerController.allowsEditing = YES;
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePickerController.mediaTypes = @[(NSString *)kUTTypeImage];
[weakSelf.formViewController presentViewController:imagePickerController animated:YES completion:nil];
}]];
[self.formViewController presentViewController:alertController animated:YES completion:nil];
}
#pragma mark - LayoutConstraints
@@ -110,7 +133,7 @@ NSString *const kFormImageSelectorCellImageRequest = @"imageRequest";
NSDictionary *metrics = @{@"margin":@5.0};
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(margin)-[text]" options:0 metrics:metrics views:uiComponents]];
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[text]" options:0 metrics:metrics views:uiComponents]];
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(margin)-[text]" options:0 metrics:metrics views:uiComponents]];
@@ -169,25 +192,6 @@ NSString *const kFormImageSelectorCellImageRequest = @"imageRequest";
[self.textLabel removeObserver:self forKeyPath:@"text"];
}
#pragma mark - UIActionSheetDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
UIImagePickerController * imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.delegate = self;
imagePickerController.allowsEditing = YES;
if (buttonIndex == 0){
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerController.mediaTypes = @[(NSString *)kUTTypeImage];
[self.formViewController presentViewController:imagePickerController animated:YES completion:nil];
}
else if (buttonIndex == 1){
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePickerController.mediaTypes = @[(NSString *)kUTTypeImage];
[self.formViewController presentViewController:imagePickerController animated:YES completion:nil];
}
}
#pragma mark - UIImagePickerControllerDelegate
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
@@ -2,7 +2,7 @@
// OthersFormViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// OthersFormViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -25,16 +25,16 @@
#import "MapViewController.h"
#import "OthersFormViewController.h"
#import "XLFormCustomCell.h"
NSString *const kSwitchBool = @"switchBool";
NSString *const kSwitchCheck = @"switchBool";
NSString *const kSwitchCheck = @"switchCheck";
NSString *const kStepCounter = @"stepCounter";
NSString *const kSlider = @"slider";
NSString *const kSegmentedControl = @"segmentedControl";
NSString *const kCustom = @"custom";
NSString *const kInfo = @"info";
NSString *const kButton = @"button";
NSString *const kImage = @"image";
NSString *const kButtonLeftAligned = @"buttonLeftAligned";
NSString *const kButtonWithSegueId = @"buttonWithSegueId";
NSString *const kButtonWithSegueClass = @"buttonWithSegueClass";
@@ -45,7 +45,7 @@ NSString *const kButtonWithStoryboardId = @"buttonWithStoryboardId";
@implementation OthersFormViewController
- (instancetype)initWithCoder:(NSCoder *)coder
-(instancetype)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self) {
@@ -54,7 +54,7 @@ NSString *const kButtonWithStoryboardId = @"buttonWithStoryboardId";
return self;
}
- (id)init
-(instancetype)init
{
self = [super init];
if (self){
@@ -74,16 +74,23 @@ NSString *const kButtonWithStoryboardId = @"buttonWithStoryboardId";
[form addFormSection:section];
// Switch
[section addFormRow:[XLFormRowDescriptor formRowDescriptorWithTag:kSwitchBool rowType:XLFormRowDescriptorTypeBooleanSwitch title:@"Switch"]];
XLFormRowDescriptor * row = [XLFormRowDescriptor formRowDescriptorWithTag:kSwitchBool rowType:XLFormRowDescriptorTypeBooleanSwitch title:@"Switch"];
[row.cellConfigAtConfigure setObject:[UIColor redColor] forKey:@"switchControl.onTintColor"];
[section addFormRow:row];
// check
[section addFormRow:[XLFormRowDescriptor formRowDescriptorWithTag:kSwitchCheck rowType:XLFormRowDescriptorTypeBooleanCheck title:@"Check"]];
// step counter
[section addFormRow:[XLFormRowDescriptor formRowDescriptorWithTag:kStepCounter rowType:XLFormRowDescriptorTypeStepCounter title:@"Step counter"]];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kStepCounter rowType:XLFormRowDescriptorTypeStepCounter title:@"Step counter"];
row.value = @50;
[row.cellConfigAtConfigure setObject:@YES forKey:@"stepControl.wraps"];
[row.cellConfigAtConfigure setObject:@10 forKey:@"stepControl.stepValue"];
[row.cellConfigAtConfigure setObject:@10 forKey:@"stepControl.minimumValue"];
[row.cellConfigAtConfigure setObject:@100 forKey:@"stepControl.maximumValue"];
[section addFormRow:row];
// Segmented Control
XLFormRowDescriptor * row = [XLFormRowDescriptor formRowDescriptorWithTag:kSegmentedControl rowType:XLFormRowDescriptorTypeSelectorSegmentedControl title:@"Fruits"];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSegmentedControl rowType:XLFormRowDescriptorTypeSelectorSegmentedControl title:@"Fruits"];
row.selectorOptions = @[@"Apple", @"Orange", @"Pear"];
row.value = @"Pear";
[section addFormRow:row];
@@ -97,12 +104,11 @@ NSString *const kButtonWithStoryboardId = @"buttonWithStoryboardId";
[row.cellConfigAtConfigure setObject:@(4) forKey:@"steps"];
[section addFormRow:row];
// Custom cell
XLFormRowDescriptor *customRowDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kCustom rowType:@"XLFormRowDescriptorTypeCustom"];
// Must set custom cell or add custom cell to cellClassesForRowDescriptorTypes dictionary before XLFormViewController loaded
customRowDescriptor.cellClass = [XLFormCustomCell class];
[section addFormRow:customRowDescriptor];
// Image
row = [XLFormRowDescriptor formRowDescriptorWithTag:kImage rowType:XLFormRowDescriptorTypeImage title:@"Image"];
row.value = [UIImage imageNamed:@"default_avatar"];
[section addFormRow:row];
// Info cell
XLFormRowDescriptor *infoRowDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kInfo rowType:XLFormRowDescriptorTypeInfo];
infoRowDescriptor.title = @"Version";
@@ -116,22 +122,27 @@ NSString *const kButtonWithStoryboardId = @"buttonWithStoryboardId";
// Button
XLFormRowDescriptor * buttonRow = [XLFormRowDescriptor formRowDescriptorWithTag:kButton rowType:XLFormRowDescriptorTypeButton title:@"Button"];
[buttonRow.cellConfig setObject:[UIColor colorWithRed:0.0 green:122.0/255.0 blue:1.0 alpha:1.0] forKey:@"textLabel.textColor"];
buttonRow.action.formSelector = @selector(didTouchButton:);
[section addFormRow:buttonRow];
// Left Button
XLFormRowDescriptor * buttonLeftAlignedRow = [XLFormRowDescriptor formRowDescriptorWithTag:kButtonLeftAligned rowType:XLFormRowDescriptorTypeButton title:@"Button with Block"];
[buttonLeftAlignedRow.cellConfig setObject:[UIColor colorWithRed:0.0 green:122.0/255.0 blue:1.0 alpha:1.0] forKey:@"textLabel.textColor"];
[buttonLeftAlignedRow.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
[buttonLeftAlignedRow.cellConfig setObject:@(NSTextAlignmentNatural) forKey:@"textLabel.textAlignment"];
[buttonLeftAlignedRow.cellConfig setObject:@(UITableViewCellAccessoryDisclosureIndicator) forKey:@"accessoryType"];
__typeof(self) __weak weakSelf = self;
buttonLeftAlignedRow.action.formBlock = ^(XLFormRowDescriptor * sender){
if ([[sender.sectionDescriptor.formDescriptor formRowWithTag:kSwitchBool].value boolValue]){
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Switch is ON", nil) message:@"Button has checked the switch value..." delegate:self cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil];
[alertView show];
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Switch is ON", nil)
message:@"Button has checked the switch value..."
preferredStyle:UIAlertControllerStyleAlert];
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
style:UIAlertActionStyleDefault
handler:nil]];
[self presentViewController:alertController animated:YES completion:nil];
}
[self deselectFormRow:sender];
[weakSelf deselectFormRow:sender];
};
[section addFormRow:buttonLeftAlignedRow];
@@ -144,7 +155,7 @@ NSString *const kButtonWithStoryboardId = @"buttonWithStoryboardId";
// Button with SegueId
XLFormRowDescriptor * buttonWithSegueId = [XLFormRowDescriptor formRowDescriptorWithTag:kButtonWithSegueClass rowType:XLFormRowDescriptorTypeButton title:@"Button with Segue Idenfifier"];
buttonWithSegueId.action.formSegueIdenfifier = @"MapViewControllerSegue";
buttonWithSegueId.action.formSegueIdentifier = @"MapViewControllerSegue";
[section addFormRow:buttonWithSegueId];
@@ -166,10 +177,34 @@ NSString *const kButtonWithStoryboardId = @"buttonWithStoryboardId";
-(void)didTouchButton:(XLFormRowDescriptor *)sender
{
if ([[sender.sectionDescriptor.formDescriptor formRowWithTag:kSwitchBool].value boolValue]){
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Switch is ON", nil) message:@"Button has checked the switch value..." delegate:self cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil];
[alertView show];
UIAlertController * alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Switch is ON", nil)
message:@"Button has checked the switch value..."
preferredStyle:UIAlertControllerStyleAlert];
[alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
style:UIAlertActionStyleDefault
handler:nil]];
[self presentViewController:alertController animated:YES completion:nil];
}
[self deselectFormRow:sender];
}
-(void)viewDidLoad
{
[super viewDidLoad];
UIBarButtonItem * barButton = [[UIBarButtonItem alloc] initWithTitle:@"Disable" style:UIBarButtonItemStylePlain
target:self
action:@selector(disableEnable:)];
barButton.possibleTitles = [NSSet setWithObjects:@"Disable", @"Enable", nil];
self.navigationItem.rightBarButtonItem = barButton;
}
-(void)disableEnable:(UIBarButtonItem *)button
{
self.form.disabled = !self.form.disabled;
[button setTitle:(self.form.disabled ? @"Enable" : @"Disable")];
[self.tableView endEditing:YES];
[self.tableView reloadData];
}
@end
@@ -1,8 +1,8 @@
//
// XLFormTextFieldCell.h
// BasicPredicateViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -23,13 +23,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "XLFormBaseCell.h"
#import "XLForm.h"
#import "XLFormViewController.h"
#import <UIKit/UIKit.h>
@interface XLFormTextFieldCell : XLFormBaseCell
@property (nonatomic, readonly) UILabel * textLabel;
@property (nonatomic, readonly) UITextField * textField;
@interface BasicPredicateViewController : XLFormViewController
@end
@@ -0,0 +1,84 @@
//
// BasicPredicateViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "BasicPredicateViewController.h"
NSString *const khiderow = @"tag1";
NSString *const khidesection = @"tag2";
NSString *const ktext = @"tag3";
@implementation BasicPredicateViewController
- (instancetype)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self) {
[self initializeForm];
}
return self;
}
- (instancetype)init
{
self = [super init];
if (self) {
[self initializeForm];
}
return self;
}
- (void)initializeForm
{
XLFormDescriptor * form;
XLFormSectionDescriptor * section;
XLFormRowDescriptor * row;
form = [XLFormDescriptor formDescriptorWithTitle:@"Basic Predicates"];
section = [XLFormSectionDescriptor formSectionWithTitle:@"A Section"];
[form addFormSection:section];
row = [XLFormRowDescriptor formRowDescriptorWithTag:khiderow rowType:XLFormRowDescriptorTypeBooleanSwitch title:@"Show next row"];
row.value = @0;
[section addFormRow:row];
row = [XLFormRowDescriptor formRowDescriptorWithTag:khidesection rowType:XLFormRowDescriptorTypeBooleanSwitch title:@"Show B Section"];
row.hidden = [NSString stringWithFormat:@"$%@==0", khiderow];
row.value = @0;
[section addFormRow:row];
section = [XLFormSectionDescriptor formSectionWithTitle:@"B Section"];
section.footerTitle = @"BasicPredicateViewController";
section.hidden = [NSString stringWithFormat:@"$%@==0", khidesection];
[form addFormSection:section];
row = [XLFormRowDescriptor formRowDescriptorWithTag:ktext rowType:XLFormRowDescriptorTypeText title:@""];
[row.cellConfigAtConfigure setObject:@"Gonna disappear soon!!" forKey:@"textField.placeholder"];
[section addFormRow:row];
self.form = form;
}
@end
@@ -1,8 +1,8 @@
//
// UserRemoteDataLoader.h
// BlogExampleViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -23,8 +23,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "XLRemoteDataLoader.h"
#import "XLForm.h"
#import "XLFormViewController.h"
@interface UserRemoteDataLoader : XLRemoteDataLoader
@interface BlogExampleViewController : XLFormViewController
@end
@@ -0,0 +1,106 @@
//
// BlogExampleViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "BlogExampleViewController.h"
NSString *const kHobbies = @"hobbies";
NSString *const kSport = @"sport";
NSString *const kFilm = @"films1";
NSString *const kFilm2 = @"films2";
NSString *const kMusic = @"music";
@implementation BlogExampleViewController
- (instancetype)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self) {
[self initializeForm];
}
return self;
}
- (instancetype)init
{
self = [super init];
if (self) {
[self initializeForm];
}
return self;
}
- (void)initializeForm
{
XLFormDescriptor * form;
XLFormSectionDescriptor * section;
XLFormRowDescriptor * row;
form = [XLFormDescriptor formDescriptorWithTitle:@"Blog Example: Hobbies"];
section = [XLFormSectionDescriptor formSectionWithTitle:@"Hobbies"];
[form addFormSection:section];
XLFormRowDescriptor* hobbyRow = [XLFormRowDescriptor formRowDescriptorWithTag:kHobbies
rowType:XLFormRowDescriptorTypeMultipleSelector
title:@"Select Hobbies"];
hobbyRow.selectorOptions = @[@"Sport", @"Music", @"Films"];
hobbyRow.value = @[];
[section addFormRow:hobbyRow];
section = [XLFormSectionDescriptor formSectionWithTitle:@"Some more questions"];
section.hidden = [NSPredicate predicateWithFormat:[NSString stringWithFormat:@"$%@.value.@count == 0", hobbyRow]];
section.footerTitle = @"BlogExampleViewController.m";
[form addFormSection:section];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSport
rowType:XLFormRowDescriptorTypeTextView
title:@"Your favourite sportsman?"];
row.hidden = [NSString stringWithFormat:@"NOT $%@.value contains 'Sport'", hobbyRow];
[section addFormRow:row];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kFilm
rowType:XLFormRowDescriptorTypeTextView
title:@"Your favourite film?"];
row.hidden = [NSString stringWithFormat:@"NOT $%@ contains 'Films'", hobbyRow];
[section addFormRow:row];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kFilm2
rowType:XLFormRowDescriptorTypeTextView
title:@"Your favourite actor?"];
row.hidden = [NSString stringWithFormat:@"NOT $%@ contains 'Films'", hobbyRow];
[section addFormRow:row];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kMusic
rowType:XLFormRowDescriptorTypeTextView
title:@"Your favourite singer?"];
row.hidden = [NSString stringWithFormat:@"NOT $%@ contains 'Music'", hobbyRow];
[section addFormRow:row];
self.form = form;
}
@end
@@ -1,8 +1,8 @@
//
// User.m
// PredicateFormViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -23,13 +23,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "User.h"
#import "XLForm.h"
#import "XLFormViewController.h"
@implementation User
@dynamic userId;
@dynamic userName;
@dynamic userImageURL;
@interface PredicateFormViewController : XLFormViewController
@end
@@ -0,0 +1,116 @@
//
// PredicateFormViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
NSString *const kPred = @"pred";
NSString *const kPredDep = @"preddep";
NSString *const kPredDep2 = @"preddep2";
#import "PredicateFormViewController.h"
@implementation PredicateFormViewController
- (instancetype)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self) {
[self initializeForm];
}
return self;
}
- (instancetype)init
{
self = [super init];
if (self) {
[self initializeForm];
}
return self;
}
- (void)initializeForm
{
XLFormDescriptor * form;
XLFormSectionDescriptor * section;
XLFormRowDescriptor * row;
XLFormRowDescriptor * pred, *pred3, *pred4;
form = [XLFormDescriptor formDescriptorWithTitle:@"Predicates example"];
section = [XLFormSectionDescriptor formSectionWithTitle:@"Independent rows"];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kPredDep rowType:XLFormRowDescriptorTypeAccount title:@"Text"];
[row.cellConfigAtConfigure setObject:@"Type disable" forKey:@"textField.placeholder"];
pred = row;
[section addFormRow:row];
row = [XLFormRowDescriptor formRowDescriptorWithTag:kPredDep2 rowType:XLFormRowDescriptorTypeInteger title:@"Integer"];
row.hidden = [NSString stringWithFormat:@"$switch==0"];
[section addFormRow:row];
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"switch" rowType:XLFormRowDescriptorTypeBooleanSwitch title:@"Boolean"];
row.value = @1;
pred3 = row;
[section addFormRow:row];
[form addFormSection:section];
section = [XLFormSectionDescriptor formSectionWithTitle:@"Dependent section"];
section.footerTitle = @"Type disable in the textfield, a number between 18 and 60 in the integer field or use the switch to disable the last row. By doing all three the last section will hide.\nThe integer field hides when the boolean switch is set to 0.";
[form addFormSection:section];
// Predicate Disabling
row = [XLFormRowDescriptor formRowDescriptorWithTag:kPred rowType:XLFormRowDescriptorTypeDateInline title:@"Disabled"];
row.value = [NSDate new];
[section addFormRow:row];
row.disabled = [NSString stringWithFormat:@"$%@ contains[c] 'disable' OR ($%@.value between {18, 60}) OR ($%@.value == 0)", pred, kPredDep2, pred3];
//[NSPredicate predicateWithFormat:[NSString stringWithFormat:@"($%@.value contains[c] %%@) OR ($%@.value between {18, 60}) OR ($%@.value == 0)", pred, pred2, pred3], @"disable"] ];
pred4 = row;
section.hidden = [NSPredicate predicateWithFormat:[NSString stringWithFormat:@"($%@.value contains[c] 'disable') AND ($%@.value between {18, 60}) AND ($%@.value == 0)", pred, kPredDep2, pred3]];
section = [XLFormSectionDescriptor formSectionWithTitle:@"More predicates..."];
section.footerTitle = @"This row hides when the row of the previous section is disabled and the textfield in the first section contains \"out\"\n\nPredicateFormViewController.m";
[form addFormSection:section];
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"thirds" rowType:XLFormRowDescriptorTypeAccount title:@"Account"];
[section addFormRow:row];
row.hidden = [NSString stringWithFormat:@"$%@.isDisabled == 1 AND $%@.value contains[c] 'Out'", pred4, pred];
typeof(self) __weak weakself = self;
row.onChangeBlock = ^(id oldValue, id newValue, XLFormRowDescriptor* __unused rowDescriptor){
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Account Field changed" message:[NSString stringWithFormat:@"Old value: %@\nNew value: %@", oldValue, newValue ] preferredStyle:UIAlertControllerStyleActionSheet];
[alert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil]];
[weakself.navigationController presentViewController:alert animated:YES completion:nil];
};
self.form = form;
}
@end
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

@@ -2,7 +2,7 @@
// NativeEventNavigationViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// NativeEventNavigationViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -24,15 +24,11 @@
// THE SOFTWARE.
#import "XLForm.h"
#import "DateAndTimeValueTrasformer.h"
#import "NativeEventFormViewController.h"
@implementation NativeEventNavigationViewController
-(id)init
{
self = [super initWithRootViewController:[[NativeEventFormViewController alloc] init]];
return self;
}
@implementation NativeEventNavigationViewController
-(void)viewDidLoad
{
@@ -74,13 +70,13 @@
XLFormRowDescriptor * row;
form = [XLFormDescriptor formDescriptorWithTitle:@"Add Event"];
section = [XLFormSectionDescriptor formSection];
[form addFormSection:section];
// Title
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"title" rowType:XLFormRowDescriptorTypeText];
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"Title" rowType:XLFormRowDescriptorTypeText];
[row.cellConfigAtConfigure setObject:@"Title" forKey:@"textField.placeholder"];
row.required = YES;
[section addFormRow:row];
// Location
@@ -188,7 +184,7 @@
if ([[rowDescriptor.value valueData] isEqualToNumber:@(0)] == NO && [[oldValue valueData] isEqualToNumber:@(0)]){
XLFormRowDescriptor * newRow = [rowDescriptor copy];
[newRow setTag:@"secondAlert"];
newRow.tag = @"secondAlert";
newRow.title = @"Second Alert";
[self.form addFormRow:newRow afterRow:rowDescriptor];
}
@@ -197,34 +193,33 @@
}
}
else if ([rowDescriptor.tag isEqualToString:@"all-day"]){
XLFormRowDescriptor * startDateDescriptor = [self.form formRowWithTag:@"starts"];
XLFormRowDescriptor * endDateDescriptor = [self.form formRowWithTag:@"ends"];
XLFormDateCell * dateStartCell = (XLFormDateCell *)[[self.form formRowWithTag:@"starts"] cellForFormController:self];
XLFormDateCell * dateEndCell = (XLFormDateCell *)[[self.form formRowWithTag:@"ends"] cellForFormController:self];
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
if ([[rowDescriptor.value valueData] boolValue] == YES){
[dateFormatter setDateStyle:NSDateFormatterFullStyle];
[dateFormatter setTimeStyle:NSDateFormatterNoStyle];
startDateDescriptor.valueTransformer = [DateValueTrasformer class];
endDateDescriptor.valueTransformer = [DateValueTrasformer class];
[dateStartCell setFormDatePickerMode:XLFormDateDatePickerModeDate];
[dateEndCell setFormDatePickerMode:XLFormDateDatePickerModeDate];
}
else{
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
[dateFormatter setTimeStyle:NSDateFormatterShortStyle];
startDateDescriptor.valueTransformer = [DateTimeValueTrasformer class];
endDateDescriptor.valueTransformer = [DateTimeValueTrasformer class];
[dateStartCell setFormDatePickerMode:XLFormDateDatePickerModeDateTime];
[dateEndCell setFormDatePickerMode:XLFormDateDatePickerModeDateTime];
}
dateStartCell.dateFormatter = dateFormatter;
dateEndCell.dateFormatter = dateFormatter;
[dateStartCell update];
[dateEndCell update];
[self updateFormRow:startDateDescriptor];
[self updateFormRow:endDateDescriptor];
}
else if ([rowDescriptor.tag isEqualToString:@"starts"]){
XLFormRowDescriptor * startDateDescriptor = [self.form formRowWithTag:@"starts"];
XLFormRowDescriptor * endDateDescriptor = [self.form formRowWithTag:@"ends"];
XLFormDateCell * dateEndCell = (XLFormDateCell *)[endDateDescriptor cellForFormController:self];
if ([startDateDescriptor.value compare:endDateDescriptor.value] == NSOrderedDescending) {
// startDateDescriptor is later than endDateDescriptor
endDateDescriptor.value = [[NSDate alloc] initWithTimeInterval:(60*60*24) sinceDate:startDateDescriptor.value];
[dateEndCell update];
[endDateDescriptor.cellConfig removeObjectForKey:@"detailTextLabel.attributedText"];
[self updateFormRow:endDateDescriptor];
}
}
else if ([rowDescriptor.tag isEqualToString:@"ends"]){
@@ -233,21 +228,27 @@
XLFormDateCell * dateEndCell = (XLFormDateCell *)[endDateDescriptor cellForFormController:self];
if ([startDateDescriptor.value compare:endDateDescriptor.value] == NSOrderedDescending) {
// startDateDescriptor is later than endDateDescriptor
[dateEndCell update]; // force detailTextLabel update
NSDictionary *strikeThroughAttribute = [NSDictionary dictionaryWithObject:@1
forKey:NSStrikethroughStyleAttributeName];
NSAttributedString* strikeThroughText = [[NSAttributedString alloc] initWithString:dateEndCell.detailTextLabel.text attributes:strikeThroughAttribute];
dateEndCell.detailTextLabel.attributedText = strikeThroughText;
[endDateDescriptor.cellConfig setObject:strikeThroughText forKey:@"detailTextLabel.attributedText"];
[self updateFormRow:endDateDescriptor];
}
else{
[endDateDescriptor.cellConfig removeObjectForKey:@"detailTextLabel.attributedText"];
[self updateFormRow:endDateDescriptor];
}
}
}
-(IBAction)cancelPressed:(UIBarButtonItem * __unused)button
-(void)cancelPressed:(UIBarButtonItem * __unused)button
{
[self dismissViewControllerAnimated:YES completion:nil];
}
-(IBAction)savePressed:(UIBarButtonItem * __unused)button
-(void)savePressed:(UIBarButtonItem * __unused)button
{
NSArray * validationErrors = [self formValidationErrors];
if (validationErrors.count > 0){
@@ -1,13 +0,0 @@
//
// UIFormViewCotroller+NativeEvetFormViewController.h
// XLForm
//
// Created by Martin Barreto on 4/2/14.
// Copyright (c) 2014 Xmartlabs. All rights reserved.
//
@interface UIFormViewCotroller (NativeEventFormViewController)
@end
@@ -1,13 +0,0 @@
//
// UIFormViewCotroller+NativeEvetFormViewController.m
// XLForm
//
// Created by Martin Barreto on 4/2/14.
// Copyright (c) 2014 Xmartlabs. All rights reserved.
//
#import "UIFormViewCotroller+NativeEvetFormViewController.h"
@implementation UIFormViewCotroller (NativeEvetFormViewController)
@end
@@ -2,7 +2,7 @@
// CustomSelectorsFormViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// CustomSelectorsFormViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// CLLocationValueTrasformer.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// CLLocationValueTrasformer.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// MapViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// MapViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -89,7 +89,7 @@
MKPinAnnotationView *pinAnnotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation
reuseIdentifier:@"annotation"];
pinAnnotationView.pinColor = MKPinAnnotationColorRed;
pinAnnotationView.pinTintColor = [UIColor redColor];
pinAnnotationView.draggable = YES;
pinAnnotationView.animatesDrop = YES;
return pinAnnotationView;
@@ -2,7 +2,7 @@
// DynamicSelectorsFormViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// DynamicSelectorsFormViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -29,8 +29,31 @@
NSString *const kSelectorUser = @"selectorUser";
NSString *const kSelectorUserPopover = @"kSelectorUserPopover";
@implementation DynamicSelectorsFormViewController
@interface UserTransformer : NSValueTransformer
@end
@implementation UserTransformer
+ (Class)transformedValueClass
{
return [NSString class];
}
+ (BOOL)allowsReverseTransformation
{
return NO;
}
- (id)transformedValue:(id)value
{
if (!value) return nil;
NSDictionary *user = (NSDictionary *) value;
return [user valueForKeyPath:@"user.name"];
}
@end
@implementation DynamicSelectorsFormViewController
-(id)init
{
@@ -48,19 +71,24 @@ NSString *const kSelectorUserPopover = @"kSelectorUserPopover";
// Selector Push
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorUser rowType:XLFormRowDescriptorTypeSelectorPush title:@"User"];
row.action.viewControllerClass = [UsersTableViewController class];
row.action.viewControllerStoryboardId = @"UsersTableViewController";
row.valueTransformer = [UserTransformer class];
[section addFormRow:row];
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad){
// Selector PopOver
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorUserPopover rowType:XLFormRowDescriptorTypeSelectorPopover title:@"User Popover"];
row.action.viewControllerClass = [UsersTableViewController class];
[section addFormRow:row];
}
// if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad){
// // Selector PopOver
// row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorUserPopover rowType:XLFormRowDescriptorTypeSelectorPopover title:@"User Popover"];
// row.action.viewControllerClass = [UsersTableViewController class];
// [section addFormRow:row];
// }
self.form = form;
}
return self;
}
- (UIStoryboard *)storyboardForRow:(XLFormRowDescriptor *)formRow
{
return [UIStoryboard storyboardWithName:@"iPhoneStoryboard" bundle:nil];
}
@end
@@ -2,7 +2,7 @@
// UsersTableViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -24,8 +24,11 @@
// THE SOFTWARE.
#import "XLFormRowDescriptor.h"
#import "XLTableViewController.h"
#import "XLRemoteDataStoreController.h"
@interface UsersTableViewController : XLTableViewController <XLFormRowDescriptorViewController, XLFormRowDescriptorPopoverViewController>
@interface UsersTableViewController : XLRemoteDataStoreController <XLFormRowDescriptorViewController>
@property BOOL isSearchResultsController;
@property NSLayoutConstraint *topConstraint;
@end
@@ -2,7 +2,7 @@
// UsersTableViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -24,9 +24,7 @@
// THE SOFTWARE.
#import "UsersTableViewController.h"
#import "UserLocalDataLoader.h"
#import "UserRemoteDataLoader.h"
#import "User+Additions.h"
#import "HTTPSessionManager.h"
// AFNetworking
#import <AFNetworking/UIImageView+AFNetworking.h>
@@ -65,7 +63,6 @@
// Configure the view for the selected state
}
#pragma mark - Views
-(UIImageView *)userImage
@@ -101,7 +98,7 @@
NSDictionary *metrics = @{@"imgSize":@50.0,
@"margin" :@12.0};
[result addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(margin)-[image(imgSize)]-[name]"
[result addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[image(imgSize)]-[name]"
options:NSLayoutFormatAlignAllTop
metrics:metrics
views:views]];
@@ -110,6 +107,7 @@
options:0
metrics:metrics
views:views]];
return result;
}
@@ -117,56 +115,68 @@
@end
@interface UsersTableViewController ()
@interface UsersTableViewController () <UISearchControllerDelegate>
@property (nonatomic, readonly) UsersTableViewController * searchResultController;
@property (nonatomic, readonly) UISearchController * searchController;
@end
@implementation UsersTableViewController
@synthesize rowDescriptor = _rowDescriptor;
@synthesize popoverController = __popoverController;
@synthesize searchController = _searchController;
@synthesize searchResultController = _searchResultController;
static NSString *const kCellIdentifier = @"CellIdentifier";
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
- (instancetype)initWithCoder:(NSCoder *)coder
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
self = [super initWithCoder:coder];
if (self) {
// Custom initialization
[self initialize];
}
return self;
}
-(void)initialize
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
// Enable the pagination
self.loadingPagingEnabled = YES;
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if(self)
{
[self initialize];
}
// Support Search Controller
self.supportSearchController = YES;
[self setLocalDataLoader:[[UserLocalDataLoader alloc] init]];
[self setRemoteDataLoader:[[UserRemoteDataLoader alloc] init]];
// Search
[self setSearchLocalDataLoader:[[UserLocalDataLoader alloc] init]];
[self setSearchRemoteDataLoader:[[UserRemoteDataLoader alloc] init]];
return self;
}
- (void)initialize
{
self.dataLoader = [[XLDataLoader alloc] initWithURLString:@"/mobile/users.json" offsetParamName:@"offset" limitParamName:@"limit" searchStringParamName:@"filter"];
self.dataLoader.delegate = self;
self.dataLoader.storeDelegate = self;
self.dataLoader.limit = 4;
self.dataLoader.collectionKeyPath = @"";
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
// SearchBar
self.tableView.tableHeaderView = self.searchDisplayController.searchBar;
// register cells
[self.searchDisplayController.searchResultsTableView registerClass:[UserCell class] forCellReuseIdentifier:kCellIdentifier];
[self.tableView registerClass:[UserCell class] forCellReuseIdentifier:kCellIdentifier];
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
[self customizeAppearance];
if (!self.isSearchResultsController){
self.tableView.tableHeaderView = self.searchController.searchBar;
}
else{
[self.tableView setContentInset:UIEdgeInsetsMake(64, 0, 0, 0)];
[self.tableView setScrollIndicatorInsets:self.tableView.contentInset];
}
}
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.searchController.searchBar sizeToFit];
}
#pragma mark - UITableViewDataSource
@@ -174,72 +184,71 @@ static NSString *const kCellIdentifier = @"CellIdentifier";
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UserCell *cell = (UserCell *) [tableView dequeueReusableCellWithIdentifier:kCellIdentifier forIndexPath:indexPath];;
User * user = nil;
if (tableView == self.tableView){
user = (User *)[self.localDataLoader objectAtIndexPath:indexPath];
}
else{
user = (User *)[self.searchLocalDataLoader objectAtIndexPath:indexPath];
}
NSDictionary *dataItem = [self.dataStore dataAtIndexPath:indexPath];
cell.userName.text = [dataItem valueForKeyPath:@"user.name"];
[cell.userImage setImageWithURL:[NSURL URLWithString:[dataItem valueForKeyPath:@"user.imageURL"]] placeholderImage:[UIImage imageNamed:@"default-avatar"]];
cell.accessoryType = [[self.rowDescriptor.value valueForKeyPath:@"user.id"] isEqual:[dataItem valueForKeyPath:@"user.id"]] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
cell.userName.text = user.userName;
NSMutableURLRequest* imageRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:user.userImageURL]];
[imageRequest setValue:@"image/*" forHTTPHeaderField:@"Accept"];
__typeof__(cell) __weak weakCell = cell;
[cell.userImage setImageWithURLRequest: imageRequest
placeholderImage:[User defaultProfileImage]
success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
if (image) {
[weakCell.userImage setImage:image];
}
}
failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) {
}];
cell.accessoryType = [[self.rowDescriptor.value formValue] isEqual:user.userId] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
return cell;
}
#pragma mark - UITableViewDelegate
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 73.0f;
}
#pragma mark - UITableViewDelegate
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
User * user = nil;
if (tableView == self.tableView){
user = (User *)[self.localDataLoader objectAtIndexPath:indexPath];
}
else{
user = (User *)[self.searchLocalDataLoader objectAtIndexPath:indexPath];
}
self.rowDescriptor.value = user;
NSDictionary *dataItem = [self.dataStore dataAtIndexPath:indexPath];
self.rowDescriptor.value = dataItem;
if (self.popoverController){
[self.popoverController dismissPopoverAnimated:YES];
[self.popoverController.delegate popoverControllerDidDismissPopover:self.popoverController];
}
else if ([self.parentViewController isKindOfClass:[UINavigationController class]]){
UIViewController *popoverController = self.presentedViewController;
if (popoverController && popoverController.modalPresentationStyle == UIModalPresentationPopover) {
[self dismissViewControllerAnimated:YES completion:nil];
} else if ([self.parentViewController isKindOfClass:[UINavigationController class]]) {
[self.navigationController popViewControllerAnimated:YES];
} else if ([self.presentingViewController isKindOfClass:[UsersTableViewController class]]) {
[[self.presentingViewController navigationController] popViewControllerAnimated:YES];
}
}
#pragma mark - XLDataLoaderDelegate
#pragma mark - Helpers
-(void)customizeAppearance
-(AFHTTPSessionManager *)sessionManagerForDataLoader:(XLDataLoader *)dataLoader
{
[[self navigationItem] setTitle:@"Select a User"];
[self.tableView setBackgroundColor:[UIColor colorWithWhite:0.9 alpha:1.0]];
[self.tableView setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]];
[self.searchDisplayController.searchResultsTableView setBackgroundColor:[UIColor colorWithWhite:0.9 alpha:1.0]];
[self.searchDisplayController.searchResultsTableView setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]];
return [HTTPSessionManager sharedClient];
}
#pragma mark - UISearchController
-(UISearchController *)searchController
{
if (_searchController) return _searchController;
self.definesPresentationContext = YES;
_searchController = [[UISearchController alloc] initWithSearchResultsController:self.searchResultController];
_searchController.delegate = self;
_searchController.searchResultsUpdater = self.searchResultController;
_searchController.searchBar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[_searchController.searchBar sizeToFit];
return _searchController;
}
-(UsersTableViewController *)searchResultController
{
if (_searchResultController) return _searchResultController;
UsersTableViewController *usersViewController = [[UsersTableViewController alloc] init];
usersViewController.rowDescriptor = self.rowDescriptor;
_searchResultController = usersViewController;
_searchResultController.dataLoader.limit = 0; // no paging in search result
_searchResultController.isSearchResultsController = YES;
return _searchResultController;
}
@end
@@ -2,7 +2,7 @@
// HTTPSessionManager.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// HTTPSessionManager.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,227 +0,0 @@
//
// CoreDataStore.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "CoreDataStore.h"
static NSString *const TBCoreDataModelFileName = @"Model";
@interface CoreDataStore ()
@property (strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
@property (strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (strong, nonatomic) NSManagedObjectContext *mainQueueContext;
@property (strong, nonatomic) NSManagedObjectContext *privateQueueContext;
@end
@implementation CoreDataStore
+ (instancetype)defaultStore {
static CoreDataStore *_defaultStore = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_defaultStore = [[self alloc] init];
});
return _defaultStore;
}
#pragma mark - Singleton Access
+ (NSManagedObjectContext *)mainQueueContext
{
return [[self defaultStore] mainQueueContext];
}
+ (NSManagedObjectContext *)privateQueueContext
{
return [[self defaultStore] privateQueueContext];
}
+(void)savePrivateQueueContext
{
NSError * error;
[[self privateQueueContext] save:&error];
NSAssert(!error, [error localizedDescription]);
}
+ (void)saveMainQueueContext
{
NSError * error;
[[self mainQueueContext] save:&error];
NSAssert(!error, [error localizedDescription]);
}
+ (NSManagedObjectID *)managedObjectIDFromString:(NSString *)managedObjectIDString
{
return [[[self defaultStore] persistentStoreCoordinator] managedObjectIDForURIRepresentation:[NSURL URLWithString:managedObjectIDString]];
}
#pragma mark - Lifecycle
- (id)init
{
self = [super init];
if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(contextDidSavePrivateQueueContext:)name:NSManagedObjectContextDidSaveNotification object:[self privateQueueContext]];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(contextDidSaveMainQueueContext:) name:NSManagedObjectContextDidSaveNotification object:[self mainQueueContext]];
}
return self;
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
#pragma mark - Notifications
- (void)contextDidSavePrivateQueueContext:(NSNotification *)notification
{
@synchronized(self) {
[self.mainQueueContext performBlock:^{
for(NSManagedObject *object in [[notification userInfo] objectForKey:NSUpdatedObjectsKey]) {
[[self.mainQueueContext objectWithID:[object objectID]] willAccessValueForKey:nil];
}
[self.mainQueueContext mergeChangesFromContextDidSaveNotification:notification];
}];
}
}
- (void)contextDidSaveMainQueueContext:(NSNotification *)notification
{
@synchronized(self) {
[self.privateQueueContext performBlock:^{
[self.privateQueueContext mergeChangesFromContextDidSaveNotification:notification];
}];
}
}
#pragma mark - Getters
- (NSManagedObjectContext *)mainQueueContext
{
if (!_mainQueueContext) {
_mainQueueContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
_mainQueueContext.persistentStoreCoordinator = self.persistentStoreCoordinator;
}
return _mainQueueContext;
}
- (NSManagedObjectContext *)privateQueueContext
{
if (!_privateQueueContext) {
_privateQueueContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];
_privateQueueContext.persistentStoreCoordinator = self.persistentStoreCoordinator;
}
return _privateQueueContext;
}
#pragma mark - Stack Setup
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
{
if (!_persistentStoreCoordinator) {
_persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:self.managedObjectModel];
NSError *error = nil;
if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:[self persistentStoreURL] options:[self persistentStoreOptions] error:&error]) {
NSLog(@"Error adding persistent store. %@, %@", error, error.userInfo);
}
}
return _persistentStoreCoordinator;
}
- (NSManagedObjectModel *)managedObjectModel
{
if (!_managedObjectModel) {
NSURL *modelURL = [[NSBundle mainBundle] URLForResource:TBCoreDataModelFileName withExtension:@"momd"];
_managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
}
return _managedObjectModel;
}
- (NSURL *)persistentStoreURL
{
return [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Model.sqlite"];
}
- (NSDictionary *)persistentStoreOptions
{
return @{NSInferMappingModelAutomaticallyOption: @YES, NSMigratePersistentStoresAutomaticallyOption: @YES, NSSQLitePragmasOption: @{@"synchronous": @"OFF"}};
}
#pragma mark - Application's Documents directory
// Returns the URL to the application's Documents directory.
- (NSURL *)applicationDocumentsDirectory
{
return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}
@end
@implementation NSManagedObject (Additions)
+(instancetype)findFirstByAttribute:(NSString *)attribute withValue:(id)value inContext:(NSManagedObjectContext *)context
{
NSString * predicateStr = [NSString stringWithFormat:@"%@ = %%@", attribute];
NSPredicate * searchByAttValue = [NSPredicate predicateWithFormat:predicateStr argumentArray:@[value]];
NSFetchRequest * fetchRequest = [self fetchRequest];
fetchRequest.predicate = searchByAttValue;
fetchRequest.fetchLimit = 1;
NSArray *result = [context executeFetchRequest:fetchRequest error:nil];
return [result lastObject];
}
+(NSFetchRequest*)fetchRequest
{
return [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass(self)];
}
+(NSEntityDescription*)entityDescriptor:(NSManagedObjectContext *)context
{
return [NSEntityDescription entityForName:NSStringFromClass(self) inManagedObjectContext:context];
}
+(instancetype)insert:(NSManagedObjectContext *)context
{
return [[NSManagedObject alloc] initWithEntity:[self entityDescriptor:context] insertIntoManagedObjectContext:context];
}
@end
@@ -1,87 +0,0 @@
//
// User+Additions.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "CoreDataStore.h"
#import "User+Additions.h"
#define USER_ID @"id"
#define USER_IMAGE_URL @"imageURL"
#define USER_NAME @"name"
@implementation User (Additions)
+ (User *)createOrUpdateWithServiceResult:(NSDictionary *)data inContext:(NSManagedObjectContext *)context;
{
User *user = [User findFirstByAttribute:@"userId" withValue:data[USER_ID] inContext:context];
if (!user)
{
user = [User insert:context];
}
user.userId = data[USER_ID];
user.userImageURL = data[USER_IMAGE_URL] ;
user.userName = data[USER_NAME];
return user;
}
+ (UIImage *)defaultProfileImage
{
return [UIImage imageNamed:@"default-avatar"];
}
+ (NSPredicate *)getPredicateBySearchInput:(NSString *)search {
if (search && ![search isEqualToString:@""]) {
return [NSPredicate predicateWithFormat:@"userName CONTAINS[cd] %@" , search];
}
return nil;
}
+ (NSFetchRequest *)getFetchRequest {
return [User getFetchRequestBySearchInput:nil];
}
+ (NSFetchRequest *)getFetchRequestBySearchInput:(NSString *)search {
NSFetchRequest * fetchRequest = [User fetchRequest];
fetchRequest.predicate = [User getPredicateBySearchInput:search];
fetchRequest.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"userName" ascending:YES selector:@selector(caseInsensitiveCompare:)]];
return fetchRequest;
}
#pragma mark - XLFormOptionObject
-(NSString *)formDisplayText
{
return self.userName;
}
-(id)formValue
{
return self.userId;
}
@end
@@ -1,60 +0,0 @@
//
// UserLocalDataLoader.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "UserLocalDataLoader.h"
#import "User+Additions.h"
#import "CoreDataStore.h"
@implementation UserLocalDataLoader
{
NSString *_searchString;
}
- (id)init {
self = [super init];
if (self) {
NSFetchedResultsController * fetchResultController = [[NSFetchedResultsController alloc] initWithFetchRequest:[User getFetchRequest]
managedObjectContext:[CoreDataStore mainQueueContext]
sectionNameKeyPath:nil
cacheName:nil];
[self setFetchedResultsController:fetchResultController];
}
return self;
}
-(void)changeSearchString:(NSString *)searchString
{
_searchString = searchString;
[self refreshPredicate];
}
- (void)refreshPredicate
{
[self setPredicate:[User getPredicateBySearchInput:_searchString]];
}
@end
@@ -1,107 +0,0 @@
//
// UserRemoteDataLoader.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "UserRemoteDataLoader.h"
#import "HTTPSessionManager.h"
#import "CoreDataStore.h"
#import "User+Additions.h"
@implementation UserRemoteDataLoader
-(NSString *)URLString
{
return @"/mobile/users.json";
}
-(NSDictionary *)parameters
{
NSString *filterParam = self.searchString ?: @"";
return @{@"filter" : filterParam,
@"offset" : @(self.offset),
@"limit" : @(self.limit)};
}
-(AFHTTPSessionManager *)sessionManager
{
return [HTTPSessionManager sharedClient];
}
-(void)successulDataLoad {
// change flags
// [self fetchedData] contains the data coming from the server
NSArray * itemsArray = [[self fetchedData] objectForKey:kXLRemoteDataLoaderDefaultKeyForNonDictionaryResponse];
// This flag indicates if there is more data to load
_hasMoreToLoad = !((itemsArray.count == 0) || (itemsArray.count < _limit && itemsArray.count != 0));
[[CoreDataStore privateQueueContext] performBlock:^{
for (NSDictionary *item in itemsArray) {
// Creates or updates the User and the user who created it with the data that came from the server
[User createOrUpdateWithServiceResult:item[@"user"] inContext:[CoreDataStore privateQueueContext]];
}
[self removeOutdatedData:itemsArray inContext:[CoreDataStore privateQueueContext]];
[CoreDataStore savePrivateQueueContext];
}];
[super successulDataLoad];
}
#pragma mark - Auxiliary Functions
- (void)removeOutdatedData:(NSArray *)data inContext:(NSManagedObjectContext *)context
{
// First, remove older data
NSFetchRequest * fetchRequest = [User getFetchRequestBySearchInput:self.searchString];
fetchRequest.fetchLimit = self.limit;
fetchRequest.fetchOffset = self.offset;
NSError *error;
NSArray * oldObjects = [context executeFetchRequest:fetchRequest error:&error];
NSArray * arrayToIterate = [oldObjects copy];
if (error) {
dispatch_async(dispatch_get_main_queue(), ^{
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Error"
message:error.localizedFailureReason ?: error.localizedDescription
delegate:nil
cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil, nil];
[alertView show];
});
return;
}
for (User *user in arrayToIterate)
{
NSArray *filteredArray = [data filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"user.id == %@" argumentArray:@[user.userId]]];
if (filteredArray.count == 0) {
// This User no longer exists
[context deleteObject:user];
}
}
}
@end
@@ -2,7 +2,7 @@
// SelectorsFormViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// SelectorsFormViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -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];
@@ -317,34 +319,6 @@ NSString *const kSelectorWithStoryboardId = @"selectorWithStoryboardId";
row.action.viewControllerClass = [CustomSelectorsFormViewController class];
[section addFormRow:row];
section = [XLFormSectionDescriptor formSectionWithTitle:@"Disabled & Required Selectors"];
[form addFormSection:section];
// Disabled Selector Push
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorPushDisabled rowType:XLFormRowDescriptorTypeSelectorPush title:@"Push"];
row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:@"Option 2"];
row.disabled = YES;
[section addFormRow:row];
// --------- Disabled Selector Action Sheet
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorActionSheetDisabled rowType:XLFormRowDescriptorTypeSelectorActionSheet title:@"Sheet"];
row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(2) displayText:@"Option 3"];
row.disabled = YES;
[section addFormRow:row];
// --------- Disabled Selector Left Right
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorLeftRightDisabled rowType:XLFormRowDescriptorTypeSelectorLeftRight title:@"Left Right"];
row.leftRightSelectorLeftOptionSelected = [XLFormOptionsObject formOptionsObjectWithValue:@(1) displayText:@"Option 2"];
row.value = [XLFormOptionsObject formOptionsObjectWithValue:@(3) displayText:@"Right Option 4"];
row.disabled = YES;
[section addFormRow:row];
// --------- Selector definition types
@@ -360,8 +334,8 @@ NSString *const kSelectorWithStoryboardId = @"selectorWithStoryboardId";
[section addFormRow:row];
// selector with SegueId
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorWithSegueClass rowType:XLFormRowDescriptorTypeSelectorPush title:@"Selector with Segue Idenfifier"];
row.action.formSegueIdenfifier = @"MapViewControllerSegue";
row = [XLFormRowDescriptor formRowDescriptorWithTag:kSelectorWithSegueId rowType:XLFormRowDescriptorTypeSelectorPush title:@"Selector with Segue Identifier"];
row.action.formSegueIdentifier = @"MapViewControllerSegue";
row.valueTransformer = [CLLocationValueTrasformer class];
row.value = [[CLLocation alloc] initWithLatitude:-33 longitude:-56];
[section addFormRow:row];
@@ -392,4 +366,24 @@ NSString *const kSelectorWithStoryboardId = @"selectorWithStoryboardId";
}
-(void)viewDidLoad
{
[super viewDidLoad];
UIBarButtonItem * barButton = [[UIBarButtonItem alloc] initWithTitle:@"Disable" style:UIBarButtonItemStylePlain
target:self
action:@selector(disableEnable:)];
barButton.possibleTitles = [NSSet setWithObjects:@"Disable", @"Enable", nil];
self.navigationItem.rightBarButtonItem = barButton;
}
-(void)disableEnable:(UIBarButtonItem *)button
{
self.form.disabled = !self.form.disabled;
[button setTitle:(self.form.disabled ? @"Enable" : @"Disable")];
[self.tableView endEditing:YES];
[self.tableView reloadData];
}
@end
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="p4n-1v-pzo">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14865.1" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="p4n-1v-pzo">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14819.2"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
@@ -11,7 +13,7 @@
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="p4n-1v-pzo" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="SNt-hk-N3V">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
@@ -21,7 +23,7 @@
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="jqF-cF-u4f" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="117" y="56"/>
<point key="canvasLocation" x="-3" y="38"/>
</scene>
<!--Others Form View Controller-->
<scene sceneID="dyJ-7m-RaD">
@@ -32,10 +34,11 @@
<viewControllerLayoutGuide type="bottom" id="HPb-Nx-E1G"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="wpr-wE-9nj">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="808"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
<navigationItem key="navigationItem" id="Hf0-cB-ORN"/>
<connections>
<segue destination="WMh-VN-FWi" kind="push" identifier="MapViewControllerSegue" id="wAD-tS-AFZ"/>
@@ -43,7 +46,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="7YZ-ZR-X81" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1533" y="-233"/>
<point key="canvasLocation" x="2221.739130434783" y="-156.02678571428569"/>
</scene>
<!--Native Event Form View Controller-->
<scene sceneID="EjT-rm-U3h">
@@ -54,15 +57,15 @@
<viewControllerLayoutGuide type="bottom" id="QuR-kY-o5R"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="tun-QW-CGC">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="842"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" translatesAutoresizingMaskIntoConstraints="NO" id="JY7-WL-SnH">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="808"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="JY7-WL-SnH" firstAttribute="leading" secondItem="tun-QW-CGC" secondAttribute="leading" id="bSe-SV-rx6"/>
<constraint firstAttribute="trailing" secondItem="JY7-WL-SnH" secondAttribute="trailing" id="jLI-68-pSq"/>
@@ -77,7 +80,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="zV0-mq-irv" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1120" y="-635"/>
<point key="canvasLocation" x="1623.1884057971015" y="-425.22321428571428"/>
</scene>
<!--Examples-->
<scene sceneID="wf7-ha-lXx">
@@ -88,15 +91,15 @@
<viewControllerLayoutGuide type="bottom" id="0bE-2H-tqE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="PO9-pF-A7O">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" translatesAutoresizingMaskIntoConstraints="NO" id="Lxj-Sb-kC6">
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
<rect key="frame" x="0.0" y="88" width="414" height="774"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Lxj-Sb-kC6" firstAttribute="top" secondItem="kOR-67-djF" secondAttribute="bottom" id="PT1-Xo-3Ql"/>
<constraint firstAttribute="trailing" secondItem="Lxj-Sb-kC6" secondAttribute="trailing" id="brq-yF-WM8"/>
@@ -111,11 +114,34 @@
<segue destination="G68-Ra-1fb" kind="push" identifier="SelectorsFormViewControllerSegue" id="vhA-cV-A02"/>
<segue destination="K9D-4c-9eZ" kind="modal" identifier="NativeEventNavigationViewControllerSegue" id="Iie-Js-Izx"/>
<segue destination="Kiw-nF-jv7" kind="push" identifier="ValidationExamplesFormViewControllerSegue" id="VKe-Ir-Fiu"/>
<segue destination="OG6-Tc-1SC" kind="push" identifier="PredicateFormViewControllerSegue" id="Wwg-e9-gLq"/>
<segue destination="pO0-sS-Tes" kind="push" identifier="BlogExampleViewSegue" id="a28-Gm-Iku"/>
<segue destination="JL7-uU-kWK" kind="push" identifier="BasicPredicateViewControllerSegue" id="SGg-Ve-bng"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="1V5-DZ-WfF" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="527" y="56"/>
<point key="canvasLocation" x="763.768115942029" y="37.5"/>
</scene>
<!--Blog Example View Controller-->
<scene sceneID="Vn0-9y-5bc">
<objects>
<viewController id="pO0-sS-Tes" customClass="BlogExampleViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="gjZ-Jv-Awa"/>
<viewControllerLayoutGuide type="bottom" id="scM-da-Sg0"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="hrV-fb-58s">
<rect key="frame" x="0.0" y="0.0" width="414" height="808"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
<navigationItem key="navigationItem" id="RJB-cz-SnF"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Fvo-wr-5Ca" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="242.0289855072464" y="770.75892857142856"/>
</scene>
<!--Validation Examples-->
<scene sceneID="z2I-Nk-y9W">
@@ -126,15 +152,15 @@
<viewControllerLayoutGuide type="bottom" id="xtJ-Wo-mhU"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="1Ol-Ra-Ysg">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" translatesAutoresizingMaskIntoConstraints="NO" id="Fty-3j-BeF">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<rect key="frame" x="0.0" y="24" width="414" height="838"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="xtJ-Wo-mhU" firstAttribute="top" secondItem="Fty-3j-BeF" secondAttribute="bottom" id="CbV-4f-RzP"/>
<constraint firstItem="Fty-3j-BeF" firstAttribute="top" secondItem="AG9-N9-2qp" secondAttribute="bottom" constant="-64" id="Pdw-VG-qcc"/>
@@ -151,7 +177,27 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="VFT-Og-STO" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="527" y="789"/>
<point key="canvasLocation" x="820.28985507246387" y="628.125"/>
</scene>
<!--Predicate Form View Controller-->
<scene sceneID="a9p-C8-g8y">
<objects>
<viewController id="OG6-Tc-1SC" customClass="PredicateFormViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="2YH-dK-JXQ"/>
<viewControllerLayoutGuide type="bottom" id="Lsg-dH-McH"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="6EZ-O7-FjX">
<rect key="frame" x="0.0" y="0.0" width="414" height="808"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
<navigationItem key="navigationItem" id="Lsd-xH-7IN"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="rZL-10-YZn" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1385.5072463768117" y="618.75"/>
</scene>
<!--Selectors Form View Controller-->
<scene sceneID="KYK-TX-8rm">
@@ -162,10 +208,11 @@
<viewControllerLayoutGuide type="bottom" id="CTu-Y5-7Qw"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="bNj-SD-83w">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="808"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
<navigationItem key="navigationItem" id="Buo-Af-6Q1"/>
<connections>
<segue destination="WMh-VN-FWi" kind="push" identifier="MapViewControllerSegue" id="Mtw-x2-E0b"/>
@@ -173,7 +220,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8fu-YK-6qz" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1346" y="533"/>
<point key="canvasLocation" x="1950.7246376811595" y="356.91964285714283"/>
</scene>
<!--Map View Controller-->
<scene sceneID="tAS-lK-35t">
@@ -184,15 +231,16 @@
<viewControllerLayoutGuide type="bottom" id="cgQ-Vs-ICN"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="JjC-E5-SyY">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="808"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
<navigationItem key="navigationItem" id="BjG-Bq-0lD"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="LmS-YR-mFY" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1789" y="533"/>
<point key="canvasLocation" x="2592.753623188406" y="356.91964285714283"/>
</scene>
<!--Native Event Navigation View Controller-->
<scene sceneID="mNb-be-ApA">
@@ -200,7 +248,7 @@
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="K9D-4c-9eZ" customClass="NativeEventNavigationViewController" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="fO3-V7-XXu">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="56"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
@@ -210,15 +258,64 @@
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="eqB-vl-BzH" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="588" y="-635"/>
<point key="canvasLocation" x="849.27536231884062" y="-437.94642857142856"/>
</scene>
<!--Basic Predicate View Controller-->
<scene sceneID="pD4-sm-x3a">
<objects>
<viewController id="JL7-uU-kWK" customClass="BasicPredicateViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="OQP-pW-kNp"/>
<viewControllerLayoutGuide type="bottom" id="2b4-gN-85p"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="NZg-t1-g19">
<rect key="frame" x="0.0" y="0.0" width="414" height="808"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<extendedEdge key="edgesForExtendedLayout" bottom="YES"/>
<navigationItem key="navigationItem" id="1lh-jZ-lIV"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Tlw-q2-pcu" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-230.43478260869566" y="770.75892857142856"/>
</scene>
<!--Users Table View Controller-->
<scene sceneID="lGi-0L-kUk">
<objects>
<viewController storyboardIdentifier="UsersTableViewController" automaticallyAdjustsScrollViewInsets="NO" definesPresentationContext="YES" modalPresentationStyle="currentContext" id="MON-q2-1DB" customClass="UsersTableViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="at2-Ds-EcY"/>
<viewControllerLayoutGuide type="bottom" id="uVG-bI-IMr"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="sMH-hT-NCg">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView autoresizesSubviews="NO" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" translatesAutoresizingMaskIntoConstraints="NO" id="fLo-Gu-rqr">
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</tableView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="uVG-bI-IMr" firstAttribute="top" secondItem="fLo-Gu-rqr" secondAttribute="bottom" id="25A-HG-wek"/>
<constraint firstItem="fLo-Gu-rqr" firstAttribute="top" secondItem="at2-Ds-EcY" secondAttribute="bottom" id="3N4-a2-LLf"/>
<constraint firstAttribute="trailing" secondItem="fLo-Gu-rqr" secondAttribute="trailing" id="IXV-p6-sAw"/>
<constraint firstItem="fLo-Gu-rqr" firstAttribute="leading" secondItem="sMH-hT-NCg" secondAttribute="leading" id="Xjr-w6-wlu"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="LIq-iZ-ILx"/>
<connections>
<outlet property="tableView" destination="fLo-Gu-rqr" id="2ES-0n-eVG"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="flB-2M-8zS" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1950.7246376811595" y="788.83928571428567"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
<inferredMetricsTieBreakers>
<segue reference="wAD-tS-AFZ"/>
<segue reference="Mtw-x2-E0b"/>
</inferredMetricsTieBreakers>
</document>
@@ -2,7 +2,7 @@
// UICustomizationFormViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// UICustomizationFormViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// ValidationExamplesFormViewController.h
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2,7 +2,7 @@
// ValidationExamplesFormViewController.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs ( http://xmartlabs.com )
// Copyright (c) 2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -26,10 +26,6 @@
#import "XLForm.h"
#import "ValidationExamplesFormViewController.h"
@interface ValidationExamplesFormViewController ()
@end
@implementation ValidationExamplesFormViewController
NSString * const kValidationName = @"kName";
@@ -93,7 +89,7 @@ NSString * const kValidationInteger = @"kInteger";
// number Section
section = [XLFormSectionDescriptor formSectionWithTitle:@"Validation Numbers"];
section.footerTitle = @"grather than 50 and less than 100";
section.footerTitle = @"greater than 50 and less than 100";
[formDescriptor addFormSection:section];
// Integer
@@ -101,7 +97,7 @@ NSString * const kValidationInteger = @"kInteger";
[row.cellConfigAtConfigure setObject:@"Required..." forKey:@"textField.placeholder"];
[row.cellConfigAtConfigure setObject:@(NSTextAlignmentRight) forKey:@"textField.textAlignment"];
row.required = YES;
[row addValidator:[XLFormRegexValidator formRegexValidatorWithMsg:@"grather than 50 and less than 100" regex:@"^([5-9][0-9]|100)$"]];
[row addValidator:[XLFormRegexValidator formRegexValidatorWithMsg:@"greater than 50 and less than 100" regex:@"^([5-9][0-9]|100)$"]];
[section addFormRow:row];
self.form = formDescriptor;
@@ -0,0 +1,22 @@
//
// XLFormInlineSegmentedCell.h
// XLForm
//
// Created by mathias Claassen on 16/12/15.
// Copyright © 2015 Xmartlabs. All rights reserved.
//
#import <XLForm/XLForm.h>
extern NSString * const XLFormRowDescriptorTypeSegmentedInline;
extern NSString * const XLFormRowDescriptorTypeSegmentedControl;
@interface XLFormInlineSegmentedCell : XLFormBaseCell
@end
@interface XLFormInlineSegmentedControl : XLFormBaseCell<XLFormInlineRowDescriptorCell>
@property (strong, nonatomic) UISegmentedControl* segmentedControl;
@end
@@ -0,0 +1,194 @@
//
// XLFormInlineSegmentedCell.m
// XLForm
//
// Created by mathias Claassen on 16/12/15.
// Copyright © 2015 Xmartlabs. All rights reserved.
//
#import "XLFormInlineSegmentedCell.h"
NSString * const XLFormRowDescriptorTypeSegmentedInline = @"XLFormRowDescriptorTypeSegmentedInline";
NSString * const XLFormRowDescriptorTypeSegmentedControl = @"XLFormRowDescriptorTypeSegmentedControl";
@implementation XLFormInlineSegmentedCell
+(void)load
{
[XLFormViewController.cellClassesForRowDescriptorTypes setObject:[XLFormInlineSegmentedCell class] forKey:XLFormRowDescriptorTypeSegmentedInline];
[XLFormViewController.inlineRowDescriptorTypesForRowDescriptorTypes setObject:XLFormRowDescriptorTypeSegmentedControl forKey:XLFormRowDescriptorTypeSegmentedInline];
}
- (BOOL)canBecomeFirstResponder
{
return YES;
}
-(BOOL)becomeFirstResponder
{
if (self.isFirstResponder){
return [super becomeFirstResponder];
}
BOOL result = [super becomeFirstResponder];
if (result){
XLFormRowDescriptor * inlineRowDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:[XLFormViewController inlineRowDescriptorTypesForRowDescriptorTypes][self.rowDescriptor.rowType]];
UITableViewCell<XLFormDescriptorCell> * cell = [inlineRowDescriptor cellForFormController:self.formViewController];
NSAssert([cell conformsToProtocol:@protocol(XLFormInlineRowDescriptorCell)], @"inline cell must conform to XLFormInlineRowDescriptorCell");
UITableViewCell<XLFormInlineRowDescriptorCell> * inlineCell = (UITableViewCell<XLFormInlineRowDescriptorCell> *)cell;
inlineCell.inlineRowDescriptor = self.rowDescriptor;
[self.rowDescriptor.sectionDescriptor addFormRow:inlineRowDescriptor afterRow:self.rowDescriptor];
[self.formViewController ensureRowIsVisible:inlineRowDescriptor];
}
return result;
}
-(BOOL)resignFirstResponder
{
if (![self isFirstResponder]) {
return [super resignFirstResponder];
}
NSIndexPath * selectedRowPath = [self.formViewController.form indexPathOfFormRow:self.rowDescriptor];
NSIndexPath * nextRowPath = [NSIndexPath indexPathForRow:selectedRowPath.row + 1 inSection:selectedRowPath.section];
XLFormRowDescriptor * nextFormRow = [self.formViewController.form formRowAtIndex:nextRowPath];
XLFormSectionDescriptor * formSection = [self.formViewController.form.formSections objectAtIndex:nextRowPath.section];
BOOL result = [super resignFirstResponder];
if (result) {
[formSection removeFormRow:nextFormRow];
}
return result;
}
#pragma mark - XLFormDescriptorCell
-(void)configure
{
[super configure];
}
-(void)update
{
[super update];
self.accessoryType = UITableViewCellAccessoryNone;
self.editingAccessoryType = UITableViewCellAccessoryNone;
[self.textLabel setText:self.rowDescriptor.title];
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.detailTextLabel.text = [self valueDisplayText];
}
-(BOOL)formDescriptorCellCanBecomeFirstResponder
{
return !(self.rowDescriptor.isDisabled);
}
-(BOOL)formDescriptorCellBecomeFirstResponder
{
if ([self isFirstResponder]){
[self resignFirstResponder];
return NO;
}
return [self becomeFirstResponder];
}
-(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller
{
[controller.tableView deselectRowAtIndexPath:[controller.form indexPathOfFormRow:self.rowDescriptor] animated:YES];
}
#pragma mark - Helpers
-(NSString *)valueDisplayText
{
return (self.rowDescriptor.value ? [self.rowDescriptor.value displayText] : self.rowDescriptor.noValueDisplayText);
}
@end
@implementation XLFormInlineSegmentedControl
@synthesize segmentedControl = _segmentedControl;
@synthesize inlineRowDescriptor = _inlineRowDescriptor;
+(void)load
{
[XLFormViewController.cellClassesForRowDescriptorTypes setObject:[XLFormInlineSegmentedControl class] forKey:XLFormRowDescriptorTypeSegmentedControl];
}
-(void)configure
{
[super configure];
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.contentView addSubview:self.segmentedControl];
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[segmentedControl]-|"
options:NSLayoutFormatAlignAllCenterY
metrics:0
views:@{@"segmentedControl": self.segmentedControl}]];
[self.segmentedControl addTarget:self action:@selector(valueChanged) forControlEvents:UIControlEventValueChanged];
}
-(void)update
{
[super update];
[self updateSegmentedControl];
self.segmentedControl.selectedSegmentIndex = [self selectedIndex];
self.segmentedControl.enabled = !self.rowDescriptor.isDisabled;
}
-(UISegmentedControl *)segmentedControl
{
if (_segmentedControl) return _segmentedControl;
_segmentedControl = [UISegmentedControl autolayoutView];
[_segmentedControl setContentHuggingPriority:500 forAxis:UILayoutConstraintAxisHorizontal];
return _segmentedControl;
}
#pragma mark - Action
-(void)valueChanged
{
self.inlineRowDescriptor.value = [self.inlineRowDescriptor.selectorOptions objectAtIndex:self.segmentedControl.selectedSegmentIndex];
[self.formViewController updateFormRow:self.inlineRowDescriptor];
}
#pragma mark - Helper
-(NSArray *)getItems
{
NSMutableArray * result = [[NSMutableArray alloc] init];
for (id option in self.inlineRowDescriptor.selectorOptions)
[result addObject:[option displayText]];
return result;
}
-(void)updateSegmentedControl
{
[self.segmentedControl removeAllSegments];
[[self getItems] enumerateObjectsUsingBlock:^(id object, NSUInteger idex, __unused BOOL *stop){
[self.segmentedControl insertSegmentWithTitle:[object displayText] atIndex:idex animated:NO];
}];
}
-(NSInteger)selectedIndex
{
XLFormRowDescriptor * formRow = self.inlineRowDescriptor ?: self.rowDescriptor;
if (formRow.value){
for (id option in formRow.selectorOptions){
if ([[option valueData] isEqual:[formRow.value valueData]]){
return [formRow.selectorOptions indexOfObject:option];
}
}
}
return -1;
}
@end
+6 -2
View File
@@ -1,10 +1,14 @@
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
platform :ios, '9.0'
target 'XLForm' do
pod 'XLForm', :path => '../../'
#Following pods are used for custom row examples
pod 'AFNetworking', '~> 2.0', :inhibit_warnings => true
pod 'XLDataLoader', '~> 1.1', :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
+61 -23
View File
@@ -1,47 +1,85 @@
PODS:
- AFNetworking (2.4.1):
- AFNetworking/NSURLConnection (= 2.4.1)
- AFNetworking/NSURLSession (= 2.4.1)
- AFNetworking/Reachability (= 2.4.1)
- AFNetworking/Security (= 2.4.1)
- AFNetworking/Serialization (= 2.4.1)
- AFNetworking/UIKit (= 2.4.1)
- AFNetworking/NSURLConnection (2.4.1):
- 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.4.1):
- AFNetworking/NSURLSession (2.6.3):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (2.4.1)
- AFNetworking/Security (2.4.1)
- AFNetworking/Serialization (2.4.1)
- AFNetworking/UIKit (2.4.1):
- 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)
- XLDataLoader (1.1.0):
- 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)
- XLForm (2.1.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 (4.3.0)
DEPENDENCIES:
- AFNetworking (~> 2.0)
- AXRatingView (= 1.0.3)
- JVFloatLabeledTextField (= 1.0.2)
- XLDataLoader (~> 1.1)
- SHSPhoneComponent
- XLData (from `https://github.com/xmartlabs/XLData.git`, commit `1f9019b56242a2019c7f7e11ec4ef823c397ebcf`)
- XLForm (from `../../`)
SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
- AFNetworking
- AXRatingView
- JVFloatLabeledTextField
- SHSPhoneComponent
EXTERNAL SOURCES:
XLData:
:commit: 1f9019b56242a2019c7f7e11ec4ef823c397ebcf
:git: https://github.com/xmartlabs/XLData.git
XLForm:
:path: ../../
:path: "../../"
CHECKOUT OPTIONS:
XLData:
:commit: 1f9019b56242a2019c7f7e11ec4ef823c397ebcf
:git: https://github.com/xmartlabs/XLData.git
SPEC CHECKSUMS:
AFNetworking: 0aabc6fae66d6e5d039eeb21c315843c7aae51ab
AXRatingView: 4f6d6c96f6d0efc1deaa6cf493dbb1ffcfa79e55
JVFloatLabeledTextField: c1ad6b4b5bd77115cfe6c71ba4c023866df5c4cf
XLDataLoader: bd783ebe782932a6390ffc7619fcd884c8600944
XLForm: c87bc94f769f52ce32793282d72d2fb15d0d5638
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
AXRatingView: ccaadc1bbda99a4b7e1d556059482d2b933a9f4e
JVFloatLabeledTextField: 58a3a32cfb800e5b224f676987e7c13abf50a14d
SHSPhoneComponent: 4cec0653a150ad63cbc52b0c8b29ce2d3c9c26f0
XLData: df725c6179e2e0c80bf56a1ecad9afd169707a6d
XLForm: a439f9512078ed538e8335c8b06d3f3286bbfd37
COCOAPODS: 0.35.0
PODFILE CHECKSUM: 64fbcd03a2c13762b2c18e3938cc8008807937c9
COCOAPODS: 1.11.3
@@ -27,36 +27,37 @@
28815E2E1A8589F600B674D2 /* MapViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28815E2D1A8589F600B674D2 /* MapViewController.xib */; };
28A7661F193248BD00D69546 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28A7661E193248BD00D69546 /* CoreData.framework */; };
28A76625193251E500D69546 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A76624193251E500D69546 /* AppDelegate.m */; };
28A7662E1932E98A00D69546 /* HTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A7662D1932E98A00D69546 /* HTTPSessionManager.m */; };
28A7663B1932EA1F00D69546 /* UserLocalDataLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A766361932EA1F00D69546 /* UserLocalDataLoader.m */; };
28A7663C1932EA1F00D69546 /* UserRemoteDataLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A766381932EA1F00D69546 /* UserRemoteDataLoader.m */; };
28A766451932EC9C00D69546 /* CoreDataStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A766401932EC9C00D69546 /* CoreDataStore.m */; };
28A766461932EC9C00D69546 /* User+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A766421932EC9C00D69546 /* User+Additions.m */; };
28A7664A1932ED3400D69546 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 28A766481932ED3400D69546 /* Model.xcdatamodeld */; };
28A7664D1932EE0B00D69546 /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A7664C1932EE0B00D69546 /* User.m */; };
28A766551932F22400D69546 /* UsersTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A766541932F22400D69546 /* UsersTableViewController.m */; };
28A7665E1932F61100D69546 /* DynamicSelectorsFormViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28A7665D1932F61100D69546 /* DynamicSelectorsFormViewController.m */; };
28A8083E190D9083009D77F8 /* iPhoneStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 28A8083D190D9083009D77F8 /* iPhoneStoryboard.storyboard */; };
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 */; };
3C3B01D61AB741EF0027CD45 /* XLFormRatingCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3C3B01D41AB741EF0027CD45 /* XLFormRatingCell.xib */; };
3C3B01DA1AB7497D0027CD45 /* XLFormWeekDaysCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3B01D81AB7497D0027CD45 /* XLFormWeekDaysCell.m */; };
3C3B01DB1AB7497D0027CD45 /* XLFormWeekDaysCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3C3B01D91AB7497D0027CD45 /* XLFormWeekDaysCell.xib */; };
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 */; };
BF9DB1D61AE0436600B985E7 /* PredicateFormViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BF9DB1D41AE0436600B985E7 /* PredicateFormViewController.m */; };
BFA5F4B11BB48F8E00D045BD /* XLFormRatingCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3C3B01D41AB741EF0027CD45 /* XLFormRatingCell.xib */; };
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 = AccessoryViews/AccessoryViewFormViewController.h; sourceTree = "<group>"; };
282EB27B1AB5FF33004A736F /* AccessoryViewFormViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AccessoryViewFormViewController.m; path = AccessoryViews/AccessoryViewFormViewController.m; sourceTree = "<group>"; };
282EB27A1AB5FF33004A736F /* AccessoryViewFormViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AccessoryViewFormViewController.h; path = Examples/AccessoryViews/AccessoryViewFormViewController.h; sourceTree = "<group>"; };
282EB27B1AB5FF33004A736F /* AccessoryViewFormViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AccessoryViewFormViewController.m; path = Examples/AccessoryViews/AccessoryViewFormViewController.m; sourceTree = "<group>"; };
283B59B019532415000828CD /* MapViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MapViewController.h; path = Examples/Selectors/CustomSelectors/XLFormRowViewController/MapViewController.h; sourceTree = "<group>"; };
283B59B119532415000828CD /* MapViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MapViewController.m; path = Examples/Selectors/CustomSelectors/XLFormRowViewController/MapViewController.m; sourceTree = "<group>"; };
283B59B5195334AF000828CD /* CustomSelectorsFormViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomSelectorsFormViewController.h; path = Examples/Selectors/CustomSelectors/CustomSelectorsFormViewController.h; sourceTree = "<group>"; };
@@ -88,19 +89,6 @@
28815E2D1A8589F600B674D2 /* MapViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MapViewController.xib; path = Examples/Selectors/CustomSelectors/XLFormRowViewController/MapViewController.xib; sourceTree = "<group>"; };
28A7661E193248BD00D69546 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
28A76624193251E500D69546 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Examples/AppDelegate.m; sourceTree = "<group>"; };
28A7662C1932E98A00D69546 /* HTTPSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTTPSessionManager.h; path = Examples/Selectors/Helpers/HTTPSessionManager.h; sourceTree = "<group>"; };
28A7662D1932E98A00D69546 /* HTTPSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTTPSessionManager.m; path = Examples/Selectors/Helpers/HTTPSessionManager.m; sourceTree = "<group>"; };
28A766351932EA1F00D69546 /* UserLocalDataLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserLocalDataLoader.h; sourceTree = "<group>"; };
28A766361932EA1F00D69546 /* UserLocalDataLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserLocalDataLoader.m; sourceTree = "<group>"; };
28A766371932EA1F00D69546 /* UserRemoteDataLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserRemoteDataLoader.h; sourceTree = "<group>"; };
28A766381932EA1F00D69546 /* UserRemoteDataLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserRemoteDataLoader.m; sourceTree = "<group>"; };
28A7663F1932EC9C00D69546 /* CoreDataStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreDataStore.h; sourceTree = "<group>"; };
28A766401932EC9C00D69546 /* CoreDataStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreDataStore.m; sourceTree = "<group>"; };
28A766411932EC9C00D69546 /* User+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "User+Additions.h"; sourceTree = "<group>"; };
28A766421932EC9C00D69546 /* User+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "User+Additions.m"; sourceTree = "<group>"; };
28A766491932ED3400D69546 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = "<group>"; };
28A7664B1932EE0B00D69546 /* User.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = User.h; sourceTree = "<group>"; };
28A7664C1932EE0B00D69546 /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = User.m; sourceTree = "<group>"; };
28A766531932F22400D69546 /* UsersTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UsersTableViewController.h; path = Examples/Selectors/DynamicSelector/UsersTableViewController.h; sourceTree = "<group>"; };
28A766541932F22400D69546 /* UsersTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UsersTableViewController.m; path = Examples/Selectors/DynamicSelector/UsersTableViewController.m; sourceTree = "<group>"; };
28A7665C1932F61100D69546 /* DynamicSelectorsFormViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DynamicSelectorsFormViewController.h; path = Examples/Selectors/DynamicSelector/DynamicSelectorsFormViewController.h; sourceTree = "<group>"; };
@@ -125,11 +113,24 @@
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>"; };
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>"; };
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>"; };
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; };
BF9DB1D21AE0436600B985E7 /* BlogExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BlogExampleViewController.m; path = Examples/PredicateExamples/BlogExampleViewController.m; sourceTree = SOURCE_ROOT; };
BF9DB1D31AE0436600B985E7 /* PredicateFormViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PredicateFormViewController.h; path = Examples/PredicateExamples/PredicateFormViewController.h; sourceTree = SOURCE_ROOT; };
BF9DB1D41AE0436600B985E7 /* PredicateFormViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PredicateFormViewController.m; path = Examples/PredicateExamples/PredicateFormViewController.m; sourceTree = SOURCE_ROOT; };
BFE91AF91AE159B200DE5231 /* BasicPredicateViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BasicPredicateViewController.h; path = Examples/PredicateExamples/BasicPredicateViewController.h; sourceTree = SOURCE_ROOT; };
BFE91AFA1AE159B200DE5231 /* BasicPredicateViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BasicPredicateViewController.m; path = Examples/PredicateExamples/BasicPredicateViewController.m; sourceTree = SOURCE_ROOT; };
D51B8B2A19126664008C0478 /* XLFormCustomCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XLFormCustomCell.h; path = Examples/Others/CustomCells/XLFormCustomCell.h; sourceTree = "<group>"; };
D51B8B2B19126664008C0478 /* XLFormCustomCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XLFormCustomCell.m; path = Examples/Others/CustomCells/XLFormCustomCell.m; sourceTree = "<group>"; };
F6DF43B7BBF44F72A4493E8E /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
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>"; };
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 */
@@ -141,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 = (
@@ -211,7 +203,6 @@
children = (
283B59AF19531DDA000828CD /* CustomSelectors */,
28A766521932F1FA00D69546 /* DynamicSelector */,
28A7662B1932E92D00D69546 /* Helpers */,
2843EB4918D496F600F13E2B /* SelectorsFormViewController.h */,
2843EB4A18D496F600F13E2B /* SelectorsFormViewController.m */,
);
@@ -231,6 +222,8 @@
2843EB5318D4F77F00F13E2B /* Dates */ = {
isa = PBXGroup;
children = (
66B6266C1AE0055100007886 /* DateAndTimeValueTrasformer.h */,
66B6266D1AE0055100007886 /* DateAndTimeValueTrasformer.m */,
2843EB5418D4F7B700F13E2B /* DatesFormViewController.h */,
2843EB5518D4F7B700F13E2B /* DatesFormViewController.m */,
);
@@ -262,7 +255,7 @@
2850C60118D0F706002B7D0A /* XLForm */,
2850C5FA18D0F706002B7D0A /* Frameworks */,
2850C5F918D0F706002B7D0A /* Products */,
15E61D225B0D27FAB51BDD90 /* Pods */,
B6478577DDCB0DDDD433C572 /* Pods */,
);
sourceTree = "<group>";
};
@@ -281,7 +274,7 @@
2850C5FB18D0F706002B7D0A /* Foundation.framework */,
2850C5FD18D0F706002B7D0A /* CoreGraphics.framework */,
2850C5FF18D0F706002B7D0A /* UIKit.framework */,
F6DF43B7BBF44F72A4493E8E /* libPods.a */,
19383D268EF8024CB33FCCA4 /* libPods-XLForm.a */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -313,6 +306,7 @@
282EB2791AB5FD66004A736F /* AccessoryViews */,
3CDAFC741AB0AEE5000F75B6 /* CustomRows */,
28F89F2B1AA4E99500E90218 /* Validations */,
DEB823591AD5529A00AF9FE2 /* Formatters */,
283C6B7A1999BA1B00A5283D /* UICustomization */,
28A76624193251E500D69546 /* AppDelegate.m */,
28A8083C190D903D009D77F8 /* StoryboardExample */,
@@ -322,6 +316,7 @@
2843EB4F18D4CFA100F13E2B /* Others */,
2843EB4818D496CB00F13E2B /* Selectors */,
2850C60A18D0F706002B7D0A /* AppDelegate.h */,
BFD5D6F41AD2FFC1006F04FA /* PredicateExamples */,
282C5EEF18D33C1800A5D47C /* Inputs */,
2843EB4518D4915800F13E2B /* ExamplesFormViewController.h */,
2843EB4618D4915800F13E2B /* ExamplesFormViewController.m */,
@@ -340,55 +335,10 @@
name = CustomCells;
sourceTree = "<group>";
};
28A7662B1932E92D00D69546 /* Helpers */ = {
isa = PBXGroup;
children = (
28A7663D1932EC9C00D69546 /* Data */,
28A766301932EA1F00D69546 /* DataLoaders */,
28A7662C1932E98A00D69546 /* HTTPSessionManager.h */,
28A7662D1932E98A00D69546 /* HTTPSessionManager.m */,
);
name = Helpers;
sourceTree = "<group>";
};
28A766301932EA1F00D69546 /* DataLoaders */ = {
isa = PBXGroup;
children = (
28A766351932EA1F00D69546 /* UserLocalDataLoader.h */,
28A766361932EA1F00D69546 /* UserLocalDataLoader.m */,
28A766371932EA1F00D69546 /* UserRemoteDataLoader.h */,
28A766381932EA1F00D69546 /* UserRemoteDataLoader.m */,
);
name = DataLoaders;
path = Examples/Selectors/Helpers/DataLoaders;
sourceTree = "<group>";
};
28A7663D1932EC9C00D69546 /* Data */ = {
isa = PBXGroup;
children = (
28A7663E1932EC9C00D69546 /* Store */,
28A766411932EC9C00D69546 /* User+Additions.h */,
28A766421932EC9C00D69546 /* User+Additions.m */,
28A766481932ED3400D69546 /* Model.xcdatamodeld */,
28A7664B1932EE0B00D69546 /* User.h */,
28A7664C1932EE0B00D69546 /* User.m */,
);
name = Data;
path = Examples/Selectors/Helpers/Data;
sourceTree = "<group>";
};
28A7663E1932EC9C00D69546 /* Store */ = {
isa = PBXGroup;
children = (
28A7663F1932EC9C00D69546 /* CoreDataStore.h */,
28A766401932EC9C00D69546 /* CoreDataStore.m */,
);
path = Store;
sourceTree = "<group>";
};
28A766521932F1FA00D69546 /* DynamicSelector */ = {
isa = PBXGroup;
children = (
DEA6EF8E1B57D698000F4893 /* SessionManager */,
28A7665A1932F55700D69546 /* XLFormRowViewController */,
28A7665C1932F61100D69546 /* DynamicSelectorsFormViewController.h */,
28A7665D1932F61100D69546 /* DynamicSelectorsFormViewController.m */,
@@ -464,6 +414,7 @@
3CDAFC741AB0AEE5000F75B6 /* CustomRows */ = {
isa = PBXGroup;
children = (
BF01E9251C21F02D00BDE045 /* Inline Segmented */,
3C3B01D01AB741C40027CD45 /* Rating */,
3C3B01E31AB74AC10027CD45 /* FloatLabeledTextField */,
3C3B01D11AB741CC0027CD45 /* Weekdays */,
@@ -473,6 +424,57 @@
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 = (
BF01E9261C21F0BB00BDE045 /* XLFormInlineSegmentedCell.h */,
BF01E9271C21F0BB00BDE045 /* XLFormInlineSegmentedCell.m */,
);
name = "Inline Segmented";
sourceTree = "<group>";
};
BFD5D6F41AD2FFC1006F04FA /* PredicateExamples */ = {
isa = PBXGroup;
children = (
BF9DB1D11AE0436600B985E7 /* BlogExampleViewController.h */,
BF9DB1D21AE0436600B985E7 /* BlogExampleViewController.m */,
BF9DB1D31AE0436600B985E7 /* PredicateFormViewController.h */,
BF9DB1D41AE0436600B985E7 /* PredicateFormViewController.m */,
BFE91AF91AE159B200DE5231 /* BasicPredicateViewController.h */,
BFE91AFA1AE159B200DE5231 /* BasicPredicateViewController.m */,
);
name = PredicateExamples;
path = Examples/PredicateDisabling;
sourceTree = "<group>";
};
DEA6EF8E1B57D698000F4893 /* SessionManager */ = {
isa = PBXGroup;
children = (
DEA6EF8F1B57D6CC000F4893 /* HTTPSessionManager.h */,
DEA6EF901B57D6CC000F4893 /* HTTPSessionManager.m */,
);
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 */
@@ -480,11 +482,11 @@
isa = PBXNativeTarget;
buildConfigurationList = 2850C62418D0F707002B7D0A /* Build configuration list for PBXNativeTarget "XLForm" */;
buildPhases = (
0EA9FCE3DA0D444498836D37 /* Check Pods Manifest.lock */,
EBE0335CCC7588D83B89A92A /* [CP] Check Pods Manifest.lock */,
2850C5F418D0F706002B7D0A /* Sources */,
2850C5F518D0F706002B7D0A /* Frameworks */,
2850C5F618D0F706002B7D0A /* Resources */,
CFE72E068B5F4D9BB45FB757 /* Copy Pods Resources */,
DE3D12F5596780A66C6C3D4A /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -501,7 +503,7 @@
2850C5F018D0F706002B7D0A /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
LastUpgradeCheck = 1100;
ORGANIZATIONNAME = Xmartlabs;
};
buildConfigurationList = 2850C5F318D0F706002B7D0A /* Build configuration list for PBXProject "XLForm" */;
@@ -509,6 +511,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = 2850C5EF18D0F706002B7D0A;
@@ -528,10 +531,10 @@
files = (
28468EA718EF594900DBB015 /* Localizable.strings in Resources */,
2850C60618D0F706002B7D0A /* InfoPlist.strings in Resources */,
BFA5F4B11BB48F8E00D045BD /* XLFormRatingCell.xib in Resources */,
28815E2E1A8589F600B674D2 /* MapViewController.xib in Resources */,
3C0357F01AB0D82300200C8A /* Images.xcassets in Resources */,
3C3B01DB1AB7497D0027CD45 /* XLFormWeekDaysCell.xib in Resources */,
3C3B01D61AB741EF0027CD45 /* XLFormRatingCell.xib in Resources */,
28A8083E190D9083009D77F8 /* iPhoneStoryboard.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -539,34 +542,40 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
0EA9FCE3DA0D444498836D37 /* Check Pods Manifest.lock */ = {
DE3D12F5596780A66C6C3D4A /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-XLForm/Pods-XLForm-resources.sh",
"${PODS_ROOT}/../../../XLForm/XLForm.bundle",
);
name = "Check Pods Manifest.lock";
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/XLForm.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-XLForm/Pods-XLForm-resources.sh\"\n";
showEnvVarsInLog = 0;
};
CFE72E068B5F4D9BB45FB757 /* Copy Pods Resources */ = {
EBE0335CCC7588D83B89A92A /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "Copy Pods Resources";
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-XLForm-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -579,30 +588,30 @@
283B59B7195334AF000828CD /* CustomSelectorsFormViewController.m in Sources */,
28A766551932F22400D69546 /* UsersTableViewController.m in Sources */,
3CDAFC7A1AB0AFA4000F75B6 /* CustomRowsViewController.m in Sources */,
28A7663B1932EA1F00D69546 /* UserLocalDataLoader.m in Sources */,
DEA6EF911B57D6CC000F4893 /* HTTPSessionManager.m in Sources */,
282EB27C1AB5FF33004A736F /* AccessoryViewFormViewController.m in Sources */,
BF9DB1D51AE0436600B985E7 /* BlogExampleViewController.m in Sources */,
2850C60818D0F706002B7D0A /* main.m in Sources */,
D51B8B2C19126664008C0478 /* XLFormCustomCell.m in Sources */,
28A7664D1932EE0B00D69546 /* User.m in Sources */,
28A7664A1932ED3400D69546 /* Model.xcdatamodeld in Sources */,
3C3B01F01AB74BDC0027CD45 /* FloatLabeledTextFieldCell.m in Sources */,
28A766461932EC9C00D69546 /* User+Additions.m in Sources */,
28DBB04118D76FDC00FB8A8B /* MultivaluedFormViewController.m in Sources */,
28A85D5918E346C100E81A26 /* XLFormImageSelectorCell.m in Sources */,
28468E9818EC686500DBB015 /* NativeEventFormViewController.m in Sources */,
3C3B01DA1AB7497D0027CD45 /* XLFormWeekDaysCell.m in Sources */,
28F89F2E1AA4EA5600E90218 /* ValidationExamplesFormViewController.m in Sources */,
66B6266E1AE0055100007886 /* DateAndTimeValueTrasformer.m in Sources */,
3C3B01D51AB741EF0027CD45 /* XLFormRatingCell.m in Sources */,
28A7665E1932F61100D69546 /* DynamicSelectorsFormViewController.m in Sources */,
281E5BE919538F4A006D93C5 /* CLLocationValueTrasformer.m in Sources */,
2843EB5618D4F7B700F13E2B /* DatesFormViewController.m in Sources */,
283C6B7D1999BAF100A5283D /* UICustomizationFormViewController.m in Sources */,
3C3B01E21AB7499A0027CD45 /* XLRatingView.m in Sources */,
28A7662E1932E98A00D69546 /* HTTPSessionManager.m in Sources */,
283B59B219532415000828CD /* MapViewController.m in Sources */,
2843EB4718D4915800F13E2B /* ExamplesFormViewController.m in Sources */,
28A766451932EC9C00D69546 /* CoreDataStore.m in Sources */,
28A7663C1932EA1F00D69546 /* UserRemoteDataLoader.m in Sources */,
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 */,
@@ -636,22 +645,37 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
@@ -664,7 +688,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
@@ -674,29 +698,43 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
@@ -704,14 +742,15 @@
};
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;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "XLForm/XLForm-Prefix.pch";
INFOPLIST_FILE = "XLForm/XLForm-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.xmartlabs.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
@@ -720,14 +759,16 @@
};
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";
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.xmartlabs.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
@@ -756,19 +797,6 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCVersionGroup section */
28A766481932ED3400D69546 /* Model.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
28A766491932ED3400D69546 /* Model.xcdatamodel */,
);
currentVersion = 28A766491932ED3400D69546 /* Model.xcdatamodel */;
path = Model.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};
/* End XCVersionGroup section */
};
rootObject = 2850C5F018D0F706002B7D0A /* Project object */;
}
@@ -1,15 +1,50 @@
{
"images" : [
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "xl_appicon_58.png",
"size" : "20x20",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "xl_appicon_80.png",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "xl_appicon_57.png",
"scale" : "1x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "xl_appicon_114.png",
"scale" : "2x"
},
{
@@ -22,6 +57,163 @@
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "50x50",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "50x50",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "72x72",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "72x72",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "xl_appicon_76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "xl_appicon_152.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
},
{
"size" : "24x24",
"idiom" : "watch",
"scale" : "2x",
"role" : "notificationCenter",
"subtype" : "38mm"
},
{
"size" : "27.5x27.5",
"idiom" : "watch",
"scale" : "2x",
"role" : "notificationCenter",
"subtype" : "42mm"
},
{
"size" : "29x29",
"idiom" : "watch",
"role" : "companionSettings",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "watch",
"role" : "companionSettings",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "watch",
"scale" : "2x",
"role" : "appLauncher",
"subtype" : "38mm"
},
{
"size" : "44x44",
"idiom" : "watch",
"scale" : "2x",
"role" : "appLauncher",
"subtype" : "40mm"
},
{
"size" : "50x50",
"idiom" : "watch",
"scale" : "2x",
"role" : "appLauncher",
"subtype" : "44mm"
},
{
"size" : "86x86",
"idiom" : "watch",
"scale" : "2x",
"role" : "quickLook",
"subtype" : "38mm"
},
{
"size" : "98x98",
"idiom" : "watch",
"scale" : "2x",
"role" : "quickLook",
"subtype" : "42mm"
},
{
"size" : "108x108",
"idiom" : "watch",
"scale" : "2x",
"role" : "quickLook",
"subtype" : "44mm"
},
{
"idiom" : "watch-marketing",
"size" : "1024x1024",
"scale" : "1x"
},
{
"idiom" : "car",
"size" : "120x120",
"scale" : "1x"
},
{
"size" : "44x44",
"idiom" : "watch",
"scale" : "2x",
"role" : "longLook",
"subtype" : "42mm"
}
],
"info" : {
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 883 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

@@ -2,6 +2,11 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
@@ -9,7 +14,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.xmartlabs.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@@ -17,11 +22,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.1</string>
<string>3.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.0.1</string>
<string>3.0.1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
@@ -3,7 +3,7 @@
XLForm
Created by Martin Barreto on 4/4/14.
Copyright (c) 2014 Xmartlabs. All rights reserved.
Copyright (c) 2015 Xmartlabs. All rights reserved.
*/
+1 -1
View File
@@ -2,7 +2,7 @@
// main.m
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014 Xmartlabs. All rights reserved.
// Copyright (c) 2015 Xmartlabs. All rights reserved.
//
#import <UIKit/UIKit.h>
+4 -2
View File
@@ -1,7 +1,9 @@
platform :ios, '8.0'
platform :ios, '9.0'
target 'SwiftExample' do
pod 'XLForm', :path => '../../'
pod 'XLForm', :path => '../../'
pod 'JVFloatLabeledTextField', '1.0.2', :inhibit_warnings => true
pod 'AXRatingView', '1.0.3', :inhibit_warnings => true
end
-14
View File
@@ -1,14 +0,0 @@
PODS:
- XLForm (2.1.0)
DEPENDENCIES:
- XLForm (from `../../`)
EXTERNAL SOURCES:
XLForm:
:path: ../../
SPEC CHECKSUMS:
XLForm: c87bc94f769f52ce32793282d72d2fb15d0d5638
COCOAPODS: 0.35.0
@@ -7,26 +7,80 @@
objects = {
/* Begin PBXBuildFile section */
2724071466166BFA1E54E659 /* libPods-SwiftExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 854F8DF43072D7C59CBECB68 /* libPods-SwiftExample.a */; };
2847A6A41AAF2679000A2ABE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2847A6A31AAF2679000A2ABE /* AppDelegate.swift */; };
2847A6A91AAF2679000A2ABE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2847A6A71AAF2679000A2ABE /* Main.storyboard */; };
2847A6AB1AAF2679000A2ABE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2847A6AA1AAF2679000A2ABE /* Images.xcassets */; };
2847A6AE1AAF2679000A2ABE /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2847A6AC1AAF2679000A2ABE /* LaunchScreen.xib */; };
2860673E1AEDBD4A002F1E04 /* CustomRowsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286067321AEDBD4A002F1E04 /* CustomRowsViewController.swift */; };
2860673F1AEDBD4A002F1E04 /* FloatLabeledTextFieldCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286067341AEDBD4A002F1E04 /* FloatLabeledTextFieldCell.swift */; };
286067411AEDBD4A002F1E04 /* XLFormRatingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286067391AEDBD4A002F1E04 /* XLFormRatingCell.swift */; };
286067421AEDBD4A002F1E04 /* XLFormRatingCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2860673A1AEDBD4A002F1E04 /* XLFormRatingCell.xib */; };
286067431AEDBD4A002F1E04 /* XLFormWeekDaysCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2860673C1AEDBD4A002F1E04 /* XLFormWeekDaysCell.swift */; };
286067441AEDBD4A002F1E04 /* XLFormWeekDaysCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2860673D1AEDBD4A002F1E04 /* XLFormWeekDaysCell.xib */; };
286067461AEDC3D7002F1E04 /* XLRatingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286067451AEDC3D7002F1E04 /* XLRatingView.swift */; };
286E8B751AE809EF00F2767A /* DynamicSelectorsFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B731AE809EF00F2767A /* DynamicSelectorsFormViewController.swift */; };
286E8B781AE80C4300F2767A /* UsersTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B771AE80C4300F2767A /* UsersTableViewController.swift */; };
286E8B7E1AE86C8900F2767A /* XLFormCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B7C1AE86C8900F2767A /* XLFormCustomCell.swift */; };
286E8B7F1AE86C8900F2767A /* OthersFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B7D1AE86C8900F2767A /* OthersFormViewController.swift */; };
286E8B861AE9286B00F2767A /* CustomSelectorsFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B811AE9286B00F2767A /* CustomSelectorsFormViewController.swift */; };
286E8B871AE9286B00F2767A /* CLLocationValueTrasformer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B831AE9286B00F2767A /* CLLocationValueTrasformer.swift */; };
286E8B881AE9286B00F2767A /* MapViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B841AE9286B00F2767A /* MapViewController.swift */; };
286E8B891AE9286B00F2767A /* MapViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 286E8B851AE9286B00F2767A /* MapViewController.xib */; };
286E8B8C1AE9993F00F2767A /* MultivaluedFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 286E8B8B1AE9993F00F2767A /* MultivaluedFormViewController.swift */; };
288646151AE59474007A8B9B /* ExamplesFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 288646141AE59474007A8B9B /* ExamplesFormViewController.swift */; };
288646181AE5C7EA007A8B9B /* iPhoneStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 288646171AE5C7EA007A8B9B /* iPhoneStoryboard.storyboard */; };
2886461C1AE5C958007A8B9B /* NativeEventFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2886461A1AE5C958007A8B9B /* NativeEventFormViewController.swift */; };
2886461F1AE5FEB5007A8B9B /* DateAndTimeValueTrasformer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2886461E1AE5FEB5007A8B9B /* DateAndTimeValueTrasformer.swift */; };
28B920751AE6F02F00BD6382 /* InputsFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28B920741AE6F02F00BD6382 /* InputsFormViewController.swift */; };
28B920781AE73AA600BD6382 /* SelectorsFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28B920771AE73AA600BD6382 /* SelectorsFormViewController.swift */; };
28D832571AEBC4A7009E3B3F /* AccessoryViewFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D832561AEBC4A7009E3B3F /* AccessoryViewFormViewController.swift */; };
28D832631AEBE4E4009E3B3F /* BasicPredicateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D832601AEBE4E4009E3B3F /* BasicPredicateViewController.swift */; };
28D832671AEBEAA0009E3B3F /* BlogExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D832661AEBEAA0009E3B3F /* BlogExampleViewController.swift */; };
28D832691AEBFE9F009E3B3F /* PredicateFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D832681AEBFE9F009E3B3F /* PredicateFormViewController.swift */; };
28D8326C1AEC177E009E3B3F /* ValidationExamplesFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D8326B1AEC177E009E3B3F /* ValidationExamplesFormViewController.swift */; };
28D8326F1AEC2D1B009E3B3F /* UICustomizationFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28D8326E1AEC2D1B009E3B3F /* UICustomizationFormViewController.swift */; };
28F490221AAFBBC600C8E0CC /* DatesFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28F490211AAFBBC600C8E0CC /* DatesFormViewController.swift */; };
649437BA8D5B7C59BBDB7B92 /* libPods-SwiftExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E006C7F7FF8E967AA8661BC9 /* libPods-SwiftExample.a */; };
BF01E92B1C21FF2800BDE045 /* InlineSegmentedCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF01E92A1C21FF2800BDE045 /* InlineSegmentedCell.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
2847A69E1AAF2679000A2ABE /* SwiftExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
2847A6A21AAF2679000A2ABE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2847A6A31AAF2679000A2ABE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
2847A6A81AAF2679000A2ABE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
2847A6A31AAF2679000A2ABE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = AppDelegate.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
2847A6AA1AAF2679000A2ABE /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
2847A6AD1AAF2679000A2ABE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
2847A6C31AAF2B14000A2ABE /* SwiftExample-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SwiftExample-Bridging-Header.h"; sourceTree = "<group>"; };
28F490211AAFBBC600C8E0CC /* DatesFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatesFormViewController.swift; sourceTree = "<group>"; };
2EB9C638FC2450A0B9786D1E /* Pods-SwiftExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.release.xcconfig"; sourceTree = "<group>"; };
420D9BAB7B0D2AF9487DD060 /* Pods-SwiftExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.debug.xcconfig"; sourceTree = "<group>"; };
854F8DF43072D7C59CBECB68 /* libPods-SwiftExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwiftExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
286067321AEDBD4A002F1E04 /* CustomRowsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = CustomRowsViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
286067341AEDBD4A002F1E04 /* FloatLabeledTextFieldCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FloatLabeledTextFieldCell.swift; sourceTree = "<group>"; };
286067391AEDBD4A002F1E04 /* XLFormRatingCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XLFormRatingCell.swift; sourceTree = "<group>"; };
2860673A1AEDBD4A002F1E04 /* XLFormRatingCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = XLFormRatingCell.xib; sourceTree = "<group>"; };
2860673C1AEDBD4A002F1E04 /* XLFormWeekDaysCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XLFormWeekDaysCell.swift; sourceTree = "<group>"; };
2860673D1AEDBD4A002F1E04 /* XLFormWeekDaysCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = XLFormWeekDaysCell.xib; sourceTree = "<group>"; };
286067451AEDC3D7002F1E04 /* XLRatingView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XLRatingView.swift; sourceTree = "<group>"; };
286E8B731AE809EF00F2767A /* DynamicSelectorsFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = DynamicSelectorsFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
286E8B771AE80C4300F2767A /* UsersTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UsersTableViewController.swift; path = SwiftExample/DynamicSelector/UsersTableViewController.swift; sourceTree = SOURCE_ROOT; };
286E8B7C1AE86C8900F2767A /* XLFormCustomCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XLFormCustomCell.swift; sourceTree = "<group>"; };
286E8B7D1AE86C8900F2767A /* OthersFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = OthersFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
286E8B811AE9286B00F2767A /* CustomSelectorsFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = CustomSelectorsFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
286E8B831AE9286B00F2767A /* CLLocationValueTrasformer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = CLLocationValueTrasformer.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
286E8B841AE9286B00F2767A /* MapViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MapViewController.swift; sourceTree = "<group>"; };
286E8B851AE9286B00F2767A /* MapViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MapViewController.xib; sourceTree = "<group>"; };
286E8B8B1AE9993F00F2767A /* MultivaluedFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = MultivaluedFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
288646141AE59474007A8B9B /* ExamplesFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = ExamplesFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
288646171AE5C7EA007A8B9B /* iPhoneStoryboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = iPhoneStoryboard.storyboard; sourceTree = "<group>"; };
2886461A1AE5C958007A8B9B /* NativeEventFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = NativeEventFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
2886461E1AE5FEB5007A8B9B /* DateAndTimeValueTrasformer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DateAndTimeValueTrasformer.swift; sourceTree = "<group>"; };
28B920741AE6F02F00BD6382 /* InputsFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; name = InputsFormViewController.swift; path = SwiftExample/Inputs/InputsFormViewController.swift; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
28B920771AE73AA600BD6382 /* SelectorsFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectorsFormViewController.swift; sourceTree = "<group>"; };
28D832561AEBC4A7009E3B3F /* AccessoryViewFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = AccessoryViewFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
28D832601AEBE4E4009E3B3F /* BasicPredicateViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BasicPredicateViewController.swift; sourceTree = "<group>"; };
28D832661AEBEAA0009E3B3F /* BlogExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BlogExampleViewController.swift; path = SwiftExample/PredicateExamples/BlogExampleViewController.swift; sourceTree = SOURCE_ROOT; };
28D832681AEBFE9F009E3B3F /* PredicateFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PredicateFormViewController.swift; path = SwiftExample/PredicateExamples/PredicateFormViewController.swift; sourceTree = SOURCE_ROOT; };
28D8326B1AEC177E009E3B3F /* ValidationExamplesFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationExamplesFormViewController.swift; sourceTree = "<group>"; };
28D8326E1AEC2D1B009E3B3F /* UICustomizationFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UICustomizationFormViewController.swift; sourceTree = "<group>"; };
28F490211AAFBBC600C8E0CC /* DatesFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = DatesFormViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
BF01E92A1C21FF2800BDE045 /* InlineSegmentedCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = InlineSegmentedCell.swift; path = InlineSegmentedCell/InlineSegmentedCell.swift; sourceTree = "<group>"; };
CD0A6F89B9CD5843CA297E52 /* Pods-SwiftExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.release.xcconfig"; sourceTree = "<group>"; };
E006C7F7FF8E967AA8661BC9 /* libPods-SwiftExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwiftExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
F019783EE34BD17E2BA41467 /* Pods-SwiftExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -34,7 +88,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2724071466166BFA1E54E659 /* libPods-SwiftExample.a in Frameworks */,
649437BA8D5B7C59BBDB7B92 /* libPods-SwiftExample.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -46,8 +100,8 @@
children = (
2847A6A01AAF2679000A2ABE /* SwiftExample */,
2847A69F1AAF2679000A2ABE /* Products */,
7A12A831117D9B4D152E0A51 /* Pods */,
402AE3EC1FACD058DCF0A2D3 /* Frameworks */,
E9F3DD7ACEF5AAF92FCE6E24 /* Pods */,
3D93F92C6A8B49B82B452B67 /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -62,11 +116,20 @@
2847A6A01AAF2679000A2ABE /* SwiftExample */ = {
isa = PBXGroup;
children = (
28D832551AEBC4A7009E3B3F /* AccessoryViews */,
286067311AEDBD4A002F1E04 /* CustomRows */,
28F490201AAFBBC600C8E0CC /* Dates */,
28B920711AE6EB6100BD6382 /* Inputs */,
286E8B8A1AE9993F00F2767A /* MultiValuedSections */,
286E8B7A1AE86C8900F2767A /* Others */,
28D8325F1AEBE4E4009E3B3F /* PredicateExamples */,
288646191AE5C958007A8B9B /* RealExamples */,
28B920761AE7378400BD6382 /* Selectors */,
288646161AE5C7EA007A8B9B /* StoryboardExample */,
28D8326D1AEC2D1B009E3B3F /* UICustomization */,
28D8326A1AEC177E009E3B3F /* Validations */,
288646141AE59474007A8B9B /* ExamplesFormViewController.swift */,
2847A6A31AAF2679000A2ABE /* AppDelegate.swift */,
2847A6A71AAF2679000A2ABE /* Main.storyboard */,
2847A6AA1AAF2679000A2ABE /* Images.xcassets */,
2847A6AC1AAF2679000A2ABE /* LaunchScreen.xib */,
2847A6A11AAF2679000A2ABE /* Supporting Files */,
);
path = SwiftExample;
@@ -75,34 +138,213 @@
2847A6A11AAF2679000A2ABE /* Supporting Files */ = {
isa = PBXGroup;
children = (
2847A6AA1AAF2679000A2ABE /* Images.xcassets */,
2847A6A21AAF2679000A2ABE /* Info.plist */,
2847A6C31AAF2B14000A2ABE /* SwiftExample-Bridging-Header.h */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
286067311AEDBD4A002F1E04 /* CustomRows */ = {
isa = PBXGroup;
children = (
BF01E9291C21FEF700BDE045 /* Inline Segmented */,
286067321AEDBD4A002F1E04 /* CustomRowsViewController.swift */,
286067331AEDBD4A002F1E04 /* FloatLabeledTextField */,
286067351AEDBD4A002F1E04 /* Rating */,
2860673B1AEDBD4A002F1E04 /* Weekdays */,
);
name = CustomRows;
path = SwiftExample/CustomRows;
sourceTree = SOURCE_ROOT;
};
286067331AEDBD4A002F1E04 /* FloatLabeledTextField */ = {
isa = PBXGroup;
children = (
286067341AEDBD4A002F1E04 /* FloatLabeledTextFieldCell.swift */,
);
path = FloatLabeledTextField;
sourceTree = "<group>";
};
286067351AEDBD4A002F1E04 /* Rating */ = {
isa = PBXGroup;
children = (
286067361AEDBD4A002F1E04 /* RatingView */,
286067391AEDBD4A002F1E04 /* XLFormRatingCell.swift */,
2860673A1AEDBD4A002F1E04 /* XLFormRatingCell.xib */,
);
path = Rating;
sourceTree = "<group>";
};
286067361AEDBD4A002F1E04 /* RatingView */ = {
isa = PBXGroup;
children = (
286067451AEDC3D7002F1E04 /* XLRatingView.swift */,
);
path = RatingView;
sourceTree = "<group>";
};
2860673B1AEDBD4A002F1E04 /* Weekdays */ = {
isa = PBXGroup;
children = (
2860673C1AEDBD4A002F1E04 /* XLFormWeekDaysCell.swift */,
2860673D1AEDBD4A002F1E04 /* XLFormWeekDaysCell.xib */,
);
path = Weekdays;
sourceTree = "<group>";
};
286E8B6C1AE8099F00F2767A /* DynamicSelector */ = {
isa = PBXGroup;
children = (
286E8B771AE80C4300F2767A /* UsersTableViewController.swift */,
286E8B731AE809EF00F2767A /* DynamicSelectorsFormViewController.swift */,
);
path = DynamicSelector;
sourceTree = "<group>";
};
286E8B7A1AE86C8900F2767A /* Others */ = {
isa = PBXGroup;
children = (
286E8B7B1AE86C8900F2767A /* CustomCells */,
286E8B7D1AE86C8900F2767A /* OthersFormViewController.swift */,
);
path = Others;
sourceTree = "<group>";
};
286E8B7B1AE86C8900F2767A /* CustomCells */ = {
isa = PBXGroup;
children = (
286E8B7C1AE86C8900F2767A /* XLFormCustomCell.swift */,
);
path = CustomCells;
sourceTree = "<group>";
};
286E8B801AE9286B00F2767A /* CustomSelectors */ = {
isa = PBXGroup;
children = (
286E8B811AE9286B00F2767A /* CustomSelectorsFormViewController.swift */,
286E8B821AE9286B00F2767A /* XLFormRowViewController */,
);
path = CustomSelectors;
sourceTree = "<group>";
};
286E8B821AE9286B00F2767A /* XLFormRowViewController */ = {
isa = PBXGroup;
children = (
286E8B831AE9286B00F2767A /* CLLocationValueTrasformer.swift */,
286E8B841AE9286B00F2767A /* MapViewController.swift */,
286E8B851AE9286B00F2767A /* MapViewController.xib */,
);
path = XLFormRowViewController;
sourceTree = "<group>";
};
286E8B8A1AE9993F00F2767A /* MultiValuedSections */ = {
isa = PBXGroup;
children = (
286E8B8B1AE9993F00F2767A /* MultivaluedFormViewController.swift */,
);
path = MultiValuedSections;
sourceTree = "<group>";
};
288646161AE5C7EA007A8B9B /* StoryboardExample */ = {
isa = PBXGroup;
children = (
288646171AE5C7EA007A8B9B /* iPhoneStoryboard.storyboard */,
);
path = StoryboardExample;
sourceTree = "<group>";
};
288646191AE5C958007A8B9B /* RealExamples */ = {
isa = PBXGroup;
children = (
2886461A1AE5C958007A8B9B /* NativeEventFormViewController.swift */,
);
path = RealExamples;
sourceTree = "<group>";
};
28B920711AE6EB6100BD6382 /* Inputs */ = {
isa = PBXGroup;
children = (
28B920741AE6F02F00BD6382 /* InputsFormViewController.swift */,
);
path = Inputs;
sourceTree = "<group>";
};
28B920761AE7378400BD6382 /* Selectors */ = {
isa = PBXGroup;
children = (
286E8B801AE9286B00F2767A /* CustomSelectors */,
286E8B6C1AE8099F00F2767A /* DynamicSelector */,
28B920771AE73AA600BD6382 /* SelectorsFormViewController.swift */,
);
name = Selectors;
sourceTree = "<group>";
};
28D832551AEBC4A7009E3B3F /* AccessoryViews */ = {
isa = PBXGroup;
children = (
28D832561AEBC4A7009E3B3F /* AccessoryViewFormViewController.swift */,
);
path = AccessoryViews;
sourceTree = "<group>";
};
28D8325F1AEBE4E4009E3B3F /* PredicateExamples */ = {
isa = PBXGroup;
children = (
28D832681AEBFE9F009E3B3F /* PredicateFormViewController.swift */,
28D832601AEBE4E4009E3B3F /* BasicPredicateViewController.swift */,
28D832661AEBEAA0009E3B3F /* BlogExampleViewController.swift */,
);
path = PredicateExamples;
sourceTree = "<group>";
};
28D8326A1AEC177E009E3B3F /* Validations */ = {
isa = PBXGroup;
children = (
28D8326B1AEC177E009E3B3F /* ValidationExamplesFormViewController.swift */,
);
path = Validations;
sourceTree = "<group>";
};
28D8326D1AEC2D1B009E3B3F /* UICustomization */ = {
isa = PBXGroup;
children = (
28D8326E1AEC2D1B009E3B3F /* UICustomizationFormViewController.swift */,
);
path = UICustomization;
sourceTree = "<group>";
};
28F490201AAFBBC600C8E0CC /* Dates */ = {
isa = PBXGroup;
children = (
2886461E1AE5FEB5007A8B9B /* DateAndTimeValueTrasformer.swift */,
28F490211AAFBBC600C8E0CC /* DatesFormViewController.swift */,
);
name = Dates;
path = Examples/Dates;
path = SwiftExample/Dates;
sourceTree = SOURCE_ROOT;
};
402AE3EC1FACD058DCF0A2D3 /* Frameworks */ = {
3D93F92C6A8B49B82B452B67 /* Frameworks */ = {
isa = PBXGroup;
children = (
854F8DF43072D7C59CBECB68 /* libPods-SwiftExample.a */,
E006C7F7FF8E967AA8661BC9 /* libPods-SwiftExample.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
7A12A831117D9B4D152E0A51 /* Pods */ = {
BF01E9291C21FEF700BDE045 /* Inline Segmented */ = {
isa = PBXGroup;
children = (
420D9BAB7B0D2AF9487DD060 /* Pods-SwiftExample.debug.xcconfig */,
2EB9C638FC2450A0B9786D1E /* Pods-SwiftExample.release.xcconfig */,
BF01E92A1C21FF2800BDE045 /* InlineSegmentedCell.swift */,
);
name = "Inline Segmented";
sourceTree = "<group>";
};
E9F3DD7ACEF5AAF92FCE6E24 /* Pods */ = {
isa = PBXGroup;
children = (
F019783EE34BD17E2BA41467 /* Pods-SwiftExample.debug.xcconfig */,
CD0A6F89B9CD5843CA297E52 /* Pods-SwiftExample.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
@@ -114,11 +356,11 @@
isa = PBXNativeTarget;
buildConfigurationList = 2847A6BD1AAF2679000A2ABE /* Build configuration list for PBXNativeTarget "SwiftExample" */;
buildPhases = (
21FCE00817B1AE1029F382A4 /* Check Pods Manifest.lock */,
89E8536C00EFF5D0377E1AE9 /* [CP] Check Pods Manifest.lock */,
2847A69A1AAF2679000A2ABE /* Sources */,
2847A69B1AAF2679000A2ABE /* Frameworks */,
2847A69C1AAF2679000A2ABE /* Resources */,
A0F2DA95250A4C3E69515D96 /* Copy Pods Resources */,
DC50100813F1902A0CFCE009 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -135,17 +377,20 @@
2847A6961AAF2679000A2ABE /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0620;
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 1200;
ORGANIZATIONNAME = Xmartlabs;
TargetAttributes = {
2847A69D1AAF2679000A2ABE = {
CreatedOnToolsVersion = 6.2;
LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = 2847A6991AAF2679000A2ABE /* Build configuration list for PBXProject "SwiftExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -166,8 +411,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2847A6A91AAF2679000A2ABE /* Main.storyboard in Resources */,
2847A6AE1AAF2679000A2ABE /* LaunchScreen.xib in Resources */,
288646181AE5C7EA007A8B9B /* iPhoneStoryboard.storyboard in Resources */,
286E8B891AE9286B00F2767A /* MapViewController.xib in Resources */,
286067441AEDBD4A002F1E04 /* XLFormWeekDaysCell.xib in Resources */,
286067421AEDBD4A002F1E04 /* XLFormRatingCell.xib in Resources */,
2847A6AB1AAF2679000A2ABE /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -175,34 +422,40 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
21FCE00817B1AE1029F382A4 /* Check Pods Manifest.lock */ = {
89E8536C00EFF5D0377E1AE9 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "Check Pods Manifest.lock";
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-SwiftExample-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
A0F2DA95250A4C3E69515D96 /* Copy Pods Resources */ = {
DC50100813F1902A0CFCE009 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-resources.sh",
"${PODS_ROOT}/../../../XLForm/XLForm.bundle",
);
name = "Copy Pods Resources";
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/XLForm.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwiftExample/Pods-SwiftExample-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -212,55 +465,75 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
28B920781AE73AA600BD6382 /* SelectorsFormViewController.swift in Sources */,
28D832671AEBEAA0009E3B3F /* BlogExampleViewController.swift in Sources */,
BF01E92B1C21FF2800BDE045 /* InlineSegmentedCell.swift in Sources */,
28D8326C1AEC177E009E3B3F /* ValidationExamplesFormViewController.swift in Sources */,
286067411AEDBD4A002F1E04 /* XLFormRatingCell.swift in Sources */,
28F490221AAFBBC600C8E0CC /* DatesFormViewController.swift in Sources */,
286E8B8C1AE9993F00F2767A /* MultivaluedFormViewController.swift in Sources */,
28D8326F1AEC2D1B009E3B3F /* UICustomizationFormViewController.swift in Sources */,
2860673E1AEDBD4A002F1E04 /* CustomRowsViewController.swift in Sources */,
286E8B781AE80C4300F2767A /* UsersTableViewController.swift in Sources */,
286067461AEDC3D7002F1E04 /* XLRatingView.swift in Sources */,
288646151AE59474007A8B9B /* ExamplesFormViewController.swift in Sources */,
286067431AEDBD4A002F1E04 /* XLFormWeekDaysCell.swift in Sources */,
2860673F1AEDBD4A002F1E04 /* FloatLabeledTextFieldCell.swift in Sources */,
286E8B7E1AE86C8900F2767A /* XLFormCustomCell.swift in Sources */,
286E8B871AE9286B00F2767A /* CLLocationValueTrasformer.swift in Sources */,
2886461C1AE5C958007A8B9B /* NativeEventFormViewController.swift in Sources */,
286E8B7F1AE86C8900F2767A /* OthersFormViewController.swift in Sources */,
2847A6A41AAF2679000A2ABE /* AppDelegate.swift in Sources */,
28D832691AEBFE9F009E3B3F /* PredicateFormViewController.swift in Sources */,
28D832571AEBC4A7009E3B3F /* AccessoryViewFormViewController.swift in Sources */,
286E8B861AE9286B00F2767A /* CustomSelectorsFormViewController.swift in Sources */,
2886461F1AE5FEB5007A8B9B /* DateAndTimeValueTrasformer.swift in Sources */,
28B920751AE6F02F00BD6382 /* InputsFormViewController.swift in Sources */,
28D832631AEBE4E4009E3B3F /* BasicPredicateViewController.swift in Sources */,
286E8B751AE809EF00F2767A /* DynamicSelectorsFormViewController.swift in Sources */,
286E8B881AE9286B00F2767A /* MapViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
2847A6A71AAF2679000A2ABE /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
2847A6A81AAF2679000A2ABE /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
2847A6AC1AAF2679000A2ABE /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
2847A6AD1AAF2679000A2ABE /* Base */,
);
name = LaunchScreen.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
2847A6BB1AAF2679000A2ABE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
@@ -273,7 +546,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -286,17 +559,29 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -304,15 +589,17 @@
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
@@ -320,25 +607,33 @@
};
2847A6BE1AAF2679000A2ABE /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 420D9BAB7B0D2AF9487DD060 /* Pods-SwiftExample.debug.xcconfig */;
baseConfigurationReference = F019783EE34BD17E2BA41467 /* Pods-SwiftExample.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
INFOPLIST_FILE = SwiftExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.xmartlabs.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "SwiftExample/SwiftExample-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
2847A6BF1AAF2679000A2ABE /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 2EB9C638FC2450A0B9786D1E /* Pods-SwiftExample.release.xcconfig */;
baseConfigurationReference = CD0A6F89B9CD5843CA297E52 /* Pods-SwiftExample.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
INFOPLIST_FILE = SwiftExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.xmartlabs.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "SwiftExample/SwiftExample-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
};
name = Release;
};
@@ -0,0 +1,198 @@
//
// AccessoryViewFormViewController.swift
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
class AccessoryViewFormViewController : XLFormViewController {
fileprivate struct Tags {
static let AccessoryViewRowNavigationEnabled = "RowNavigationEnabled"
static let AccessoryViewRowNavigationShowAccessoryView = "RowNavigationShowAccessoryView"
static let AccessoryViewRowNavigationStopDisableRow = "rowNavigationStopDisableRow"
static let AccessoryViewRowNavigationSkipCanNotBecomeFirstResponderRow = "rowNavigationSkipCanNotBecomeFirstResponderRow"
static let AccessoryViewRowNavigationStopInlineRow = "rowNavigationStopInlineRow"
static let AccessoryViewName = "name"
static let AccessoryViewEmail = "email"
static let AccessoryViewTwitter = "twitter"
static let AccessoryViewUrl = "url"
static let AccessoryViewDate = "date"
static let AccessoryViewTextView = "textView"
static let AccessoryViewCheck = "check"
static let AccessoryViewNotes = "notes"
}
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
initializeForm()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
initializeForm()
}
func initializeForm() {
let form : XLFormDescriptor
var section : XLFormSectionDescriptor
var row : XLFormRowDescriptor
form = XLFormDescriptor(title: "Accessory View")
form.rowNavigationOptions = .enabled
// Configuration section
section = XLFormSectionDescriptor()
section.title = "Row Navigation Settings"
section.footerTitle = "Changing the Settings values you will navigate differently"
form.addFormSection(section)
// RowNavigationEnabled
row = XLFormRowDescriptor(tag: Tags.AccessoryViewRowNavigationEnabled, rowType: XLFormRowDescriptorTypeBooleanSwitch, title: "Row Navigation Enabled?")
row.value = true
section.addFormRow(row)
// RowNavigationShowAccessoryView
row = XLFormRowDescriptor(tag: Tags.AccessoryViewRowNavigationShowAccessoryView, rowType:XLFormRowDescriptorTypeBooleanCheck, title:"Show input accessory row?")
row.value = form.rowNavigationOptions.contains(.enabled)
row.hidden = "$\(Tags.AccessoryViewRowNavigationEnabled) == 0"
section.addFormRow(row)
// RowNavigationStopDisableRow
row = XLFormRowDescriptor(tag: Tags.AccessoryViewRowNavigationStopDisableRow, rowType: XLFormRowDescriptorTypeBooleanCheck, title:"Stop when reach disabled row?")
row.value = form.rowNavigationOptions.contains(.stopDisableRow)
row.hidden = "$\(Tags.AccessoryViewRowNavigationEnabled) == 0"
section.addFormRow(row)
// RowNavigationStopInlineRow
row = XLFormRowDescriptor(tag: Tags.AccessoryViewRowNavigationStopInlineRow, rowType: XLFormRowDescriptorTypeBooleanCheck, title: "Stop when reach inline row?")
row.value = form.rowNavigationOptions.contains(.stopInlineRow)
row.hidden = "$\(Tags.AccessoryViewRowNavigationEnabled) == 0"
section.addFormRow(row)
// RowNavigationSkipCanNotBecomeFirstResponderRow
row = XLFormRowDescriptor(tag: Tags.AccessoryViewRowNavigationSkipCanNotBecomeFirstResponderRow, rowType:XLFormRowDescriptorTypeBooleanCheck, title:"Skip Can Not Become First Responder Row?")
row.value = form.rowNavigationOptions.contains(XLFormRowNavigationOptions.skipCanNotBecomeFirstResponderRow)
row.hidden = "$\(Tags.AccessoryViewRowNavigationEnabled) == 0"
section.addFormRow(row)
section = XLFormSectionDescriptor()
form.addFormSection(section)
// Name
row = XLFormRowDescriptor(tag: Tags.AccessoryViewName, rowType: XLFormRowDescriptorTypeText, title: "Name")
row.isRequired = true
section.addFormRow(row)
// Email
row = XLFormRowDescriptor(tag: Tags.AccessoryViewEmail, rowType: XLFormRowDescriptorTypeEmail, title: "Email")
// validate the email
row.addValidator(XLFormValidator.email())
section.addFormRow(row)
// Twitter
row = XLFormRowDescriptor(tag: Tags.AccessoryViewTwitter, rowType: XLFormRowDescriptorTypeTwitter, title: "Twitter")
row.disabled = NSNumber(value: true as Bool)
row.value = "@no_editable"
section.addFormRow(row)
// Url
row = XLFormRowDescriptor(tag: Tags.AccessoryViewUrl, rowType: XLFormRowDescriptorTypeURL, title: "Url")
section.addFormRow(row)
// Date
row = XLFormRowDescriptor(tag: Tags.AccessoryViewDate, rowType:XLFormRowDescriptorTypeDateInline, title:"Date Inline")
row.value = Date()
section.addFormRow(row)
section = XLFormSectionDescriptor()
form.addFormSection(section)
row = XLFormRowDescriptor(tag: Tags.AccessoryViewTextView, rowType:XLFormRowDescriptorTypeTextView)
row.cellConfigAtConfigure["textView.placeholder"] = "TEXT VIEW EXAMPLE"
section.addFormRow(row)
row = XLFormRowDescriptor(tag: Tags.AccessoryViewCheck, rowType:XLFormRowDescriptorTypeBooleanCheck, title:"Check")
section.addFormRow(row)
section = XLFormSectionDescriptor()
form.addFormSection(section)
row = XLFormRowDescriptor(tag: Tags.AccessoryViewNotes, rowType:XLFormRowDescriptorTypeTextView, title:"Notes")
section.addFormRow(row)
self.form = form
}
override func inputAccessoryView(for rowDescriptor: XLFormRowDescriptor!) -> UIView! {
if (form.formRow(withTag: Tags.AccessoryViewRowNavigationShowAccessoryView)!.value! as AnyObject).boolValue == false {
return nil
}
return super.inputAccessoryView(for: rowDescriptor)
}
//MARK: XLFormDescriptorDelegate
override func formRowDescriptorValueHasChanged(_ formRow: XLFormRowDescriptor!, oldValue: Any!, newValue: Any!) {
super.formRowDescriptorValueHasChanged(formRow, oldValue: oldValue, newValue: newValue)
if formRow.tag == Tags.AccessoryViewRowNavigationStopDisableRow {
if (formRow.value! as AnyObject).boolValue == true {
form.rowNavigationOptions = form.rowNavigationOptions.union(.stopDisableRow)
}
else{
form.rowNavigationOptions = form.rowNavigationOptions.subtracting(.stopDisableRow)
}
}
else if formRow.tag == Tags.AccessoryViewRowNavigationStopInlineRow {
if (formRow.value! as AnyObject).boolValue == true {
form.rowNavigationOptions = form.rowNavigationOptions.union(.stopInlineRow)
}
else{
var options = form.rowNavigationOptions
options = options.subtracting(XLFormRowNavigationOptions.stopInlineRow)
form.rowNavigationOptions = options
}
}
else if formRow.tag == Tags.AccessoryViewRowNavigationSkipCanNotBecomeFirstResponderRow {
if (formRow.value! as AnyObject).boolValue == true {
form.rowNavigationOptions = form.rowNavigationOptions.union(.skipCanNotBecomeFirstResponderRow)
}
else{
var options = form.rowNavigationOptions
options = options.subtracting(.skipCanNotBecomeFirstResponderRow)
form.rowNavigationOptions = options
}
}
}
}
+25 -8
View File
@@ -3,7 +3,7 @@
// SwiftExample
//
// Created by Martin Barreto on 3/10/15.
// Copyright (c) 2015 Xmartlabs. All rights reserved.
// Copyright (c) 2014-2015 Xmartlabs. All rights reserved.
//
import UIKit
@@ -14,30 +14,47 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Declare custom rows
XLFormViewController.cellClassesForRowDescriptorTypes()[XLFormRowDescriptorTypeRate] = NSStringFromClass(XLFormRatingCell.self)
XLFormViewController.cellClassesForRowDescriptorTypes()[XLFormRowDescriptorTypeFloatLabeledTextField] = FloatLabeledTextFieldCell.self
XLFormViewController.cellClassesForRowDescriptorTypes()[XLFormRowDescriptorTypeWeekDays] = NSStringFromClass(XLFormWeekDaysCell.self)
XLFormViewController.cellClassesForRowDescriptorTypes()[XLFormRowDescriptorTypeSegmentedInline] = InlineSegmentedCell.self
XLFormViewController.cellClassesForRowDescriptorTypes()[XLFormRowDescriptorTypeSegmentedControl] = InlineSegmentedControl.self
XLFormViewController.inlineRowDescriptorTypesForRowDescriptorTypes()[XLFormRowDescriptorTypeSegmentedInline] = XLFormRowDescriptorTypeSegmentedControl
// Override point for customization after application launch.
self.window = UIWindow.init(frame: UIScreen.main.bounds)
// Override point for customization after application launch.
self.window!.backgroundColor = .white
// load the initial form form Storybiard
let storyboard = UIStoryboard.init(name:"iPhoneStoryboard", bundle:nil)
self.window!.rootViewController = storyboard.instantiateInitialViewController()
self.window!.makeKeyAndVisible()
return true
}
func applicationWillResignActive(application: UIApplication) {
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(application: UIApplication) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 Xmartlabs. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SwiftExample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="548" y="455"/>
</view>
</objects>
</document>
@@ -1,82 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6751" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Qcv-79-vVI">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
</dependencies>
<scenes>
<!--Dates-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="DatesFormViewController" customModule="SwiftExample" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" translatesAutoresizingMaskIntoConstraints="NO" id="2sg-5P-kgQ">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="2sg-5P-kgQ" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="3Yn-bA-w0I"/>
<constraint firstAttribute="trailing" secondItem="2sg-5P-kgQ" secondAttribute="trailing" id="73f-7i-5tC"/>
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="2sg-5P-kgQ" secondAttribute="bottom" id="j8D-ZK-VSm"/>
<constraint firstItem="2sg-5P-kgQ" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="u4s-WS-f87"/>
</constraints>
<variation key="default">
<mask key="subviews">
<exclude reference="2sg-5P-kgQ"/>
</mask>
<mask key="constraints">
<exclude reference="3Yn-bA-w0I"/>
<exclude reference="73f-7i-5tC"/>
<exclude reference="u4s-WS-f87"/>
<exclude reference="j8D-ZK-VSm"/>
</mask>
</variation>
<variation key="widthClass=compact">
<mask key="subviews">
<include reference="2sg-5P-kgQ"/>
</mask>
<mask key="constraints">
<include reference="3Yn-bA-w0I"/>
<include reference="73f-7i-5tC"/>
<include reference="u4s-WS-f87"/>
<include reference="j8D-ZK-VSm"/>
</mask>
</variation>
</view>
<navigationItem key="navigationItem" title="Dates" id="9ob-1y-Xxj"/>
<connections>
<outlet property="tableView" destination="2sg-5P-kgQ" id="8ra-Jh-FFN"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1699.5" y="227"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="Rqn-ai-pbu">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="Qcv-79-vVI" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="DYY-3j-vkq">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="PVw-tk-bDX"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="2NC-vw-Oo6" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="936" y="227"/>
</scene>
</scenes>
</document>
@@ -0,0 +1,119 @@
// CustomRowsViewController.swift
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
class CustomRowsViewController : XLFormViewController {
fileprivate struct Tags {
static let CustomRowFirstRatingTag = "CustomRowFirstRatingTag"
static let CustomRowSecondRatingTag = "CustomRowSecondRatingTag"
static let CustomRowFloatLabeledTextFieldTag = "CustomRowFloatLabeledTextFieldTag"
static let CustomRowWeekdays = "CustomRowWeekdays"
static let CustomRowText = "CustomText"
static let CustomRowInline = "CustomRowInline"
}
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
self.initializeForm()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.initializeForm()
}
func initializeForm() {
let form : XLFormDescriptor
var section : XLFormSectionDescriptor
var row : XLFormRowDescriptor
form = XLFormDescriptor(title: "Custom Rows")
section = XLFormSectionDescriptor()
section.title = "Ratings"
form.addFormSection(section)
row = XLFormRowDescriptor(tag: Tags.CustomRowFirstRatingTag, rowType: XLFormRowDescriptorTypeRate, title: "First Rating")
row.value = 3
section.addFormRow(row)
row = XLFormRowDescriptor(tag: Tags.CustomRowSecondRatingTag, rowType: XLFormRowDescriptorTypeRate, title: "First Rating")
row.value = 1
section.addFormRow(row)
// Section Float Labeled Text Field
section = XLFormSectionDescriptor.formSection(withTitle: "Float Labeled Text Field")
form.addFormSection(section)
row = XLFormRowDescriptor(tag: Tags.CustomRowFloatLabeledTextFieldTag, rowType: XLFormRowDescriptorTypeFloatLabeledTextField, title: "Title")
section.addFormRow(row)
row = XLFormRowDescriptor(tag: Tags.CustomRowFloatLabeledTextFieldTag, rowType: XLFormRowDescriptorTypeFloatLabeledTextField, title: "First Name")
section.addFormRow(row)
row = XLFormRowDescriptor(tag: Tags.CustomRowFloatLabeledTextFieldTag, rowType: XLFormRowDescriptorTypeFloatLabeledTextField, title: "Last Name")
section.addFormRow(row)
section = XLFormSectionDescriptor.formSection(withTitle: "Weekdays")
form.addFormSection(section)
// WeekDays
row = XLFormRowDescriptor(tag: Tags.CustomRowWeekdays, rowType: XLFormRowDescriptorTypeWeekDays)
row.value = [
XLFormWeekDaysCell.kWeekDay.sunday.description(): false,
XLFormWeekDaysCell.kWeekDay.monday.description(): true,
XLFormWeekDaysCell.kWeekDay.tuesday.description(): true,
XLFormWeekDaysCell.kWeekDay.wednesday.description(): false,
XLFormWeekDaysCell.kWeekDay.thursday.description(): false,
XLFormWeekDaysCell.kWeekDay.friday.description(): false,
XLFormWeekDaysCell.kWeekDay.saturday.description(): false
]
section.addFormRow(row)
section = XLFormSectionDescriptor.formSection(withTitle: "Custom inline row")
form.addFormSection(section)
// Inline
row = XLFormRowDescriptor(tag: Tags.CustomRowInline, rowType: XLFormRowDescriptorTypeSegmentedInline)
row.title = "You support..."
row.selectorOptions = ["Uruguay", "Brazil", "Argentina", "Chile"]
row.value = "Uruguay"
section.addFormRow(row)
section = XLFormSectionDescriptor()
form.addFormSection(section)
row = XLFormRowDescriptor(tag: Tags.CustomRowText, rowType: XLFormRowDescriptorTypeCustom)
// Must set custom cell or add custom cell to cellClassesForRowDescriptorTypes dictionary before XLFormViewController loaded
row.cellClass = XLFormCustomCell.self
section.addFormRow(row)
self.form = form
}
}
@@ -0,0 +1,140 @@
// FloatLabeledTextFieldCell.swift
// XLForm ( https://github.com/xmartlabs/XLForm )
//
// Copyright (c) 2014-2015 Xmartlabs ( http://xmartlabs.com )
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
let XLFormRowDescriptorTypeFloatLabeledTextField = "XLFormRowDescriptorTypeFloatLabeledTextField"
class FloatLabeledTextFieldCell : XLFormBaseCell, UITextFieldDelegate {
static let kFontSize : CGFloat = 16.0
lazy var floatLabeledTextField: JVFloatLabeledTextField = {
let result = JVFloatLabeledTextField(frame: CGRect.zero)
result.translatesAutoresizingMaskIntoConstraints = false
result.font = UIFont.systemFont(ofSize: FloatLabeledTextFieldCell.kFontSize)
result.floatingLabel.font = .boldSystemFont(ofSize: FloatLabeledTextFieldCell.kFontSize)
result.clearButtonMode = .whileEditing
return result
}()
//Mark: - XLFormDescriptorCell
override func configure() {
super.configure()
selectionStyle = .none
contentView.addSubview(self.floatLabeledTextField)
floatLabeledTextField.delegate = self
contentView.addConstraints(layoutConstraints())
}
override func update() {
super.update()
if let rowDescriptor = rowDescriptor {
floatLabeledTextField.attributedPlaceholder = NSAttributedString(string: rowDescriptor.title ?? "" , attributes: [NSAttributedString.Key.foregroundColor: UIColor.lightGray])
if let value = rowDescriptor.value {
floatLabeledTextField.text = (value as AnyObject).displayText()
}
else {
floatLabeledTextField.text = rowDescriptor.noValueDisplayText
}
floatLabeledTextField.isEnabled = !rowDescriptor.isDisabled()
floatLabeledTextField.floatingLabelTextColor = .lightGray
floatLabeledTextField.alpha = rowDescriptor.isDisabled() ? 0.6 : 1.0
}
}
override func formDescriptorCellCanBecomeFirstResponder() -> Bool {
return rowDescriptor?.isDisabled() == false
}
override func formDescriptorCellBecomeFirstResponder() -> Bool {
return self.floatLabeledTextField.becomeFirstResponder()
}
override static func formDescriptorCellHeight(for rowDescriptor: XLFormRowDescriptor!) -> CGFloat {
return 55.0
}
//MARK: Helpers
func layoutConstraints() -> [NSLayoutConstraint]{
let views = ["floatLabeledTextField" : floatLabeledTextField]
let metrics = ["hMargin": 15.0, "vMargin": 8.0]
var result = NSLayoutConstraint.constraints(withVisualFormat: "H:|-(hMargin)-[floatLabeledTextField]-(hMargin)-|", options:.alignAllCenterY, metrics:metrics, views:views)
result += NSLayoutConstraint.constraints(withVisualFormat: "V:|-(vMargin)-[floatLabeledTextField]-(vMargin)-|", options:.alignAllCenterX, metrics:metrics, views:views)
return result
}
func textFieldDidChange(_ textField : UITextField) {
if floatLabeledTextField == textField {
if let rowDescriptor = rowDescriptor, let text = self.floatLabeledTextField.text {
if text.isEmpty == false {
rowDescriptor.value = self.floatLabeledTextField.text
} else {
rowDescriptor.value = nil
}
}
}
}
//Mark: UITextFieldDelegate
func textFieldShouldClear(_ textField: UITextField) -> Bool {
return self.formViewController().textFieldShouldClear(textField)
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
return self.formViewController().textFieldShouldReturn(textField)
}
func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
return self.formViewController().textFieldShouldBeginEditing(textField)
}
func textFieldShouldEndEditing(_ textField: UITextField) -> Bool {
return self.formViewController().textFieldShouldEndEditing(textField)
}
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
return self.formViewController().textField(textField, shouldChangeCharactersIn: range, replacementString: string)
}
func textFieldDidBeginEditing(_ textField: UITextField) {
self.formViewController().textFieldDidBeginEditing(textField)
}
func textFieldDidEndEditing(_ textField: UITextField) {
self.textFieldDidChange(textField)
self.formViewController().textFieldDidEndEditing(textField)
}
}
@@ -0,0 +1,144 @@
//
// InlineSegmentedCell.swift
// SwiftExample
//
// Created by mathias Claassen on 16/12/15.
// Copyright © 2015 Xmartlabs. All rights reserved.
//
import Foundation
let XLFormRowDescriptorTypeSegmentedInline = "XLFormRowDescriptorTypeSegmentedInline"
let XLFormRowDescriptorTypeSegmentedControl = "XLFormRowDescriptorTypeSegmentedControl"
class InlineSegmentedCell : XLFormBaseCell {
override var canBecomeFirstResponder : Bool {
return true
}
override func becomeFirstResponder() -> Bool {
if isFirstResponder {
return super.becomeFirstResponder()
}
let result = super.becomeFirstResponder()
if result {
let inlineRowDescriptor : XLFormRowDescriptor = XLFormRowDescriptor(tag: nil, rowType: XLFormViewController.inlineRowDescriptorTypesForRowDescriptorTypes()![rowDescriptor!.rowType] as! String)
let cell = inlineRowDescriptor.cell(forForm: formViewController())
let inlineCell = cell as? XLFormInlineRowDescriptorCell
inlineCell?.inlineRowDescriptor = rowDescriptor
rowDescriptor?.sectionDescriptor.addFormRow(inlineRowDescriptor, afterRow: rowDescriptor!)
formViewController().ensureRowIsVisible(inlineRowDescriptor)
}
return result
}
override func resignFirstResponder() -> Bool {
if !isFirstResponder {
return super.resignFirstResponder()
}
let selectedRowPath : IndexPath = formViewController().form.indexPath(ofFormRow: rowDescriptor!)!
let nextRowPath = IndexPath(row: (selectedRowPath as NSIndexPath).row + 1, section: (selectedRowPath as NSIndexPath).section)
let nextFormRow = formViewController().form.formRow(atIndex: nextRowPath)
let section : XLFormSectionDescriptor = formViewController().form.formSection(at: UInt((nextRowPath as NSIndexPath).section))!
let result = super.resignFirstResponder()
if result {
section.removeFormRow(nextFormRow!)
}
return result
}
//Mark: - XLFormDescriptorCell
override func formDescriptorCellCanBecomeFirstResponder() -> Bool {
return rowDescriptor?.isDisabled() == false
}
override func formDescriptorCellBecomeFirstResponder() -> Bool {
if isFirstResponder {
_ = resignFirstResponder()
return false
}
return becomeFirstResponder()
}
override func update() {
super.update()
accessoryType = .none
editingAccessoryType = .none
selectionStyle = .none
textLabel?.text = rowDescriptor?.title
detailTextLabel?.text = valueDisplayText()
}
override func formDescriptorCellDidSelected(withForm controller: XLFormViewController!) {
controller.tableView.deselectRow(at: controller.form.indexPath(ofFormRow: rowDescriptor!)!, animated: true)
}
func valueDisplayText() -> String? {
if let value = rowDescriptor?.value {
return (value as AnyObject).displayText()
}
return rowDescriptor?.noValueDisplayText
}
}
class InlineSegmentedControl : XLFormBaseCell, XLFormInlineRowDescriptorCell {
var inlineRowDescriptor : XLFormRowDescriptor?
lazy var segmentedControl : UISegmentedControl = {
return UISegmentedControl.autolayout()
}()
override func configure() {
super.configure()
selectionStyle = .none
contentView.addSubview(segmentedControl)
contentView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|-[segmentedControl]-|", options: .alignAllCenterY, metrics: nil, views: ["segmentedControl": segmentedControl]))
segmentedControl.addTarget(self, action: #selector(InlineSegmentedControl.valueChanged), for: .valueChanged)
}
override func update() {
super.update()
updateSegmentedControl()
segmentedControl.selectedSegmentIndex = selectedIndex()
segmentedControl.isEnabled = rowDescriptor?.isDisabled() == false
}
//MARK: Actions
@objc func valueChanged() {
inlineRowDescriptor!.value = inlineRowDescriptor!.selectorOptions![segmentedControl.selectedSegmentIndex]
formViewController().updateFormRow(inlineRowDescriptor)
}
//MARK: Helpers
func getItems() -> NSMutableArray {
let result = NSMutableArray()
for option in inlineRowDescriptor!.selectorOptions! {
result.add((option as AnyObject).displayText() ?? "")
}
return result
}
func updateSegmentedControl() {
segmentedControl.removeAllSegments()
getItems().enumerateObjects({ [weak self] (object, index, stop) in
self?.segmentedControl.insertSegment(withTitle: (object as AnyObject).displayText(), at: index, animated: false)
})
}
func selectedIndex() -> Int {
let formRow = inlineRowDescriptor ?? rowDescriptor
if let value = formRow?.value as? NSObject {
for option in (formRow?.selectorOptions)! {
if ((option as! NSObject).valueData() as AnyObject) === (value.valueData() as AnyObject) {
return formRow?.selectorOptions?.firstIndex(where: { ($0 as! NSObject) == (option as! NSObject) } ) ?? -1
}
}
}
return -1
}
}

Some files were not shown because too many files have changed in this diff Show More