marinofaggiana 4 年 前
コミット
4cbc5764f0
86 ファイル変更12 行追加8962 行削除
  1. 1 0
      Cartfile
  2. 1 0
      Cartfile.resolved
  3. 5 294
      Nextcloud.xcodeproj/project.pbxproj
  4. 0 50
      iOSClient/Library/XLForm/XL/Cell/XLFormBaseCell.h
  5. 0 112
      iOSClient/Library/XLForm/XL/Cell/XLFormBaseCell.m
  6. 0 31
      iOSClient/Library/XLForm/XL/Cell/XLFormButtonCell.h
  7. 0 132
      iOSClient/Library/XLForm/XL/Cell/XLFormButtonCell.m
  8. 0 30
      iOSClient/Library/XLForm/XL/Cell/XLFormCheckCell.h
  9. 0 65
      iOSClient/Library/XLForm/XL/Cell/XLFormCheckCell.m
  10. 0 43
      iOSClient/Library/XLForm/XL/Cell/XLFormDateCell.h
  11. 0 270
      iOSClient/Library/XLForm/XL/Cell/XLFormDateCell.m
  12. 0 35
      iOSClient/Library/XLForm/XL/Cell/XLFormDatePickerCell.h
  13. 0 86
      iOSClient/Library/XLForm/XL/Cell/XLFormDatePickerCell.m
  14. 0 53
      iOSClient/Library/XLForm/XL/Cell/XLFormDescriptorCell.h
  15. 0 33
      iOSClient/Library/XLForm/XL/Cell/XLFormImageCell.h
  16. 0 147
      iOSClient/Library/XLForm/XL/Cell/XLFormImageCell.m
  17. 0 32
      iOSClient/Library/XLForm/XL/Cell/XLFormInlineRowDescriptorCell.h
  18. 0 30
      iOSClient/Library/XLForm/XL/Cell/XLFormInlineSelectorCell.h
  19. 0 180
      iOSClient/Library/XLForm/XL/Cell/XLFormInlineSelectorCell.m
  20. 0 35
      iOSClient/Library/XLForm/XL/Cell/XLFormLeftRightSelectorCell.h
  21. 0 213
      iOSClient/Library/XLForm/XL/Cell/XLFormLeftRightSelectorCell.m
  22. 0 33
      iOSClient/Library/XLForm/XL/Cell/XLFormPickerCell.h
  23. 0 183
      iOSClient/Library/XLForm/XL/Cell/XLFormPickerCell.m
  24. 0 33
      iOSClient/Library/XLForm/XL/Cell/XLFormSegmentedCell.h
  25. 0 173
      iOSClient/Library/XLForm/XL/Cell/XLFormSegmentedCell.m
  26. 0 31
      iOSClient/Library/XLForm/XL/Cell/XLFormSelectorCell.h
  27. 0 415
      iOSClient/Library/XLForm/XL/Cell/XLFormSelectorCell.m
  28. 0 30
      iOSClient/Library/XLForm/XL/Cell/XLFormSliderCell.h
  29. 0 91
      iOSClient/Library/XLForm/XL/Cell/XLFormSliderCell.m
  30. 0 31
      iOSClient/Library/XLForm/XL/Cell/XLFormStepCounterCell.h
  31. 0 121
      iOSClient/Library/XLForm/XL/Cell/XLFormStepCounterCell.m
  32. 0 30
      iOSClient/Library/XLForm/XL/Cell/XLFormSwitchCell.h
  33. 0 61
      iOSClient/Library/XLForm/XL/Cell/XLFormSwitchCell.m
  34. 0 40
      iOSClient/Library/XLForm/XL/Cell/XLFormTextFieldCell.h
  35. 0 368
      iOSClient/Library/XLForm/XL/Cell/XLFormTextFieldCell.m
  36. 0 42
      iOSClient/Library/XLForm/XL/Cell/XLFormTextViewCell.h
  37. 0 222
      iOSClient/Library/XLForm/XL/Cell/XLFormTextViewCell.m
  38. 0 38
      iOSClient/Library/XLForm/XL/Controllers/XLFormOptionsObject.h
  39. 0 110
      iOSClient/Library/XLForm/XL/Controllers/XLFormOptionsObject.m
  40. 0 41
      iOSClient/Library/XLForm/XL/Controllers/XLFormOptionsViewController.h
  41. 0 238
      iOSClient/Library/XLForm/XL/Controllers/XLFormOptionsViewController.m
  42. 0 35
      iOSClient/Library/XLForm/XL/Controllers/XLFormRowDescriptorViewController.h
  43. 0 96
      iOSClient/Library/XLForm/XL/Controllers/XLFormViewController.h
  44. 0 1036
      iOSClient/Library/XLForm/XL/Controllers/XLFormViewController.m
  45. 0 95
      iOSClient/Library/XLForm/XL/Descriptors/XLFormDescriptor.h
  46. 0 631
      iOSClient/Library/XLForm/XL/Descriptors/XLFormDescriptor.m
  47. 0 51
      iOSClient/Library/XLForm/XL/Descriptors/XLFormDescriptorDelegate.h
  48. 0 169
      iOSClient/Library/XLForm/XL/Descriptors/XLFormRowDescriptor.h
  49. 0 713
      iOSClient/Library/XLForm/XL/Descriptors/XLFormRowDescriptor.m
  50. 0 74
      iOSClient/Library/XLForm/XL/Descriptors/XLFormSectionDescriptor.h
  51. 0 411
      iOSClient/Library/XLForm/XL/Descriptors/XLFormSectionDescriptor.m
  52. 0 32
      iOSClient/Library/XLForm/XL/Helpers/NSArray+XLFormAdditions.h
  53. 0 41
      iOSClient/Library/XLForm/XL/Helpers/NSArray+XLFormAdditions.m
  54. 0 33
      iOSClient/Library/XLForm/XL/Helpers/NSExpression+XLFormAdditions.h
  55. 0 50
      iOSClient/Library/XLForm/XL/Helpers/NSExpression+XLFormAdditions.m
  56. 0 33
      iOSClient/Library/XLForm/XL/Helpers/NSObject+XLFormAdditions.h
  57. 0 61
      iOSClient/Library/XLForm/XL/Helpers/NSObject+XLFormAdditions.m
  58. 0 31
      iOSClient/Library/XLForm/XL/Helpers/NSPredicate+XLFormAdditions.h
  59. 0 45
      iOSClient/Library/XLForm/XL/Helpers/NSPredicate+XLFormAdditions.m
  60. 0 35
      iOSClient/Library/XLForm/XL/Helpers/NSString+XLFormAdditions.h
  61. 0 65
      iOSClient/Library/XLForm/XL/Helpers/NSString+XLFormAdditions.m
  62. 0 36
      iOSClient/Library/XLForm/XL/Helpers/UIView+XLFormAdditions.h
  63. 0 73
      iOSClient/Library/XLForm/XL/Helpers/UIView+XLFormAdditions.m
  64. 0 30
      iOSClient/Library/XLForm/XL/Helpers/Views/XLFormRightDetailCell.h
  65. 0 35
      iOSClient/Library/XLForm/XL/Helpers/Views/XLFormRightDetailCell.m
  66. 0 30
      iOSClient/Library/XLForm/XL/Helpers/Views/XLFormRightImageButton.h
  67. 0 40
      iOSClient/Library/XLForm/XL/Helpers/Views/XLFormRightImageButton.m
  68. 0 34
      iOSClient/Library/XLForm/XL/Helpers/Views/XLFormRowNavigationAccessoryView.h
  69. 0 102
      iOSClient/Library/XLForm/XL/Helpers/Views/XLFormRowNavigationAccessoryView.m
  70. 0 37
      iOSClient/Library/XLForm/XL/Helpers/Views/XLFormTextView.h
  71. 0 90
      iOSClient/Library/XLForm/XL/Helpers/Views/XLFormTextView.m
  72. 0 38
      iOSClient/Library/XLForm/XL/Validation/XLFormRegexValidator.h
  73. 0 61
      iOSClient/Library/XLForm/XL/Validation/XLFormRegexValidator.m
  74. 0 42
      iOSClient/Library/XLForm/XL/Validation/XLFormValidationStatus.h
  75. 0 53
      iOSClient/Library/XLForm/XL/Validation/XLFormValidationStatus.m
  76. 0 33
      iOSClient/Library/XLForm/XL/Validation/XLFormValidator.h
  77. 0 49
      iOSClient/Library/XLForm/XL/Validation/XLFormValidator.m
  78. 0 36
      iOSClient/Library/XLForm/XL/Validation/XLFormValidatorProtocol.h
  79. 0 125
      iOSClient/Library/XLForm/XL/XLForm.h
  80. 0 69
      iOSClient/Library/XLForm/XL/XLForm.m
  81. BIN
      iOSClient/Library/XLForm/XLForm.bundle/forwardarrow@2x.png
  82. 1 2
      iOSClient/Settings/CCAdvanced.h
  83. 1 3
      iOSClient/Settings/CCManageAccount.h
  84. 1 1
      iOSClient/Settings/CCManageAutoUpload.h
  85. 1 2
      iOSClient/Settings/CCSettings.h
  86. 1 2
      iOSClient/Settings/NCManageEndToEndEncryption.h

+ 1 - 0
Cartfile

@@ -20,3 +20,4 @@ github "ivanbruel/MarkdownKit"
 
 github "https://github.com/marinofaggiana/AFNetworking" "master"
 github "https://github.com/marinofaggiana/KTVHTTPCache" "2.0.2"
+github "https://github.com/marinofaggiana/XLForm" "master"

+ 1 - 0
Cartfile.resolved

@@ -16,6 +16,7 @@ github "krzyzanowskim/OpenSSL" "1.0.218"
 github "malcommac/SwiftRichString" "3.7.1"
 github "marinofaggiana/AFNetworking" "2967678c3e0e98c9b8d7e06222ad12d1f49c26f2"
 github "marinofaggiana/KTVHTTPCache" "2.0.2"
+github "marinofaggiana/XLForm" "06580a53244d7eb6cdcffd9fd2efc0ebe58242f0"
 github "nextcloud/ios-communication-library" "5d6982774262e8257918ebc7e6ef68ba5ecbd59d"
 github "realm/realm-cocoa" "v4.4.1"
 github "rechsteiner/Parchment" "v1.7.0"

+ 5 - 294
Nextcloud.xcodeproj/project.pbxproj

@@ -227,43 +227,6 @@
 		F75C0C4823D1FAE300163CC8 /* NCRichWorkspaceCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75C0C4723D1FAE300163CC8 /* NCRichWorkspaceCommon.swift */; };
 		F75EDFBD1E8C112F00E6F369 /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = F75EDFBC1E8C112F00E6F369 /* libsqlite3.0.tbd */; };
 		F75EDFBF1E8C116D00E6F369 /* libstdc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = F75EDFBE1E8C116D00E6F369 /* libstdc++.tbd */; };
-		F762CAF71EACB66200B38484 /* XLFormBaseCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAA41EACB66200B38484 /* XLFormBaseCell.m */; };
-		F762CAF81EACB66200B38484 /* XLFormButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAA61EACB66200B38484 /* XLFormButtonCell.m */; };
-		F762CAF91EACB66200B38484 /* XLFormCheckCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAA81EACB66200B38484 /* XLFormCheckCell.m */; };
-		F762CAFA1EACB66200B38484 /* XLFormDateCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAAA1EACB66200B38484 /* XLFormDateCell.m */; };
-		F762CAFB1EACB66200B38484 /* XLFormDatePickerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAAC1EACB66200B38484 /* XLFormDatePickerCell.m */; };
-		F762CAFC1EACB66200B38484 /* XLFormImageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAAF1EACB66200B38484 /* XLFormImageCell.m */; };
-		F762CAFD1EACB66200B38484 /* XLFormInlineSelectorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAB21EACB66200B38484 /* XLFormInlineSelectorCell.m */; };
-		F762CAFE1EACB66200B38484 /* XLFormLeftRightSelectorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAB41EACB66200B38484 /* XLFormLeftRightSelectorCell.m */; };
-		F762CAFF1EACB66200B38484 /* XLFormPickerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAB61EACB66200B38484 /* XLFormPickerCell.m */; };
-		F762CB001EACB66200B38484 /* XLFormSegmentedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAB81EACB66200B38484 /* XLFormSegmentedCell.m */; };
-		F762CB011EACB66200B38484 /* XLFormSelectorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CABA1EACB66200B38484 /* XLFormSelectorCell.m */; };
-		F762CB021EACB66200B38484 /* XLFormSliderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CABC1EACB66200B38484 /* XLFormSliderCell.m */; };
-		F762CB031EACB66200B38484 /* XLFormStepCounterCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CABE1EACB66200B38484 /* XLFormStepCounterCell.m */; };
-		F762CB041EACB66200B38484 /* XLFormSwitchCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAC01EACB66200B38484 /* XLFormSwitchCell.m */; };
-		F762CB051EACB66200B38484 /* XLFormTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAC21EACB66200B38484 /* XLFormTextFieldCell.m */; };
-		F762CB061EACB66200B38484 /* XLFormTextViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAC41EACB66200B38484 /* XLFormTextViewCell.m */; };
-		F762CB071EACB66200B38484 /* XLFormOptionsObject.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAC71EACB66200B38484 /* XLFormOptionsObject.m */; };
-		F762CB081EACB66200B38484 /* XLFormOptionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAC91EACB66200B38484 /* XLFormOptionsViewController.m */; };
-		F762CB091EACB66200B38484 /* XLFormViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CACC1EACB66200B38484 /* XLFormViewController.m */; };
-		F762CB0A1EACB66200B38484 /* XLFormDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CACF1EACB66200B38484 /* XLFormDescriptor.m */; };
-		F762CB0B1EACB66200B38484 /* XLFormRowDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAD21EACB66200B38484 /* XLFormRowDescriptor.m */; };
-		F762CB0C1EACB66200B38484 /* XLFormSectionDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAD41EACB66200B38484 /* XLFormSectionDescriptor.m */; };
-		F762CB0D1EACB66200B38484 /* NSArray+XLFormAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAD71EACB66200B38484 /* NSArray+XLFormAdditions.m */; };
-		F762CB0E1EACB66200B38484 /* NSExpression+XLFormAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAD91EACB66200B38484 /* NSExpression+XLFormAdditions.m */; };
-		F762CB0F1EACB66200B38484 /* NSObject+XLFormAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CADB1EACB66200B38484 /* NSObject+XLFormAdditions.m */; };
-		F762CB101EACB66200B38484 /* NSPredicate+XLFormAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CADD1EACB66200B38484 /* NSPredicate+XLFormAdditions.m */; };
-		F762CB111EACB66200B38484 /* NSString+XLFormAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CADF1EACB66200B38484 /* NSString+XLFormAdditions.m */; };
-		F762CB121EACB66200B38484 /* UIView+XLFormAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAE11EACB66200B38484 /* UIView+XLFormAdditions.m */; };
-		F762CB131EACB66200B38484 /* XLFormRightDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAE41EACB66200B38484 /* XLFormRightDetailCell.m */; };
-		F762CB141EACB66200B38484 /* XLFormRightImageButton.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAE61EACB66200B38484 /* XLFormRightImageButton.m */; };
-		F762CB151EACB66200B38484 /* XLFormRowNavigationAccessoryView.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAE81EACB66200B38484 /* XLFormRowNavigationAccessoryView.m */; };
-		F762CB161EACB66200B38484 /* XLFormTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAEA1EACB66200B38484 /* XLFormTextView.m */; };
-		F762CB171EACB66200B38484 /* XLFormRegexValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAED1EACB66200B38484 /* XLFormRegexValidator.m */; };
-		F762CB181EACB66200B38484 /* XLFormValidationStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAEF1EACB66200B38484 /* XLFormValidationStatus.m */; };
-		F762CB191EACB66200B38484 /* XLFormValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAF11EACB66200B38484 /* XLFormValidator.m */; };
-		F762CB1A1EACB66200B38484 /* XLForm.m in Sources */ = {isa = PBXBuildFile; fileRef = F762CAF41EACB66200B38484 /* XLForm.m */; };
-		F762CB1B1EACB66200B38484 /* XLForm.bundle in Resources */ = {isa = PBXBuildFile; fileRef = F762CAF51EACB66200B38484 /* XLForm.bundle */; };
 		F7632FBF21832F8700721B71 /* NCTrashSectionHeaderMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7632FBE21832F8700721B71 /* NCTrashSectionHeaderMenu.xib */; };
 		F7632FC1218353AA00721B71 /* NCTrashSectionFooter.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7632FC0218353AA00721B71 /* NCTrashSectionFooter.xib */; };
 		F7651A8A23A2A3F2001403D2 /* NCCreateFormUploadDocuments.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7651A8823A2A3F2001403D2 /* NCCreateFormUploadDocuments.storyboard */; };
@@ -424,6 +387,7 @@
 		F7CA1ED820E7E3FE002CC65E /* PKBorderedButton.m in Sources */ = {isa = PBXBuildFile; fileRef = F7CA1ECA20E7E3FE002CC65E /* PKBorderedButton.m */; };
 		F7CA1ED920E7E3FE002CC65E /* NSLayoutConstraint+PKDownloadButton.m in Sources */ = {isa = PBXBuildFile; fileRef = F7CA1ECE20E7E3FE002CC65E /* NSLayoutConstraint+PKDownloadButton.m */; };
 		F7D1612023CF19E30039EBBF /* NCViewerRichWorkspace.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7D1611F23CF19E30039EBBF /* NCViewerRichWorkspace.storyboard */; };
+		F7D2C773246470CA008513AE /* XLForm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7D2C772246470CA008513AE /* XLForm.framework */; };
 		F7D2D127230804E000FD3ED7 /* NCXMLListParser.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D2D126230804E000FD3ED7 /* NCXMLListParser.m */; };
 		F7D2D128230804E000FD3ED7 /* NCXMLListParser.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D2D126230804E000FD3ED7 /* NCXMLListParser.m */; };
 		F7D4B6852295663D000C2C86 /* GoogleAppMeasurement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7D4B67D2295663D000C2C86 /* GoogleAppMeasurement.framework */; };
@@ -794,84 +758,6 @@
 		F75CDBF51DF063AD00116AD0 /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = text; name = .gitignore; path = ../.gitignore; sourceTree = "<group>"; };
 		F75EDFBC1E8C112F00E6F369 /* libsqlite3.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.0.tbd; path = usr/lib/libsqlite3.0.tbd; sourceTree = SDKROOT; };
 		F75EDFBE1E8C116D00E6F369 /* libstdc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libstdc++.tbd"; path = "usr/lib/libstdc++.tbd"; sourceTree = SDKROOT; };
-		F762CAA31EACB66200B38484 /* XLFormBaseCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormBaseCell.h; sourceTree = "<group>"; };
-		F762CAA41EACB66200B38484 /* XLFormBaseCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormBaseCell.m; sourceTree = "<group>"; };
-		F762CAA51EACB66200B38484 /* XLFormButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormButtonCell.h; sourceTree = "<group>"; };
-		F762CAA61EACB66200B38484 /* XLFormButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormButtonCell.m; sourceTree = "<group>"; };
-		F762CAA71EACB66200B38484 /* XLFormCheckCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormCheckCell.h; sourceTree = "<group>"; };
-		F762CAA81EACB66200B38484 /* XLFormCheckCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormCheckCell.m; sourceTree = "<group>"; };
-		F762CAA91EACB66200B38484 /* XLFormDateCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormDateCell.h; sourceTree = "<group>"; };
-		F762CAAA1EACB66200B38484 /* XLFormDateCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormDateCell.m; sourceTree = "<group>"; };
-		F762CAAB1EACB66200B38484 /* XLFormDatePickerCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormDatePickerCell.h; sourceTree = "<group>"; };
-		F762CAAC1EACB66200B38484 /* XLFormDatePickerCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormDatePickerCell.m; sourceTree = "<group>"; };
-		F762CAAD1EACB66200B38484 /* XLFormDescriptorCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormDescriptorCell.h; sourceTree = "<group>"; };
-		F762CAAE1EACB66200B38484 /* XLFormImageCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormImageCell.h; sourceTree = "<group>"; };
-		F762CAAF1EACB66200B38484 /* XLFormImageCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormImageCell.m; sourceTree = "<group>"; };
-		F762CAB01EACB66200B38484 /* XLFormInlineRowDescriptorCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormInlineRowDescriptorCell.h; sourceTree = "<group>"; };
-		F762CAB11EACB66200B38484 /* XLFormInlineSelectorCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormInlineSelectorCell.h; sourceTree = "<group>"; };
-		F762CAB21EACB66200B38484 /* XLFormInlineSelectorCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormInlineSelectorCell.m; sourceTree = "<group>"; };
-		F762CAB31EACB66200B38484 /* XLFormLeftRightSelectorCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormLeftRightSelectorCell.h; sourceTree = "<group>"; };
-		F762CAB41EACB66200B38484 /* XLFormLeftRightSelectorCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormLeftRightSelectorCell.m; sourceTree = "<group>"; };
-		F762CAB51EACB66200B38484 /* XLFormPickerCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormPickerCell.h; sourceTree = "<group>"; };
-		F762CAB61EACB66200B38484 /* XLFormPickerCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormPickerCell.m; sourceTree = "<group>"; };
-		F762CAB71EACB66200B38484 /* XLFormSegmentedCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormSegmentedCell.h; sourceTree = "<group>"; };
-		F762CAB81EACB66200B38484 /* XLFormSegmentedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormSegmentedCell.m; sourceTree = "<group>"; };
-		F762CAB91EACB66200B38484 /* XLFormSelectorCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormSelectorCell.h; sourceTree = "<group>"; };
-		F762CABA1EACB66200B38484 /* XLFormSelectorCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormSelectorCell.m; sourceTree = "<group>"; };
-		F762CABB1EACB66200B38484 /* XLFormSliderCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormSliderCell.h; sourceTree = "<group>"; };
-		F762CABC1EACB66200B38484 /* XLFormSliderCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormSliderCell.m; sourceTree = "<group>"; };
-		F762CABD1EACB66200B38484 /* XLFormStepCounterCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormStepCounterCell.h; sourceTree = "<group>"; };
-		F762CABE1EACB66200B38484 /* XLFormStepCounterCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormStepCounterCell.m; sourceTree = "<group>"; };
-		F762CABF1EACB66200B38484 /* XLFormSwitchCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormSwitchCell.h; sourceTree = "<group>"; };
-		F762CAC01EACB66200B38484 /* XLFormSwitchCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormSwitchCell.m; sourceTree = "<group>"; };
-		F762CAC11EACB66200B38484 /* XLFormTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormTextFieldCell.h; sourceTree = "<group>"; };
-		F762CAC21EACB66200B38484 /* XLFormTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormTextFieldCell.m; sourceTree = "<group>"; };
-		F762CAC31EACB66200B38484 /* XLFormTextViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormTextViewCell.h; sourceTree = "<group>"; };
-		F762CAC41EACB66200B38484 /* XLFormTextViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormTextViewCell.m; sourceTree = "<group>"; };
-		F762CAC61EACB66200B38484 /* XLFormOptionsObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormOptionsObject.h; sourceTree = "<group>"; };
-		F762CAC71EACB66200B38484 /* XLFormOptionsObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormOptionsObject.m; sourceTree = "<group>"; };
-		F762CAC81EACB66200B38484 /* XLFormOptionsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormOptionsViewController.h; sourceTree = "<group>"; };
-		F762CAC91EACB66200B38484 /* XLFormOptionsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormOptionsViewController.m; sourceTree = "<group>"; };
-		F762CACA1EACB66200B38484 /* XLFormRowDescriptorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormRowDescriptorViewController.h; sourceTree = "<group>"; };
-		F762CACB1EACB66200B38484 /* XLFormViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormViewController.h; sourceTree = "<group>"; };
-		F762CACC1EACB66200B38484 /* XLFormViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormViewController.m; sourceTree = "<group>"; };
-		F762CACE1EACB66200B38484 /* XLFormDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormDescriptor.h; sourceTree = "<group>"; };
-		F762CACF1EACB66200B38484 /* XLFormDescriptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormDescriptor.m; sourceTree = "<group>"; };
-		F762CAD01EACB66200B38484 /* XLFormDescriptorDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormDescriptorDelegate.h; sourceTree = "<group>"; };
-		F762CAD11EACB66200B38484 /* XLFormRowDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormRowDescriptor.h; sourceTree = "<group>"; };
-		F762CAD21EACB66200B38484 /* XLFormRowDescriptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormRowDescriptor.m; sourceTree = "<group>"; };
-		F762CAD31EACB66200B38484 /* XLFormSectionDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormSectionDescriptor.h; sourceTree = "<group>"; };
-		F762CAD41EACB66200B38484 /* XLFormSectionDescriptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormSectionDescriptor.m; sourceTree = "<group>"; };
-		F762CAD61EACB66200B38484 /* NSArray+XLFormAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+XLFormAdditions.h"; sourceTree = "<group>"; };
-		F762CAD71EACB66200B38484 /* NSArray+XLFormAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+XLFormAdditions.m"; sourceTree = "<group>"; };
-		F762CAD81EACB66200B38484 /* NSExpression+XLFormAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSExpression+XLFormAdditions.h"; sourceTree = "<group>"; };
-		F762CAD91EACB66200B38484 /* NSExpression+XLFormAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSExpression+XLFormAdditions.m"; sourceTree = "<group>"; };
-		F762CADA1EACB66200B38484 /* NSObject+XLFormAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+XLFormAdditions.h"; sourceTree = "<group>"; };
-		F762CADB1EACB66200B38484 /* NSObject+XLFormAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+XLFormAdditions.m"; sourceTree = "<group>"; };
-		F762CADC1EACB66200B38484 /* NSPredicate+XLFormAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSPredicate+XLFormAdditions.h"; sourceTree = "<group>"; };
-		F762CADD1EACB66200B38484 /* NSPredicate+XLFormAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSPredicate+XLFormAdditions.m"; sourceTree = "<group>"; };
-		F762CADE1EACB66200B38484 /* NSString+XLFormAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+XLFormAdditions.h"; sourceTree = "<group>"; };
-		F762CADF1EACB66200B38484 /* NSString+XLFormAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+XLFormAdditions.m"; sourceTree = "<group>"; };
-		F762CAE01EACB66200B38484 /* UIView+XLFormAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+XLFormAdditions.h"; sourceTree = "<group>"; };
-		F762CAE11EACB66200B38484 /* UIView+XLFormAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+XLFormAdditions.m"; sourceTree = "<group>"; };
-		F762CAE31EACB66200B38484 /* XLFormRightDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormRightDetailCell.h; sourceTree = "<group>"; };
-		F762CAE41EACB66200B38484 /* XLFormRightDetailCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormRightDetailCell.m; sourceTree = "<group>"; };
-		F762CAE51EACB66200B38484 /* XLFormRightImageButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormRightImageButton.h; sourceTree = "<group>"; };
-		F762CAE61EACB66200B38484 /* XLFormRightImageButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormRightImageButton.m; sourceTree = "<group>"; };
-		F762CAE71EACB66200B38484 /* XLFormRowNavigationAccessoryView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormRowNavigationAccessoryView.h; sourceTree = "<group>"; };
-		F762CAE81EACB66200B38484 /* XLFormRowNavigationAccessoryView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormRowNavigationAccessoryView.m; sourceTree = "<group>"; };
-		F762CAE91EACB66200B38484 /* XLFormTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormTextView.h; sourceTree = "<group>"; };
-		F762CAEA1EACB66200B38484 /* XLFormTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormTextView.m; sourceTree = "<group>"; };
-		F762CAEC1EACB66200B38484 /* XLFormRegexValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormRegexValidator.h; sourceTree = "<group>"; };
-		F762CAED1EACB66200B38484 /* XLFormRegexValidator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormRegexValidator.m; sourceTree = "<group>"; };
-		F762CAEE1EACB66200B38484 /* XLFormValidationStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormValidationStatus.h; sourceTree = "<group>"; };
-		F762CAEF1EACB66200B38484 /* XLFormValidationStatus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormValidationStatus.m; sourceTree = "<group>"; };
-		F762CAF01EACB66200B38484 /* XLFormValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormValidator.h; sourceTree = "<group>"; };
-		F762CAF11EACB66200B38484 /* XLFormValidator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLFormValidator.m; sourceTree = "<group>"; };
-		F762CAF21EACB66200B38484 /* XLFormValidatorProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLFormValidatorProtocol.h; sourceTree = "<group>"; };
-		F762CAF31EACB66200B38484 /* XLForm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLForm.h; sourceTree = "<group>"; };
-		F762CAF41EACB66200B38484 /* XLForm.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLForm.m; sourceTree = "<group>"; };
-		F762CAF51EACB66200B38484 /* XLForm.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = XLForm.bundle; sourceTree = "<group>"; };
 		F7632FBE21832F8700721B71 /* NCTrashSectionHeaderMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NCTrashSectionHeaderMenu.xib; sourceTree = "<group>"; };
 		F7632FC0218353AA00721B71 /* NCTrashSectionFooter.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NCTrashSectionFooter.xib; sourceTree = "<group>"; };
 		F76344751BF259A800188725 /* synchronized.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = synchronized.gif; sourceTree = "<group>"; };
@@ -1078,6 +964,7 @@
 		F7CE8AFB1DC1F8D8009CAE48 /* Share.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = Share.appex; sourceTree = BUILT_PRODUCTS_DIR; };
 		F7D154271E2392A300202FD9 /* Nextcloud-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Nextcloud-Bridging-Header.h"; sourceTree = "<group>"; };
 		F7D1611F23CF19E30039EBBF /* NCViewerRichWorkspace.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCViewerRichWorkspace.storyboard; sourceTree = "<group>"; };
+		F7D2C772246470CA008513AE /* XLForm.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XLForm.framework; path = Carthage/Build/iOS/XLForm.framework; sourceTree = "<group>"; };
 		F7D2D125230804DF00FD3ED7 /* NCXMLListParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCXMLListParser.h; sourceTree = "<group>"; };
 		F7D2D126230804E000FD3ED7 /* NCXMLListParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NCXMLListParser.m; sourceTree = "<group>"; };
 		F7D4B67B22956610000C2C86 /* Firebase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Firebase.h; sourceTree = "<group>"; };
@@ -1211,6 +1098,7 @@
 				F7D4B68A2295663D000C2C86 /* FIRAnalyticsConnector.framework in Frameworks */,
 				F700510322DF6897003A3356 /* Parchment.framework in Frameworks */,
 				F7D4B6882295663D000C2C86 /* GoogleUtilities.framework in Frameworks */,
+				F7D2C773246470CA008513AE /* XLForm.framework in Frameworks */,
 				371B5A3323D0BD5500FAFAE9 /* FloatingPanel.framework in Frameworks */,
 				F70F2BA5225F2D8900EBB73E /* ZIPFoundation.framework in Frameworks */,
 				F7D4B6972295666E000C2C86 /* GoogleAPIClientForREST.framework in Frameworks */,
@@ -1669,147 +1557,6 @@
 			path = ScanDocument;
 			sourceTree = "<group>";
 		};
-		F762CA9F1EACB66200B38484 /* XLForm */ = {
-			isa = PBXGroup;
-			children = (
-				F762CAA11EACB66200B38484 /* XL */,
-				F762CAF51EACB66200B38484 /* XLForm.bundle */,
-			);
-			path = XLForm;
-			sourceTree = "<group>";
-		};
-		F762CAA11EACB66200B38484 /* XL */ = {
-			isa = PBXGroup;
-			children = (
-				F762CAA21EACB66200B38484 /* Cell */,
-				F762CAC51EACB66200B38484 /* Controllers */,
-				F762CACD1EACB66200B38484 /* Descriptors */,
-				F762CAD51EACB66200B38484 /* Helpers */,
-				F762CAEB1EACB66200B38484 /* Validation */,
-				F762CAF31EACB66200B38484 /* XLForm.h */,
-				F762CAF41EACB66200B38484 /* XLForm.m */,
-			);
-			path = XL;
-			sourceTree = "<group>";
-		};
-		F762CAA21EACB66200B38484 /* Cell */ = {
-			isa = PBXGroup;
-			children = (
-				F762CAA31EACB66200B38484 /* XLFormBaseCell.h */,
-				F762CAA41EACB66200B38484 /* XLFormBaseCell.m */,
-				F762CAA51EACB66200B38484 /* XLFormButtonCell.h */,
-				F762CAA61EACB66200B38484 /* XLFormButtonCell.m */,
-				F762CAA71EACB66200B38484 /* XLFormCheckCell.h */,
-				F762CAA81EACB66200B38484 /* XLFormCheckCell.m */,
-				F762CAA91EACB66200B38484 /* XLFormDateCell.h */,
-				F762CAAA1EACB66200B38484 /* XLFormDateCell.m */,
-				F762CAAB1EACB66200B38484 /* XLFormDatePickerCell.h */,
-				F762CAAC1EACB66200B38484 /* XLFormDatePickerCell.m */,
-				F762CAAD1EACB66200B38484 /* XLFormDescriptorCell.h */,
-				F762CAAE1EACB66200B38484 /* XLFormImageCell.h */,
-				F762CAAF1EACB66200B38484 /* XLFormImageCell.m */,
-				F762CAB01EACB66200B38484 /* XLFormInlineRowDescriptorCell.h */,
-				F762CAB11EACB66200B38484 /* XLFormInlineSelectorCell.h */,
-				F762CAB21EACB66200B38484 /* XLFormInlineSelectorCell.m */,
-				F762CAB31EACB66200B38484 /* XLFormLeftRightSelectorCell.h */,
-				F762CAB41EACB66200B38484 /* XLFormLeftRightSelectorCell.m */,
-				F762CAB51EACB66200B38484 /* XLFormPickerCell.h */,
-				F762CAB61EACB66200B38484 /* XLFormPickerCell.m */,
-				F762CAB71EACB66200B38484 /* XLFormSegmentedCell.h */,
-				F762CAB81EACB66200B38484 /* XLFormSegmentedCell.m */,
-				F762CAB91EACB66200B38484 /* XLFormSelectorCell.h */,
-				F762CABA1EACB66200B38484 /* XLFormSelectorCell.m */,
-				F762CABB1EACB66200B38484 /* XLFormSliderCell.h */,
-				F762CABC1EACB66200B38484 /* XLFormSliderCell.m */,
-				F762CABD1EACB66200B38484 /* XLFormStepCounterCell.h */,
-				F762CABE1EACB66200B38484 /* XLFormStepCounterCell.m */,
-				F762CABF1EACB66200B38484 /* XLFormSwitchCell.h */,
-				F762CAC01EACB66200B38484 /* XLFormSwitchCell.m */,
-				F762CAC11EACB66200B38484 /* XLFormTextFieldCell.h */,
-				F762CAC21EACB66200B38484 /* XLFormTextFieldCell.m */,
-				F762CAC31EACB66200B38484 /* XLFormTextViewCell.h */,
-				F762CAC41EACB66200B38484 /* XLFormTextViewCell.m */,
-			);
-			path = Cell;
-			sourceTree = "<group>";
-		};
-		F762CAC51EACB66200B38484 /* Controllers */ = {
-			isa = PBXGroup;
-			children = (
-				F762CAC61EACB66200B38484 /* XLFormOptionsObject.h */,
-				F762CAC71EACB66200B38484 /* XLFormOptionsObject.m */,
-				F762CAC81EACB66200B38484 /* XLFormOptionsViewController.h */,
-				F762CAC91EACB66200B38484 /* XLFormOptionsViewController.m */,
-				F762CACA1EACB66200B38484 /* XLFormRowDescriptorViewController.h */,
-				F762CACB1EACB66200B38484 /* XLFormViewController.h */,
-				F762CACC1EACB66200B38484 /* XLFormViewController.m */,
-			);
-			path = Controllers;
-			sourceTree = "<group>";
-		};
-		F762CACD1EACB66200B38484 /* Descriptors */ = {
-			isa = PBXGroup;
-			children = (
-				F762CACE1EACB66200B38484 /* XLFormDescriptor.h */,
-				F762CACF1EACB66200B38484 /* XLFormDescriptor.m */,
-				F762CAD01EACB66200B38484 /* XLFormDescriptorDelegate.h */,
-				F762CAD11EACB66200B38484 /* XLFormRowDescriptor.h */,
-				F762CAD21EACB66200B38484 /* XLFormRowDescriptor.m */,
-				F762CAD31EACB66200B38484 /* XLFormSectionDescriptor.h */,
-				F762CAD41EACB66200B38484 /* XLFormSectionDescriptor.m */,
-			);
-			path = Descriptors;
-			sourceTree = "<group>";
-		};
-		F762CAD51EACB66200B38484 /* Helpers */ = {
-			isa = PBXGroup;
-			children = (
-				F762CAD61EACB66200B38484 /* NSArray+XLFormAdditions.h */,
-				F762CAD71EACB66200B38484 /* NSArray+XLFormAdditions.m */,
-				F762CAD81EACB66200B38484 /* NSExpression+XLFormAdditions.h */,
-				F762CAD91EACB66200B38484 /* NSExpression+XLFormAdditions.m */,
-				F762CADA1EACB66200B38484 /* NSObject+XLFormAdditions.h */,
-				F762CADB1EACB66200B38484 /* NSObject+XLFormAdditions.m */,
-				F762CADC1EACB66200B38484 /* NSPredicate+XLFormAdditions.h */,
-				F762CADD1EACB66200B38484 /* NSPredicate+XLFormAdditions.m */,
-				F762CADE1EACB66200B38484 /* NSString+XLFormAdditions.h */,
-				F762CADF1EACB66200B38484 /* NSString+XLFormAdditions.m */,
-				F762CAE01EACB66200B38484 /* UIView+XLFormAdditions.h */,
-				F762CAE11EACB66200B38484 /* UIView+XLFormAdditions.m */,
-				F762CAE21EACB66200B38484 /* Views */,
-			);
-			path = Helpers;
-			sourceTree = "<group>";
-		};
-		F762CAE21EACB66200B38484 /* Views */ = {
-			isa = PBXGroup;
-			children = (
-				F762CAE31EACB66200B38484 /* XLFormRightDetailCell.h */,
-				F762CAE41EACB66200B38484 /* XLFormRightDetailCell.m */,
-				F762CAE51EACB66200B38484 /* XLFormRightImageButton.h */,
-				F762CAE61EACB66200B38484 /* XLFormRightImageButton.m */,
-				F762CAE71EACB66200B38484 /* XLFormRowNavigationAccessoryView.h */,
-				F762CAE81EACB66200B38484 /* XLFormRowNavigationAccessoryView.m */,
-				F762CAE91EACB66200B38484 /* XLFormTextView.h */,
-				F762CAEA1EACB66200B38484 /* XLFormTextView.m */,
-			);
-			path = Views;
-			sourceTree = "<group>";
-		};
-		F762CAEB1EACB66200B38484 /* Validation */ = {
-			isa = PBXGroup;
-			children = (
-				F762CAEC1EACB66200B38484 /* XLFormRegexValidator.h */,
-				F762CAED1EACB66200B38484 /* XLFormRegexValidator.m */,
-				F762CAEE1EACB66200B38484 /* XLFormValidationStatus.h */,
-				F762CAEF1EACB66200B38484 /* XLFormValidationStatus.m */,
-				F762CAF01EACB66200B38484 /* XLFormValidator.h */,
-				F762CAF11EACB66200B38484 /* XLFormValidator.m */,
-				F762CAF21EACB66200B38484 /* XLFormValidatorProtocol.h */,
-			);
-			path = Validation;
-			sourceTree = "<group>";
-		};
 		F7632FC32183667400721B71 /* Section */ = {
 			isa = PBXGroup;
 			children = (
@@ -2302,7 +2049,6 @@
 				F73CC0571E813DFF006E3047 /* BKPasscodeView */,
 				F754EEC321772B6100BB1CDF /* DropdownMenu */,
 				F7B4F1C51F44356F00B53B42 /* NCUchardet */,
-				F762CA9F1EACB66200B38484 /* XLForm */,
 			);
 			path = Library;
 			sourceTree = "<group>";
@@ -2388,6 +2134,7 @@
 		F7FC7D541DC1F93700BB2C6A /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
+				F7D2C772246470CA008513AE /* XLForm.framework */,
 				F79018A424092EF4007C9B6D /* ATGMediaBrowser.framework */,
 				F7DBD82B23E46A4700ECB7C6 /* MarkdownKit.framework */,
 				371B5A3223D0BD5500FAFAE9 /* FloatingPanel.framework */,
@@ -2722,7 +2469,6 @@
 				F769453E22E9E97E000A798A /* NCShareUserMenuView.xib in Resources */,
 				F749C10E23C4A5340027D966 /* NCIntroCollectionViewCell.xib in Resources */,
 				F723B3DD22FC6D1D00301EFE /* NCShareCommentsCell.xib in Resources */,
-				F762CB1B1EACB66200B38484 /* XLForm.bundle in Resources */,
 				F78ACD4B21903F850088454D /* NCTrashListCell.xib in Resources */,
 				F700510122DF63AC003A3356 /* NCShare.storyboard in Resources */,
 				F77B0F571D118A16002130FE /* synchronizedcrypto.gif in Resources */,
@@ -2816,6 +2562,7 @@
 				"$(SRCROOT)/Carthage/Build/iOS/SwiftEntryKit.framework",
 				"$(SRCROOT)/Carthage/Build/iOS/FloatingPanel.framework",
 				"$(SRCROOT)/Carthage/Build/iOS/MarkdownKit.framework",
+				"$(SRCROOT)/Carthage/Build/iOS/XLForm.framework",
 			);
 			outputPaths = (
 			);
@@ -2946,7 +2693,6 @@
 			buildActionMask = 2147483647;
 			files = (
 				F70022D71EC4C9100080073F /* NSDate+RFC1123.m in Sources */,
-				F762CAFD1EACB66200B38484 /* XLFormInlineSelectorCell.m in Sources */,
 				F77B0DF21D118A16002130FE /* CCUploadFromOtherUpp.m in Sources */,
 				F754EECB21772B6100BB1CDF /* DropdownMenu.swift in Sources */,
 				F77444F522281649000D5EB0 /* NCGridMediaCell.swift in Sources */,
@@ -2956,7 +2702,6 @@
 				F7E9C41B20F4CA870040CF18 /* CCTransfers.m in Sources */,
 				F73B4F0D1F470D9100BBEE4B /* nsLatin1Prober.cpp in Sources */,
 				F77B0DF51D118A16002130FE /* CCUtility.m in Sources */,
-				F762CB071EACB66200B38484 /* XLFormOptionsObject.m in Sources */,
 				F7C525A01E3B48B700FFE02C /* CCNotification.swift in Sources */,
 				F73B4F041F470D9100BBEE4B /* nsBig5Prober.cpp in Sources */,
 				F73B4EEF1F470D9100BBEE4B /* CharDistribution.cpp in Sources */,
@@ -2968,7 +2713,6 @@
 				F70022DA1EC4C9100080073F /* OCHTTPRequestOperation.m in Sources */,
 				F790110E21415BF600D7B136 /* NCViewerRichdocument.swift in Sources */,
 				F78ACD4021903CC20088454D /* NCGridCell.swift in Sources */,
-				F762CB041EACB66200B38484 /* XLFormSwitchCell.m in Sources */,
 				F73B4F0F1F470D9100BBEE4B /* nsMBCSSM.cpp in Sources */,
 				F754EECA21772B6100BB1CDF /* DropUpMenu.swift in Sources */,
 				F77B0E041D118A16002130FE /* UIImage+animatedGIF.m in Sources */,
@@ -2978,9 +2722,7 @@
 				F79018B8240962C7007C9B6D /* NCViewerImageViewController.swift in Sources */,
 				F769454022E9F077000A798A /* NCSharePaging.swift in Sources */,
 				F70022EC1EC4C9100080073F /* OCXMLSharedParser.m in Sources */,
-				F762CB001EACB66200B38484 /* XLFormSegmentedCell.m in Sources */,
 				F732BA061D76CE1500E9878B /* CCNetworking.m in Sources */,
-				F762CB061EACB66200B38484 /* XLFormTextViewCell.m in Sources */,
 				F78ACD4221903CE00088454D /* NCListCell.swift in Sources */,
 				F76D3CF12428B40E005DFA87 /* NCViewerPDFSearch.swift in Sources */,
 				F78ACD4F2190440D0088454D /* NCLayout.swift in Sources */,
@@ -2989,7 +2731,6 @@
 				F79018B7240962C7007C9B6D /* NCViewerImageContentView.swift in Sources */,
 				F78E7065219F096B006F23E4 /* NCAvatar.swift in Sources */,
 				F7DFB7F0219C5B8000680748 /* NCCreateFormUploadAssets.swift in Sources */,
-				F762CB0C1EACB66200B38484 /* XLFormSectionDescriptor.m in Sources */,
 				371B5A2E23D0B04500FAFAE9 /* NCMainMenuTableViewController.swift in Sources */,
 				F750374F1DBFA91A008FB480 /* NSArray+PureLayout.m in Sources */,
 				F77444F8222816D5000D5EB0 /* NCPhotosPickerViewController.swift in Sources */,
@@ -3008,7 +2749,6 @@
 				F75A9EE623796C6F0044CFCE /* NCNetworking.swift in Sources */,
 				F73B4F091F470D9100BBEE4B /* nsEUCKRProber.cpp in Sources */,
 				F758B460212C56A400515F55 /* ScanCollectionView.swift in Sources */,
-				F762CB021EACB66200B38484 /* XLFormSliderCell.m in Sources */,
 				F78ACD52219046DC0088454D /* NCSectionHeaderFooter.swift in Sources */,
 				F749C10C23C4A5340027D966 /* NCIntroViewController.swift in Sources */,
 				F77B0E1B1D118A16002130FE /* CCGraphics.m in Sources */,
@@ -3016,21 +2756,16 @@
 				F70022CB1EC4C9100080073F /* OCSharedDto.m in Sources */,
 				3757A35523D9D76300EC369E /* NCMenuPanelController.swift in Sources */,
 				F7CA1ED320E7E3FE002CC65E /* PKStopDownloadButton.m in Sources */,
-				F762CB111EACB66200B38484 /* NSString+XLFormAdditions.m in Sources */,
-				F762CB081EACB66200B38484 /* XLFormOptionsViewController.m in Sources */,
 				F704B5E92430C0B800632F5F /* NCCreateFormUploadConflictCell.swift in Sources */,
 				F72D404923D2082500A97FD0 /* NCViewerNextcloudText.swift in Sources */,
 				F73CC0721E813DFF006E3047 /* BKPasscodeLockScreenManager.m in Sources */,
 				F73B4F101F470D9100BBEE4B /* nsSBCharSetProber.cpp in Sources */,
-				F762CB0E1EACB66200B38484 /* NSExpression+XLFormAdditions.m in Sources */,
 				F73B4F071F470D9100BBEE4B /* nsEscSM.cpp in Sources */,
 				F77B0E221D118A16002130FE /* CCManageLocation.m in Sources */,
 				F70022C51EC4C9100080073F /* OCNotificationsAction.m in Sources */,
 				F7D6650720FF341600BFBA9E /* NCMainCommon.swift in Sources */,
 				F700510522DF6A89003A3356 /* NCShare.swift in Sources */,
-				F762CAF81EACB66200B38484 /* XLFormButtonCell.m in Sources */,
 				F7CA1ED120E7E3FE002CC65E /* PKCircleProgressView.m in Sources */,
-				F762CAFC1EACB66200B38484 /* XLFormImageCell.m in Sources */,
 				F72D1007210B6882009C96B7 /* NCPushNotificationEncryption.m in Sources */,
 				F70022D11EC4C9100080073F /* OCUserProfile.m in Sources */,
 				F73B4EF61F470D9100BBEE4B /* LangArabicModel.cpp in Sources */,
@@ -3039,7 +2774,6 @@
 				F769454222E9F0EE000A798A /* NCShareLinkMenuView.swift in Sources */,
 				F73B4F0B1F470D9100BBEE4B /* nsGB2312Prober.cpp in Sources */,
 				F785EE9D246196DF00B3F945 /* NCNetworkingE2EE.swift in Sources */,
-				F762CAFE1EACB66200B38484 /* XLFormLeftRightSelectorCell.m in Sources */,
 				F77B0E301D118A16002130FE /* CCHud.m in Sources */,
 				F76673ED22C901F6007ED366 /* FileProviderDomain.swift in Sources */,
 				F70022E91EC4C9100080073F /* OCXMLShareByLinkParser.m in Sources */,
@@ -3048,30 +2782,22 @@
 				F73B4F171F470D9100BBEE4B /* uchardet.cpp in Sources */,
 				F7B6ACDB22FC2D15008AB646 /* NCComments.m in Sources */,
 				F73B4F121F470D9100BBEE4B /* nsSJISProber.cpp in Sources */,
-				F762CAFF1EACB66200B38484 /* XLFormPickerCell.m in Sources */,
 				F7A321AD1E9E6AD50069AD1B /* CCAdvanced.m in Sources */,
 				F73CC0781E813DFF006E3047 /* BKShiftingView.m in Sources */,
 				F7A3218C1E9E42B30069AD1B /* CCMenuAccount.m in Sources */,
-				F762CB191EACB66200B38484 /* XLFormValidator.m in Sources */,
-				F762CB0D1EACB66200B38484 /* NSArray+XLFormAdditions.m in Sources */,
 				F77B0E4F1D118A16002130FE /* CCManageAutoUpload.m in Sources */,
 				F7FCFFE01D707B83000E6E29 /* CCPeekPop.m in Sources */,
 				F7BAADC81ED5A87C00B7EAD4 /* NCDatabase.swift in Sources */,
 				F70022E61EC4C9100080073F /* OCXMLServerErrorsParser.m in Sources */,
 				F75C0C4823D1FAE300163CC8 /* NCRichWorkspaceCommon.swift in Sources */,
-				F762CB171EACB66200B38484 /* XLFormRegexValidator.m in Sources */,
 				F73CC0691E813DFF006E3047 /* BKPasscodeDummyViewController.m in Sources */,
-				F762CB1A1EACB66200B38484 /* XLForm.m in Sources */,
 				F73B4EFC1F470D9100BBEE4B /* LangGreekModel.cpp in Sources */,
-				F762CB051EACB66200B38484 /* XLFormTextFieldCell.m in Sources */,
 				F7B4F1CB1F44356F00B53B42 /* NCUchardet.m in Sources */,
 				F78ACD4A21903F850088454D /* NCTrashListCell.swift in Sources */,
 				F73B4EFB1F470D9100BBEE4B /* LangGermanModel.cpp in Sources */,
 				F73B4F061F470D9100BBEE4B /* nsEscCharsetProber.cpp in Sources */,
 				F73B4EFA1F470D9100BBEE4B /* LangFrenchModel.cpp in Sources */,
 				F7682FE023C36B0500983A04 /* NCMainTabBar.swift in Sources */,
-				F762CAF91EACB66200B38484 /* XLFormCheckCell.m in Sources */,
-				F762CB101EACB66200B38484 /* NSPredicate+XLFormAdditions.m in Sources */,
 				F73CC07E1E813DFF006E3047 /* BKTouchIDSwitchView.m in Sources */,
 				F77B0E5F1D118A16002130FE /* CCSettings.m in Sources */,
 				F78F74362163781100C2ADAD /* NCTrash.swift in Sources */,
@@ -3080,13 +2806,11 @@
 				F7417DB3216CE925007D05F5 /* NCTrashSectionHeaderFooter.swift in Sources */,
 				F7F878AE1FB9E3B900599E4F /* NCEndToEndMetadata.swift in Sources */,
 				F7DBC37C23325E02001A85BA /* NCAppConfigView.swift in Sources */,
-				F762CB141EACB66200B38484 /* XLFormRightImageButton.m in Sources */,
 				F73B4EF81F470D9100BBEE4B /* LangDanishModel.cpp in Sources */,
 				F738143A240FE48D00404AC7 /* NCViewerImageCommon.swift in Sources */,
 				3781B9B023DB2B7E006B4B1D /* AppDelegate+Menu.swift in Sources */,
 				F73B4F051F470D9100BBEE4B /* nsCharSetProber.cpp in Sources */,
 				F77B0E671D118A16002130FE /* Reachability.m in Sources */,
-				F762CB121EACB66200B38484 /* UIView+XLFormAdditions.m in Sources */,
 				F710D1F52405770F00A6033D /* NCViewerPDF.swift in Sources */,
 				F7501C332212E57500FB1415 /* NCMedia.swift in Sources */,
 				F70BFC7420E0FA7D00C67599 /* NCUtility.swift in Sources */,
@@ -3105,15 +2829,12 @@
 				F70022FB1EC4C9100080073F /* NSString+Encode.m in Sources */,
 				F769454422E9F142000A798A /* NCShareUserMenuView.swift in Sources */,
 				F75037511DBFA91A008FB480 /* NSLayoutConstraint+PureLayout.m in Sources */,
-				F762CAFA1EACB66200B38484 /* XLFormDateCell.m in Sources */,
 				F70022B91EC4C9100080073F /* OCCommunication.m in Sources */,
-				F762CB181EACB66200B38484 /* XLFormValidationStatus.m in Sources */,
 				F73B4EF91F470D9100BBEE4B /* LangEsperantoModel.cpp in Sources */,
 				F77B0E8F1D118A16002130FE /* CCSection.m in Sources */,
 				F7CA1ED720E7E3FE002CC65E /* PKDownloadButton.m in Sources */,
 				F77B0E921D118A16002130FE /* CCCellMainTransfer.m in Sources */,
 				F77B0E981D118A16002130FE /* CCManageAccount.m in Sources */,
-				F762CB011EACB66200B38484 /* XLFormSelectorCell.m in Sources */,
 				F755BD9B20594AC7008C5FBB /* NCService.swift in Sources */,
 				F77B0E9B1D118A16002130FE /* CCBKPasscode.m in Sources */,
 				F7169A1D1EE590930086BD69 /* NCSharesCell.m in Sources */,
@@ -3129,15 +2850,11 @@
 				F73B4F001F470D9100BBEE4B /* LangSpanishModel.cpp in Sources */,
 				F70022BC1EC4C9100080073F /* OCExternalSites.m in Sources */,
 				F73CC07B1E813DFF006E3047 /* BKTouchIDManager.m in Sources */,
-				F762CB031EACB66200B38484 /* XLFormStepCounterCell.m in Sources */,
-				F762CAF71EACB66200B38484 /* XLFormBaseCell.m in Sources */,
 				F70006FC2416500B00F214A5 /* NCViewerImageVideo.swift in Sources */,
 				F710D1FF24057E5E00A6033D /* NCActionSheetHeaderView.swift in Sources */,
 				F70022B31EC4C9100080073F /* OCActivity.m in Sources */,
 				F7E09CE723E308AD00FB3E9E /* NCMasterNavigationController.swift in Sources */,
 				F70022D41EC4C9100080073F /* NSDate+ISO8601.m in Sources */,
-				F762CB151EACB66200B38484 /* XLFormRowNavigationAccessoryView.m in Sources */,
-				F762CB0A1EACB66200B38484 /* XLFormDescriptor.m in Sources */,
 				F79018B6240962C7007C9B6D /* NCViewerImageDismissAnimationController.swift in Sources */,
 				F7020FCE2233D7F700B7297D /* NCCreateFormUploadVoiceNote.swift in Sources */,
 				F7F4B1D823C74B3E00D82A6E /* NCRichWorkspace.swift in Sources */,
@@ -3149,8 +2866,6 @@
 				F710D1F924057C9D00A6033D /* NCDetailViewController.swift in Sources */,
 				F7AE00F5230D5F9E007ACF8A /* NCLoginWeb.swift in Sources */,
 				F73B4F0C1F470D9100BBEE4B /* nsHebrewProber.cpp in Sources */,
-				F762CAFB1EACB66200B38484 /* XLFormDatePickerCell.m in Sources */,
-				F762CB0F1EACB66200B38484 /* NSObject+XLFormAdditions.m in Sources */,
 				F7B2DEF01F976854007CF4D2 /* NYMnemonic.m in Sources */,
 				F707C26521A2DC5200F6181E /* NCStoreReview.swift in Sources */,
 				F73B4EFF1F470D9100BBEE4B /* LangRussianModel.cpp in Sources */,
@@ -3162,20 +2877,16 @@
 				F73B4F031F470D9100BBEE4B /* LangVietnameseModel.cpp in Sources */,
 				F73B4F021F470D9100BBEE4B /* LangTurkishModel.cpp in Sources */,
 				F7CA1ED220E7E3FE002CC65E /* PKCircleView.m in Sources */,
-				F762CB0B1EACB66200B38484 /* XLFormRowDescriptor.m in Sources */,
 				F745B253222D88AE00346520 /* NCLoginQRCode.swift in Sources */,
 				F7169A1C1EE590930086BD69 /* NCShares.m in Sources */,
 				F769454822E9F20D000A798A /* NCShareNetworking.swift in Sources */,
 				F77B0EC61D118A16002130FE /* CCCellMain.m in Sources */,
 				F7C9555521F0C5470024296E /* NCActivity.swift in Sources */,
 				F70022B61EC4C9100080073F /* OCCapabilities.m in Sources */,
-				F762CB131EACB66200B38484 /* XLFormRightDetailCell.m in Sources */,
 				F7CA1ED820E7E3FE002CC65E /* PKBorderedButton.m in Sources */,
 				F704B5E52430AA8000632F5F /* NCCreateFormUploadConflict.swift in Sources */,
 				F73B4F0A1F470D9100BBEE4B /* nsEUCTWProber.cpp in Sources */,
 				F765608F23BF813600765969 /* NCContentPresenter.swift in Sources */,
-				F762CB091EACB66200B38484 /* XLFormViewController.m in Sources */,
-				F762CB161EACB66200B38484 /* XLFormTextView.m in Sources */,
 				F70CEF5623E9C7E50007035B /* UIColor+adjust.swift in Sources */,
 				F75AC2431F1F62450073EC19 /* NCManageAutoUploadFileName.swift in Sources */,
 				F79630EE215527D40015EEA5 /* NCViewerVideo.swift in Sources */,

+ 0 - 50
iOSClient/Library/XLForm/XL/Cell/XLFormBaseCell.h

@@ -1,50 +0,0 @@
-//
-//  XLFormBaseCell.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 "XLFormDescriptorCell.h"
-#import "XLFormViewController.h"
-#import <UIKit/UIKit.h>
-
-@class XLFormViewController;
-@class XLFormRowDescriptor;
-
-
-@interface XLFormBaseCell : UITableViewCell<XLFormDescriptorCell>
-
-@property (nonatomic, weak) XLFormRowDescriptor * rowDescriptor;
-
--(XLFormViewController *)formViewController;
-
-@end
-
-
-@protocol XLFormReturnKeyProtocol
-
-@property UIReturnKeyType returnKeyType;
-@property UIReturnKeyType nextReturnKeyType;
-
-@end
-
-

+ 0 - 112
iOSClient/Library/XLForm/XL/Cell/XLFormBaseCell.m

@@ -1,112 +0,0 @@
-//
-//  XLFormBaseCell.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 "XLFormBaseCell.h"
-
-@implementation XLFormBaseCell
-
-- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
-{
-    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
-    if (self) {
-        [self configure];
-    }
-    return self;
-}
-
-- (void)awakeFromNib
-{
-    [super awakeFromNib];
-    [self configure];
-}
-
-- (void)configure
-{
-}
-
-- (void)update
-{
-    self.textLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
-    self.detailTextLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
-    self.textLabel.textColor  = self.rowDescriptor.isDisabled ? [UIColor grayColor] : [UIColor blackColor];
-}
-
--(void)highlight
-{
-}
-
--(void)unhighlight
-{
-}
-
--(XLFormViewController *)formViewController
-{
-    id responder = self;
-    while (responder){
-        if ([responder isKindOfClass:[XLFormViewController class]]){
-            return responder;
-        }
-        responder = [responder nextResponder];
-    }
-    return nil;
-}
-
-#pragma mark - Navigation Between Fields
-
--(UIView *)inputAccessoryView
-{
-    UIView * inputAccessoryView = [self.formViewController inputAccessoryViewForRowDescriptor:self.rowDescriptor];
-    if (inputAccessoryView){
-        return inputAccessoryView;
-    }
-    return [super inputAccessoryView];
-}
-
--(BOOL)formDescriptorCellCanBecomeFirstResponder
-{
-    return NO;
-}
-
-#pragma mark -
-
--(BOOL)becomeFirstResponder
-{
-    BOOL result = [super becomeFirstResponder];
-    if (result){
-        [self.formViewController beginEditing:self.rowDescriptor];
-    }
-    return result;
-}
-
--(BOOL)resignFirstResponder
-{
-    BOOL result = [super resignFirstResponder];
-    if (result){
-        [self.formViewController endEditing:self.rowDescriptor];
-    }
-    return result;
-}
-
-@end

+ 0 - 31
iOSClient/Library/XLForm/XL/Cell/XLFormButtonCell.h

@@ -1,31 +0,0 @@
-//
-//  XLFormButtonCell.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 "XLFormBaseCell.h"
-#import <UIKit/UIKit.h>
-
-@interface XLFormButtonCell : XLFormBaseCell
-
-@end

+ 0 - 132
iOSClient/Library/XLForm/XL/Cell/XLFormButtonCell.m

@@ -1,132 +0,0 @@
-//
-//  XLFormButtonCell.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 "XLFormRowDescriptor.h"
-#import "XLFormButtonCell.h"
-
-@implementation XLFormButtonCell
-
-- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
-{
-    return [super initWithStyle:style reuseIdentifier:reuseIdentifier];
-}
-
-
-#pragma mark - XLFormDescriptorCell
-
--(void)configure
-{
-    [super configure];
-}
-
--(void)update
-{
-    [super update];
-    BOOL isDisabled = self.rowDescriptor.isDisabled;
-    self.textLabel.text = self.rowDescriptor.title;
-    BOOL simpleAction = !(self.rowDescriptor.action.viewControllerClass || [self.rowDescriptor.action.viewControllerStoryboardId length] != 0 || [self.rowDescriptor.action.viewControllerNibName length] != 0 || [self.rowDescriptor.action.formSegueIdentifier length] != 0 || self.rowDescriptor.action.formSegueClass);
-    self.textLabel.textAlignment = !simpleAction ? NSTextAlignmentNatural : NSTextAlignmentCenter;
-    self.accessoryType = simpleAction || isDisabled ? UITableViewCellAccessoryNone : UITableViewCellAccessoryDisclosureIndicator;
-    self.editingAccessoryType = self.accessoryType;
-    self.selectionStyle = isDisabled ? UITableViewCellSelectionStyleNone : UITableViewCellSelectionStyleDefault;
-    
-    if (simpleAction){
-        CGFloat red, green, blue, alpha;
-        [self.tintColor getRed:&red green:&green blue:&blue alpha:&alpha];
-        self.textLabel.textColor  = [UIColor colorWithRed:red green:green blue:blue alpha:(isDisabled ? 0.3 : 1.0)];
-    }
-
-    self.detailTextLabel.text = self.rowDescriptor.value;
-}
-
-
--(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller
-{
-    if (self.rowDescriptor.action.formBlock){
-        self.rowDescriptor.action.formBlock(self.rowDescriptor);
-    }
-    else if (self.rowDescriptor.action.formSelector){
-        [controller performFormSelector:self.rowDescriptor.action.formSelector withObject:self.rowDescriptor];
-    }
-    else if ([self.rowDescriptor.action.formSegueIdentifier length] != 0){
-        [controller performSegueWithIdentifier:self.rowDescriptor.action.formSegueIdentifier sender:self.rowDescriptor];
-    }
-    else if (self.rowDescriptor.action.formSegueClass){
-        UIViewController * controllerToPresent = [self controllerToPresent];
-        NSAssert(controllerToPresent, @"either rowDescriptor.action.viewControllerClass or rowDescriptor.action.viewControllerStoryboardId or rowDescriptor.action.viewControllerNibName must be assigned");
-        UIStoryboardSegue * segue = [[self.rowDescriptor.action.formSegueClass alloc] initWithIdentifier:self.rowDescriptor.tag source:controller destination:controllerToPresent];
-        [controller prepareForSegue:segue sender:self.rowDescriptor];
-        [segue perform];
-    }
-    else{
-        UIViewController * controllerToPresent = [self controllerToPresent];
-        if (controllerToPresent){
-            if ([controllerToPresent conformsToProtocol:@protocol(XLFormRowDescriptorViewController)]){
-                ((UIViewController<XLFormRowDescriptorViewController> *)controllerToPresent).rowDescriptor = self.rowDescriptor;
-            }
-            if (controller.navigationController == nil || [controllerToPresent isKindOfClass:[UINavigationController class]] || self.rowDescriptor.action.viewControllerPresentationMode == XLFormPresentationModePresent){
-                [controller presentViewController:controllerToPresent animated:YES completion:nil];
-            }
-            else{
-                [controller.navigationController pushViewController:controllerToPresent animated:YES];
-            }
-        }
-        
-    }
-}
-
-
-#pragma mark - Helpers
-
--(UIViewController *)controllerToPresent
-{
-    if (self.rowDescriptor.action.viewControllerClass){
-        return [[self.rowDescriptor.action.viewControllerClass alloc] init];
-    }
-    else if ([self.rowDescriptor.action.viewControllerStoryboardId length] != 0){
-        UIStoryboard * storyboard =  [self storyboardToPresent];
-        NSAssert(storyboard != nil, @"You must provide a storyboard when rowDescriptor.action.viewControllerStoryboardId is used");
-        return [storyboard instantiateViewControllerWithIdentifier:self.rowDescriptor.action.viewControllerStoryboardId];
-    }
-    else if ([self.rowDescriptor.action.viewControllerNibName length] != 0){
-        Class viewControllerClass = NSClassFromString(self.rowDescriptor.action.viewControllerNibName);
-        NSAssert(viewControllerClass, @"class owner of self.rowDescriptor.action.viewControllerNibName must be equal to %@", self.rowDescriptor.action.viewControllerNibName);
-        return [[viewControllerClass alloc] initWithNibName:self.rowDescriptor.action.viewControllerNibName bundle:nil];
-    }
-    return nil;
-}
-
--(UIStoryboard *)storyboardToPresent
-{
-    if ([self.formViewController respondsToSelector:@selector(storyboardForRow:)]){
-        return [self.formViewController storyboardForRow:self.rowDescriptor];
-    }
-    if (self.formViewController.storyboard){
-        return self.formViewController.storyboard;
-    }
-    return nil;
-}
-
-@end

+ 0 - 30
iOSClient/Library/XLForm/XL/Cell/XLFormCheckCell.h

@@ -1,30 +0,0 @@
-//
-//  XLFormCheckCell.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 "XLFormBaseCell.h"
-
-@interface XLFormCheckCell : XLFormBaseCell
-
-@end

+ 0 - 65
iOSClient/Library/XLForm/XL/Cell/XLFormCheckCell.m

@@ -1,65 +0,0 @@
-//
-//  XLFormCheckCell.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 "XLFormCheckCell.h"
-
-@implementation XLFormCheckCell
-
-#pragma mark - XLFormDescriptorCell
-
-- (void)configure
-{
-    [super configure];
-    self.accessoryType = UITableViewCellAccessoryCheckmark;
-    self.editingAccessoryType = self.accessoryType;
-}
-
-- (void)update
-{
-    [super update];
-    self.textLabel.text = self.rowDescriptor.title;
-    self.accessoryType = [self.rowDescriptor.value boolValue] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
-    self.editingAccessoryType =  self.accessoryType;
-    CGFloat red, green, blue, alpha;
-    [self.tintColor getRed:&red green:&green blue:&blue alpha:&alpha];
-    self.selectionStyle = UITableViewCellSelectionStyleDefault;
-    if (self.rowDescriptor.isDisabled){
-        [self setTintColor:[UIColor colorWithRed:red green:green blue:blue alpha:0.3]];
-        self.selectionStyle = UITableViewCellSelectionStyleNone;
-    }
-    else{
-        [self setTintColor:[UIColor colorWithRed:red green:green blue:blue alpha:1]];
-    }
-}
-//
-
--(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller
-{
-    self.rowDescriptor.value = [NSNumber numberWithBool:![self.rowDescriptor.value boolValue]];
-    [self.formViewController updateFormRow:self.rowDescriptor];
-    [controller.tableView deselectRowAtIndexPath:[controller.form indexPathOfFormRow:self.rowDescriptor] animated:YES];
-}
-
-@end

+ 0 - 43
iOSClient/Library/XLForm/XL/Cell/XLFormDateCell.h

@@ -1,43 +0,0 @@
-//
-//  XLFormDateCell.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 "XLFormBaseCell.h"
-
-typedef NS_ENUM(NSUInteger, XLFormDateDatePickerMode) {
-    XLFormDateDatePickerModeGetFromRowDescriptor,
-    XLFormDateDatePickerModeDate,
-    XLFormDateDatePickerModeDateTime,
-    XLFormDateDatePickerModeTime
-};
-
-@interface XLFormDateCell : XLFormBaseCell
-
-@property (nonatomic) XLFormDateDatePickerMode formDatePickerMode;
-@property (nonatomic) NSDate *minimumDate;
-@property (nonatomic) NSDate *maximumDate;
-@property (nonatomic) NSInteger minuteInterval;
-@property (nonatomic) NSLocale *locale;
-
-@end

+ 0 - 270
iOSClient/Library/XLForm/XL/Cell/XLFormDateCell.m

@@ -1,270 +0,0 @@
-//
-//  XLFormDateCell.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 "XLForm.h"
-#import "XLFormRowDescriptor.h"
-#import "XLFormDateCell.h"
-
-@interface XLFormDateCell()
-
-@property (nonatomic) UIDatePicker *datePicker;
-
-@end
-
-@implementation XLFormDateCell
-{
-    UIColor * _beforeChangeColor;
-    NSDateFormatter *_dateFormatter;
-}
-
-
-- (UIView *)inputView
-{
-    if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDate] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeTime] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDateTime] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeCountDownTimer]){
-        if (self.rowDescriptor.value){
-            [self.datePicker setDate:self.rowDescriptor.value animated:[self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeCountDownTimer]];
-        }
-        [self setModeToDatePicker:self.datePicker];
-        return self.datePicker;
-    }
-    return [super inputView];
-}
-
-- (BOOL)canBecomeFirstResponder
-{
-    return !self.rowDescriptor.isDisabled;
-}
-
--(BOOL)becomeFirstResponder
-{
-    if (self.isFirstResponder){
-        return [super becomeFirstResponder];
-    }
-    _beforeChangeColor = self.detailTextLabel.textColor;
-    BOOL result = [super becomeFirstResponder];
-    if (result){
-        if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDateInline] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeTimeInline] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDateTimeInline] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeCountDownTimerInline])
-        {
-            NSIndexPath * selectedRowPath = [self.formViewController.form indexPathOfFormRow:self.rowDescriptor];
-            NSIndexPath * nextRowPath = [NSIndexPath indexPathForRow:(selectedRowPath.row + 1) inSection:selectedRowPath.section];
-            XLFormSectionDescriptor * formSection = [self.formViewController.form.formSections objectAtIndex:nextRowPath.section];
-            XLFormRowDescriptor * datePickerRowDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeDatePicker];
-            XLFormDatePickerCell * datePickerCell = (XLFormDatePickerCell *)[datePickerRowDescriptor cellForFormController:self.formViewController];
-            [self setModeToDatePicker:datePickerCell.datePicker];
-            if (self.rowDescriptor.value){                
-                [datePickerCell.datePicker setDate:self.rowDescriptor.value animated:[self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeCountDownTimerInline]];
-            }
-            NSAssert([datePickerCell conformsToProtocol:@protocol(XLFormInlineRowDescriptorCell)], @"inline cell must conform to XLFormInlineRowDescriptorCell");
-            UITableViewCell<XLFormInlineRowDescriptorCell> * inlineCell = (UITableViewCell<XLFormInlineRowDescriptorCell> *)datePickerCell;
-            inlineCell.inlineRowDescriptor = self.rowDescriptor;
-            
-            [formSection addFormRow:datePickerRowDescriptor afterRow:self.rowDescriptor];
-            [self.formViewController ensureRowIsVisible:datePickerRowDescriptor];
-        }
-    }
-    return result;
-}
-
--(BOOL)resignFirstResponder
-{
-    if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDateInline] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeTimeInline] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDateTimeInline] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeCountDownTimerInline])
-    {
-        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];
-        BOOL result = [super resignFirstResponder];
-        if ([nextFormRow.rowType isEqualToString:XLFormRowDescriptorTypeDatePicker]){
-            [self.rowDescriptor.sectionDescriptor removeFormRow:nextFormRow];
-        }
-        return result;
-    }
-    return [super resignFirstResponder];
-}
-
-#pragma mark - XLFormDescriptorCell
-
--(void)configure
-{
-    [super configure];
-    self.formDatePickerMode = XLFormDateDatePickerModeGetFromRowDescriptor;
-    _dateFormatter = [[NSDateFormatter alloc] init];
-}
-
--(void)update
-{
-    [super update];
-    self.accessoryType =  UITableViewCellAccessoryNone;
-    self.editingAccessoryType =  UITableViewCellAccessoryNone;
-    [self.textLabel setText:self.rowDescriptor.title];
-    self.selectionStyle = self.rowDescriptor.isDisabled ? UITableViewCellSelectionStyleNone : UITableViewCellSelectionStyleDefault;
-    self.textLabel.text = [NSString stringWithFormat:@"%@%@", self.rowDescriptor.title, self.rowDescriptor.required && self.rowDescriptor.sectionDescriptor.formDescriptor.addAsteriskToRequiredRowsTitle ? @"*" : @""];
-    self.detailTextLabel.text = [self valueDisplayText];
-}
-
--(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller
-{
-    [self.formViewController.tableView deselectRowAtIndexPath:[controller.form indexPathOfFormRow:self.rowDescriptor] animated:YES];
-}
-
--(BOOL)formDescriptorCellCanBecomeFirstResponder
-{
-    return [self canBecomeFirstResponder];
-}
-
--(BOOL)formDescriptorCellBecomeFirstResponder
-{
-    if ([self isFirstResponder]){
-        return [self resignFirstResponder];
-    }
-    return [self becomeFirstResponder];
-
-}
-
--(void)highlight
-{
-    [super highlight];
-    self.detailTextLabel.textColor = self.tintColor;
-}
-
--(void)unhighlight
-{
-    [super unhighlight];
-    self.detailTextLabel.textColor = _beforeChangeColor;
-}
-
-
-#pragma mark - helpers
-
--(NSString *)valueDisplayText
-{
-    return self.rowDescriptor.value ? [self formattedDate:self.rowDescriptor.value] : self.rowDescriptor.noValueDisplayText;
-}
-
-
-- (NSString *)formattedDate:(NSDate *)date
-{
-    if (self.rowDescriptor.valueTransformer){
-        NSAssert([self.rowDescriptor.valueTransformer isSubclassOfClass:[NSValueTransformer class]], @"valueTransformer is not a subclass of NSValueTransformer");
-        NSValueTransformer * valueTransformer = [self.rowDescriptor.valueTransformer new];
-        NSString * tranformedValue = [valueTransformer transformedValue:self.rowDescriptor.value];
-        if (tranformedValue){
-            return tranformedValue;
-        }
-    }
-    if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDate] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDateInline]){
-        _dateFormatter.dateStyle = NSDateFormatterMediumStyle;
-        _dateFormatter.timeStyle = NSDateFormatterNoStyle;
-        return [_dateFormatter stringFromDate:date];
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeTime] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeTimeInline]){
-        _dateFormatter.dateStyle = NSDateFormatterNoStyle;
-        _dateFormatter.timeStyle = NSDateFormatterShortStyle;
-        return [_dateFormatter stringFromDate:date];
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeCountDownTimer] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeCountDownTimerInline]){
-        NSCalendar *calendar = [NSCalendar currentCalendar];
-        [calendar setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
-        NSDateComponents *time = [calendar components:NSCalendarUnitHour | NSCalendarUnitMinute fromDate:date];
-        return [NSString stringWithFormat:@"%ld%@ %ldmin", (long)[time hour], (long)[time hour] == 1 ? @"hour" : @"hours", (long)[time minute]];
-    }
-    _dateFormatter.dateStyle = NSDateFormatterShortStyle;
-    _dateFormatter.timeStyle = NSDateFormatterShortStyle;
-    return [_dateFormatter stringFromDate:date];
-}
-
--(void)setModeToDatePicker:(UIDatePicker *)datePicker
-{
-    if ((([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDateInline] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDate]) && self.formDatePickerMode == XLFormDateDatePickerModeGetFromRowDescriptor) || self.formDatePickerMode == XLFormDateDatePickerModeDate){
-        datePicker.datePickerMode = UIDatePickerModeDate;
-    }
-    else if ((([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeTimeInline] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeTime]) && self.formDatePickerMode == XLFormDateDatePickerModeGetFromRowDescriptor) || self.formDatePickerMode == XLFormDateDatePickerModeTime){
-        datePicker.datePickerMode = UIDatePickerModeTime;
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeCountDownTimer] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeCountDownTimerInline]){
-        datePicker.datePickerMode = UIDatePickerModeCountDownTimer;
-        datePicker.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0];
-    }
-    else{
-        datePicker.datePickerMode = UIDatePickerModeDateAndTime;
-    }
-    
-    if (self.minuteInterval)
-        datePicker.minuteInterval = self.minuteInterval;
-    
-    if (self.minimumDate)
-        datePicker.minimumDate = self.minimumDate;
-    
-    if (self.maximumDate)
-        datePicker.maximumDate = self.maximumDate;
-    
-    if (self.locale) {
-        datePicker.locale = self.locale;
-    }
-}
-
-#pragma mark - Properties
-
--(UIDatePicker *)datePicker
-{
-    if (_datePicker) return _datePicker;
-    _datePicker = [[UIDatePicker alloc] init];
-    [self setModeToDatePicker:_datePicker];
-    [_datePicker addTarget:self action:@selector(datePickerValueChanged:) forControlEvents:UIControlEventValueChanged];
-    return _datePicker;
-}
-
--(void)setLocale:(NSLocale *)locale
-{
-    _locale = locale;
-    _dateFormatter.locale = locale;
-}
-
-#pragma mark - Target Action
-
-- (void)datePickerValueChanged:(UIDatePicker *)sender
-{
-    self.rowDescriptor.value = sender.date;
-    [self.formViewController updateFormRow:self.rowDescriptor];
-}
-
--(void)setFormDatePickerMode:(XLFormDateDatePickerMode)formDatePickerMode
-{
-    _formDatePickerMode = formDatePickerMode;
-    if ([self isFirstResponder]){
-        if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDateInline] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeTimeInline] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDateTimeInline] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeCountDownTimerInline])
-        {
-            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];
-            if ([nextFormRow.rowType isEqualToString:XLFormRowDescriptorTypeDatePicker]){
-                XLFormDatePickerCell * datePickerCell = (XLFormDatePickerCell *)[nextFormRow cellForFormController:self.formViewController];
-                [self setModeToDatePicker:datePickerCell.datePicker];
-            }
-        }
-    }
-}
-
-@end

+ 0 - 35
iOSClient/Library/XLForm/XL/Cell/XLFormDatePickerCell.h

@@ -1,35 +0,0 @@
-//
-//  XLFormDatePickerCell.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 "XLForm.h"
-#import "XLFormBaseCell.h"
-
-#import <UIKit/UIKit.h>
-
-@interface XLFormDatePickerCell : XLFormBaseCell<XLFormInlineRowDescriptorCell>
-
-@property (nonatomic, readonly) UIDatePicker * datePicker;
-
-@end

+ 0 - 86
iOSClient/Library/XLForm/XL/Cell/XLFormDatePickerCell.m

@@ -1,86 +0,0 @@
-//
-//  XLFormDatePickerCell.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 "UIView+XLFormAdditions.h"
-
-#import "XLFormDatePickerCell.h"
-
-@implementation XLFormDatePickerCell
-
-@synthesize datePicker = _datePicker;
-@synthesize inlineRowDescriptor = _inlineRowDescriptor;
-
--(BOOL)canResignFirstResponder
-{
-    return YES;
-}
-
-#pragma mark - Properties
-
--(UIDatePicker *)datePicker
-{
-    if (_datePicker) return _datePicker;
-    _datePicker = [UIDatePicker autolayoutView];
-    [_datePicker addTarget:self action:@selector(datePickerValueChanged:) forControlEvents:UIControlEventValueChanged];
-    return _datePicker;
-}
-
-#pragma mark- Target Action
-
-- (void)datePickerValueChanged:(UIDatePicker *)sender
-{
-    if (self.inlineRowDescriptor){
-        self.inlineRowDescriptor.value = sender.date;
-        [self.formViewController updateFormRow:self.inlineRowDescriptor];
-    }
-    else{
-        [self becomeFirstResponder];
-        self.rowDescriptor.value = sender.date;
-    }
-}
-
-#pragma mark - XLFormDescriptorCell
-
--(void)configure
-{
-    [super configure];
-    [self.contentView addSubview:self.datePicker];
-    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.datePicker attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1 constant:0]];
-    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[datePicker]-0-|" options:0 metrics:0 views:@{@"datePicker" : self.datePicker}]];
-}
-
--(void)update
-{
-    [super update];
-    [self.datePicker setUserInteractionEnabled:![self.rowDescriptor isDisabled]];
-}
-
-
-+(CGFloat)formDescriptorCellHeightForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor
-{
-    return 216.0f;
-}
-
-@end

+ 0 - 53
iOSClient/Library/XLForm/XL/Cell/XLFormDescriptorCell.h

@@ -1,53 +0,0 @@
-//
-//  XLFormDescriptorCell.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 <UIKit/UIKit.h>
-
-
-@class XLFormRowDescriptor;
-@class XLFormViewController;
-
-@protocol XLFormDescriptorCell <NSObject>
-
-@required
-
-@property (nonatomic, weak) XLFormRowDescriptor * rowDescriptor;
--(void)configure;
--(void)update;
-
-@optional
-
-+(CGFloat)formDescriptorCellHeightForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor;
--(BOOL)formDescriptorCellCanBecomeFirstResponder;
--(BOOL)formDescriptorCellBecomeFirstResponder;
--(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller;
--(NSString *)formDescriptorHttpParameterName;
-
-
--(void)highlight;
--(void)unhighlight;
-
-
-@end

+ 0 - 33
iOSClient/Library/XLForm/XL/Cell/XLFormImageCell.h

@@ -1,33 +0,0 @@
-//
-//  XLFormBaseCell.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 "XLFormBaseCell.h"
-
-@interface XLFormImageCell : XLFormBaseCell
-
-@end
-
-
-

+ 0 - 147
iOSClient/Library/XLForm/XL/Cell/XLFormImageCell.m

@@ -1,147 +0,0 @@
-//
-//  XLFormBaseCell.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 "XLFormImageCell.h"
-#import "XLFormRowDescriptor.h"
-#import "UIView+XLFormAdditions.h"
-
-@interface XLFormImageCell() <UIImagePickerControllerDelegate, UINavigationControllerDelegate>
-{
-    UIImagePickerController *imagePickerController;
-    UIAlertController *alertController;
-}
-
-@end
-
-@implementation XLFormImageCell
-
-#pragma mark - XLFormDescriptorCell
-+ (CGFloat)formDescriptorCellHeightForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor
-{
-    return 40;
-}
-
-- (void)configure
-{
-    [super configure];
-    self.selectionStyle = UITableViewCellSelectionStyleNone;
-    self.accessoryView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
-    self.editingAccessoryView = self.accessoryView;
-}
-
-- (void)update
-{
-    [super update];
-    self.textLabel.text = self.rowDescriptor.title;
-    self.imageView.image = self.rowDescriptor.value;
-}
-
-- (void)chooseImage:(UIImage *)image
-{
-    self.imageView.image = image;
-    self.rowDescriptor.value = image;
-}
-
-- (UIImageView *)imageView
-{
-    return (UIImageView *)self.accessoryView;
-}
-
-- (void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller
-{
-    alertController = [UIAlertController alertControllerWithTitle: self.rowDescriptor.title
-                                                          message: nil
-                                                   preferredStyle: UIAlertControllerStyleActionSheet];
-    
-    [alertController addAction:[UIAlertAction actionWithTitle: NSLocalizedString(@"Choose From Library", nil)
-                                                        style: UIAlertActionStyleDefault
-                                                      handler: ^(UIAlertAction * _Nonnull action) {
-                                                          [self openImage:UIImagePickerControllerSourceTypePhotoLibrary];
-                                                      }]];
-    
-    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
-        [alertController addAction:[UIAlertAction actionWithTitle: NSLocalizedString(@"Take Photo", nil)
-                                                            style: UIAlertActionStyleDefault
-                                                          handler: ^(UIAlertAction * _Nonnull action) {
-                                                              [self openImage:UIImagePickerControllerSourceTypeCamera];
-                                                          }]];
-    }
-    
-    [alertController addAction:[UIAlertAction actionWithTitle: NSLocalizedString(@"Cancel", nil)
-                                                        style: UIAlertActionStyleCancel
-                                                      handler: nil]];
-
-    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
-        alertController.modalPresentationStyle = UIModalPresentationPopover;
-        alertController.popoverPresentationController.sourceView = self.contentView;
-        alertController.popoverPresentationController.sourceRect = self.contentView.bounds;
-    }
-    
-    dispatch_async(dispatch_get_main_queue(), ^{
-        [self.formViewController presentViewController:alertController animated: true completion: nil];
-    });
-}
-
-- (void)openImage:(UIImagePickerControllerSourceType)source
-{
-    imagePickerController = [[UIImagePickerController alloc] init];
-    imagePickerController.delegate = self;
-    imagePickerController.allowsEditing = YES;
-    imagePickerController.sourceType = source;
-    
-    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
-        imagePickerController.modalPresentationStyle = UIModalPresentationPopover;
-        imagePickerController.popoverPresentationController.sourceRect = self.contentView.frame;
-        imagePickerController.popoverPresentationController.sourceView = self.formViewController.view;
-        imagePickerController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
-    }
-    
-    [self.formViewController presentViewController: imagePickerController
-                                          animated: YES
-                                        completion: nil];
-}
-
-#pragma mark -  UIImagePickerControllerDelegate
-- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info
-{
-    UIImage *editedImage = info[UIImagePickerControllerEditedImage];
-    UIImage *originalImage = info[UIImagePickerControllerOriginalImage];
-    
-    if (editedImage) {
-        [self chooseImage:editedImage];
-    } else {
-        [self chooseImage:originalImage];
-    }
-    
-    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
-        if (self.formViewController.presentedViewController && self.formViewController.presentedViewController.modalPresentationStyle == UIModalPresentationPopover) {
-            [self.formViewController dismissViewControllerAnimated:YES completion:nil];
-        }
-    } else {
-        [self.formViewController dismissViewControllerAnimated: YES completion: nil];
-    }
-}
-
-@end

+ 0 - 32
iOSClient/Library/XLForm/XL/Cell/XLFormInlineRowDescriptorCell.h

@@ -1,32 +0,0 @@
-//
-//  XLFormInlineRowDescriptorCell.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>
-
-@protocol XLFormInlineRowDescriptorCell <XLFormDescriptorCell>
-
-@property (nonatomic, weak) XLFormRowDescriptor * inlineRowDescriptor;
-
-@end

+ 0 - 30
iOSClient/Library/XLForm/XL/Cell/XLFormInlineSelectorCell.h

@@ -1,30 +0,0 @@
-//
-//  XLFormInlineSelectorCell.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 "XLFormBaseCell.h"
-
-@interface XLFormInlineSelectorCell : XLFormBaseCell
-
-@end

+ 0 - 180
iOSClient/Library/XLForm/XL/Cell/XLFormInlineSelectorCell.m

@@ -1,180 +0,0 @@
-//
-//  XLFormInlineSelectorCell.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 "XLForm.h"
-#import "XLFormInlineSelectorCell.h"
-
-@interface XLFormInlineSelectorCell()
-
-@end
-
-@implementation XLFormInlineSelectorCell
-{
-    UIColor * _beforeChangeColor;
-}
-
-- (BOOL)canBecomeFirstResponder
-{
-    return YES;
-}
-
--(BOOL)becomeFirstResponder
-{
-    if (self.isFirstResponder){
-        return [super becomeFirstResponder];
-    }
-    _beforeChangeColor = self.detailTextLabel.textColor;
-    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 = self.rowDescriptor.isDisabled ? UITableViewCellSelectionStyleNone : UITableViewCellSelectionStyleDefault;
-    self.textLabel.text = [NSString stringWithFormat:@"%@%@", self.rowDescriptor.title, self.rowDescriptor.required && self.rowDescriptor.sectionDescriptor.formDescriptor.addAsteriskToRequiredRowsTitle ? @"*" : @""];
-    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];
-}
-
--(void)highlight
-{
-    [super highlight];
-    self.detailTextLabel.textColor = self.tintColor;
-}
-
--(void)unhighlight
-{
-    [super unhighlight];
-    self.detailTextLabel.textColor = _beforeChangeColor;
-}
-
-#pragma mark - Helpers
-
--(NSString *)valueDisplayText
-{
-	if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelector] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelectorPopover]){
-		if (!self.rowDescriptor.value || [self.rowDescriptor.value count] == 0){
-			return self.rowDescriptor.noValueDisplayText;
-		}
-		if (self.rowDescriptor.valueTransformer){
-			NSAssert([self.rowDescriptor.valueTransformer isSubclassOfClass:[NSValueTransformer class]], @"valueTransformer is not a subclass of NSValueTransformer");
-			NSValueTransformer * valueTransformer = [self.rowDescriptor.valueTransformer new];
-			NSString * tranformedValue = [valueTransformer transformedValue:self.rowDescriptor.value];
-			if (tranformedValue){
-				return tranformedValue;
-			}
-		}
-		NSMutableArray * descriptionArray = [NSMutableArray arrayWithCapacity:[self.rowDescriptor.value count]];
-		for (id option in self.rowDescriptor.selectorOptions) {
-			NSArray * selectedValues = self.rowDescriptor.value;
-			if ([selectedValues formIndexForItem:option] != NSNotFound){
-				if (self.rowDescriptor.valueTransformer){
-					NSAssert([self.rowDescriptor.valueTransformer isSubclassOfClass:[NSValueTransformer class]], @"valueTransformer is not a subclass of NSValueTransformer");
-					NSValueTransformer * valueTransformer = [self.rowDescriptor.valueTransformer new];
-					NSString * tranformedValue = [valueTransformer transformedValue:option];
-					if (tranformedValue){
-						[descriptionArray addObject:tranformedValue];
-					}
-				}
-				else{
-					[descriptionArray addObject:[option displayText]];
-				}
-			}
-		}
-		return [descriptionArray componentsJoinedByString:@", "];
-	}
-	if (!self.rowDescriptor.value){
-		return self.rowDescriptor.noValueDisplayText;
-	}
-	if (self.rowDescriptor.valueTransformer){
-		NSAssert([self.rowDescriptor.valueTransformer isSubclassOfClass:[NSValueTransformer class]], @"valueTransformer is not a subclass of NSValueTransformer");
-		NSValueTransformer * valueTransformer = [self.rowDescriptor.valueTransformer new];
-		NSString * tranformedValue = [valueTransformer transformedValue:self.rowDescriptor.value];
-		if (tranformedValue){
-			return tranformedValue;
-		}
-	}
-	return [self.rowDescriptor.value displayText];
-}
-
-
-
-@end

+ 0 - 35
iOSClient/Library/XLForm/XL/Cell/XLFormLeftRightSelectorCell.h

@@ -1,35 +0,0 @@
-//
-//  XLFormLeftRightSelectorCell.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 "XLForm.h"
-#import <UIKit/UIKit.h>
-
-
-@interface XLFormLeftRightSelectorCell : XLFormBaseCell
-
-@property (nonatomic, readonly) UIButton * leftButton;
-@property (nonatomic, readonly) UILabel * rightLabel;
-
-@end

+ 0 - 213
iOSClient/Library/XLForm/XL/Cell/XLFormLeftRightSelectorCell.m

@@ -1,213 +0,0 @@
-//
-//  XLFormLeftRightSelectorCell.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 "UIView+XLFormAdditions.h"
-#import "XLFormRightImageButton.h"
-#import "NSObject+XLFormAdditions.h"
-#import "XLFormLeftRightSelectorCell.h"
-
-@implementation XLFormLeftRightSelectorCell
-{
-    UITextField * _constraintTextField;
-}
-
-
-@synthesize leftButton = _leftButton;
-@synthesize rightLabel = _rightLabel;
-
-
-#pragma mark - Properties
-
--(UIButton *)leftButton
-{
-    if (_leftButton) return _leftButton;
-    _leftButton = [[XLFormRightImageButton alloc] init];
-    [_leftButton setTranslatesAutoresizingMaskIntoConstraints:NO];
-    UIImageView * imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"XLForm.bundle/forwardarrow.png"]];
-    [imageView setTranslatesAutoresizingMaskIntoConstraints:NO];
-    [_leftButton addSubview:imageView];
-    [_leftButton addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[image(8)]|" options:0 metrics:0 views:@{@"image": imageView}]];
-    
-    UIView * separatorTop = [UIView autolayoutView];
-    UIView * separatorBottom = [UIView autolayoutView];
-    [_leftButton addSubview:separatorTop];
-    [_leftButton addSubview:separatorBottom];
-    [_leftButton addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[separatorTop(separatorBottom)][image][separatorBottom]|" options:0 metrics:0 views:@{@"image": imageView, @"separatorTop": separatorTop, @"separatorBottom": separatorBottom}]];
-    _leftButton.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 15);
-    
-    [_leftButton setTitleColor:[UIColor colorWithRed:0.0 green:0.478431 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
-    [_leftButton setTitleColor:[UIColor grayColor] forState:UIControlStateDisabled];
-    [_leftButton setContentHuggingPriority:500 forAxis:UILayoutConstraintAxisHorizontal];
-
-    return _leftButton;
-}
-
--(UILabel *)rightLabel
-{
-    if (_rightLabel) return _rightLabel;
-    _rightLabel = [UILabel autolayoutView];
-    [_rightLabel setTextColor:[UIColor grayColor]];
-    [_rightLabel setTextAlignment:NSTextAlignmentRight];
-    return _rightLabel;
-}
-
-
--(XLFormLeftRightSelectorOption *)leftOptionForDescription:(NSString *)description
-{
-    if (description){
-        return [[self.rowDescriptor.selectorOptions filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
-            return ([description isEqual:[((XLFormLeftRightSelectorOption *)evaluatedObject).leftValue displayText]]);
-        }]] firstObject];
-    }
-    @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"" userInfo:nil];
-}
-
--(XLFormLeftRightSelectorOption *)leftOptionForOption:(id)option
-{
-    if (option){
-        return [[self.rowDescriptor.selectorOptions filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
-            XLFormLeftRightSelectorOption * evaluatedLeftOption = (XLFormLeftRightSelectorOption *)evaluatedObject;
-            return [evaluatedLeftOption.leftValue isEqual:option];
-        }]] firstObject];
-    }
-    @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"" userInfo:nil];
-}
-
-
-
-
-#pragma mark - XLFormDescriptorCell
-
--(void)configure
-{
-    [super configure];
-    UIView * separatorView = [UIView autolayoutView];
-    _constraintTextField = [UITextField autolayoutView];
-    [_constraintTextField setText:@"Option"];
-    _constraintTextField.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
-    [separatorView setBackgroundColor:[UIColor colorWithWhite:0.85 alpha:1.0]];
-    [self.contentView addSubview:_constraintTextField];
-    [_constraintTextField setHidden:YES];
-    [self.contentView addSubview:self.leftButton];
-    [self.contentView addSubview:self.rightLabel];
-    [self.contentView addSubview:separatorView];
-    [self.leftButton addTarget:self action:@selector(leftButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
-    
-    NSDictionary * views = @{@"leftButton" : self.leftButton, @"rightLabel": self.rightLabel, @"separatorView": separatorView, @"constraintTextField": _constraintTextField };
-    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.leftButton attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterY multiplier:1.0f constant:0.0f]];
-    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[constraintTextField]" options:0 metrics:nil views:views]];
-    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[leftButton]-[separatorView(1)]-[rightLabel]-|" options:NSLayoutFormatAlignAllCenterY metrics:nil views:views]];
-    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[separatorView(20)]" options:0 metrics:nil views:views]];
-    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-12-[constraintTextField]-12-|" options:0 metrics:0 views:views]];
-}
-
--(void)update
-{
-    [super update];
-    self.leftButton.titleLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
-    self.rightLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
-    [self.leftButton setTitle:[NSString stringWithFormat:@"%@%@", [self.rowDescriptor.leftRightSelectorLeftOptionSelected displayText], self.rowDescriptor.required && self.rowDescriptor.sectionDescriptor.formDescriptor.addAsteriskToRequiredRowsTitle ? @"*" : @""] forState:UIControlStateNormal];
-    [self.rowDescriptor setTitle:[self.rowDescriptor.leftRightSelectorLeftOptionSelected displayText]];
-    self.rightLabel.text = [self rightTextLabel];
-    [self.leftButton setEnabled:!self.rowDescriptor.isDisabled];
-    self.accessoryView = self.rowDescriptor.isDisabled ? nil : [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"XLForm.bundle/forwardarrow.png"]];
-    self.editingAccessoryView = self.accessoryView;
-    self.selectionStyle = self.rowDescriptor.isDisabled ? UITableViewCellSelectionStyleNone : UITableViewCellSelectionStyleDefault;
-}
-
-
--(NSString *)rightTextLabel
-{
-    return (self.rowDescriptor.value ? [self.rowDescriptor.value displayText] : (self.rowDescriptor.leftRightSelectorLeftOptionSelected ? [self leftOptionForOption:self.rowDescriptor.leftRightSelectorLeftOptionSelected].noValueDisplayText : @""));
-}
-
-
--(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller
-{
-    if (self.rowDescriptor.leftRightSelectorLeftOptionSelected){
-        XLFormLeftRightSelectorOption * option = [self leftOptionForOption:self.rowDescriptor.leftRightSelectorLeftOptionSelected];
-        if (option.rightOptions){
-            XLFormOptionsViewController * optionsViewController = [[XLFormOptionsViewController alloc]  initWithStyle:UITableViewStyleGrouped];
-            optionsViewController.title = option.selectorTitle;
-            optionsViewController.rowDescriptor = self.rowDescriptor;
-            [controller.navigationController pushViewController:optionsViewController animated:YES];
-        }
-        else{
-            XLFormLeftRightSelectorOption * option = [self leftOptionForOption:self.rowDescriptor.leftRightSelectorLeftOptionSelected];
-            Class selectorClass =  option.rightSelectorControllerClass;
-            UIViewController<XLFormRowDescriptorViewController> *selectorViewController = [[selectorClass alloc] init];
-            selectorViewController.rowDescriptor = self.rowDescriptor;
-            selectorViewController.title = self.rowDescriptor.selectorTitle;
-            [controller.navigationController pushViewController:selectorViewController animated:YES];
-        }
-    }
-}
-
--(NSString *)formDescriptorHttpParameterName
-{
-    XLFormLeftRightSelectorOption * option = [self leftOptionForOption:self.rowDescriptor.leftRightSelectorLeftOptionSelected];
-    return option.httpParameterKey;
-}
-
-- (id) chooseNewRightValueFromOption:(XLFormLeftRightSelectorOption*)option
-{
-    switch (option.leftValueChangePolicy) {
-        case XLFormLeftRightSelectorOptionLeftValueChangePolicyChooseLastOption:
-            return [option.rightOptions lastObject];
-        case XLFormLeftRightSelectorOptionLeftValueChangePolicyChooseFirstOption:
-            return [option.rightOptions firstObject];
-        case XLFormLeftRightSelectorOptionLeftValueChangePolicyNullifyRightValue:
-            return nil;
-    }
-    return nil;
-}
-
-
-#pragma mark - Actions
-
-
--(void)leftButtonPressed:(UIButton *)leftButton
-{
-    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;
-    for (XLFormLeftRightSelectorOption * leftOption in self.rowDescriptor.selectorOptions) {
-        [alertController addAction:[UIAlertAction actionWithTitle:[leftOption.leftValue displayText]
-                                                            style:UIAlertActionStyleDefault
-                                                          handler:^(UIAlertAction *action) {
-                                                              weakSelf.rowDescriptor.value = [self chooseNewRightValueFromOption:leftOption];
-                                                              weakSelf.rowDescriptor.leftRightSelectorLeftOptionSelected = [self leftOptionForDescription:[leftOption.leftValue displayText]].leftValue;
-                                                              [weakSelf.formViewController updateFormRow:weakSelf.rowDescriptor];
-                                                          }]];
-    }
-    
-    [self.formViewController presentViewController:alertController animated:YES completion:nil];
-}
-
-@end

+ 0 - 33
iOSClient/Library/XLForm/XL/Cell/XLFormPickerCell.h

@@ -1,33 +0,0 @@
-//
-//  XLFormPickerCell.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 "XLForm.h"
-#import "XLFormBaseCell.h"
-
-@interface XLFormPickerCell : XLFormBaseCell<XLFormInlineRowDescriptorCell>
-
-@property (nonatomic) UIPickerView * pickerView;
-
-@end

+ 0 - 183
iOSClient/Library/XLForm/XL/Cell/XLFormPickerCell.m

@@ -1,183 +0,0 @@
-//
-//  XLFormPickerCell.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 "UIView+XLFormAdditions.h"
-#import "XLFormPickerCell.h"
-#import "NCBridgeSwift.h"
-
-@interface XLFormPickerCell() <UIPickerViewDelegate, UIPickerViewDataSource>
-
-@end
-
-@implementation XLFormPickerCell
-
-@synthesize pickerView = _pickerView;
-@synthesize inlineRowDescriptor = _inlineRowDescriptor;
-
--(BOOL)formDescriptorCellCanBecomeFirstResponder
-{
-    return (!self.rowDescriptor.isDisabled && (self.inlineRowDescriptor == nil));
-}
-
--(BOOL)formDescriptorCellBecomeFirstResponder
-{
-    return [self becomeFirstResponder];
-}
-
-
--(BOOL)canResignFirstResponder
-{
-    return YES;
-}
-
--(BOOL)canBecomeFirstResponder
-{
-    return [self formDescriptorCellCanBecomeFirstResponder];
-}
-
-#pragma mark - Properties
-
--(UIPickerView *)pickerView
-{
-    if (_pickerView) return _pickerView;
-    _pickerView = [UIPickerView autolayoutView];
-    _pickerView.delegate = self;
-    _pickerView.dataSource = self;
-    return _pickerView;
-}
-
-#pragma mark - XLFormDescriptorCell
-
--(void)configure
-{
-    [super configure];
-    [self.contentView addSubview:self.pickerView];
-    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.pickerView attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1 constant:0]];
-    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[pickerView]-0-|" options:0 metrics:0 views:@{@"pickerView" : self.pickerView}]];
-}
-
--(void)update
-{
-    [super update];
-    BOOL isDisable = self.rowDescriptor.isDisabled;
-    self.userInteractionEnabled = !isDisable;
-    self.contentView.alpha = isDisable ? 0.5 : 1.0;
-    [self.pickerView selectRow:[self selectedIndex] inComponent:0 animated:NO];
-    [self.pickerView reloadAllComponents];
-    
-}
-
-+(CGFloat)formDescriptorCellHeightForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor
-{
-    return 216.0f;
-}
-
-#pragma mark - UIPickerViewDelegate
-
-//TWS
-- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
-{
-    [[pickerView.subviews objectAtIndex:1] setHidden:TRUE];
-    [[pickerView.subviews objectAtIndex:2] setHidden:TRUE];
-    
-    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, pickerView.frame.size.width, 50)];
-    label.backgroundColor = [UIColor clearColor];
-    label.textColor = NCBrandColor.sharedInstance.textView;
-    label.font = [UIFont systemFontOfSize:13];
-    label.textAlignment = NSTextAlignmentCenter;
-    [label setText:[self.rowDescriptor.selectorOptions objectAtIndex:row]];
-    
-    return label;
-}
-
-- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
-{
-    if (self.inlineRowDescriptor){
-		if (self.inlineRowDescriptor.valueTransformer){
-			NSAssert([self.inlineRowDescriptor.valueTransformer isSubclassOfClass:[NSValueTransformer class]], @"valueTransformer is not a subclass of NSValueTransformer");
-			NSValueTransformer * valueTransformer = [self.inlineRowDescriptor.valueTransformer new];
-			NSString * tranformedValue = [valueTransformer transformedValue:[[self.inlineRowDescriptor.selectorOptions objectAtIndex:row] valueData]];
-			if (tranformedValue){
-				return tranformedValue;
-			}
-		}
-        return [[self.inlineRowDescriptor.selectorOptions objectAtIndex:row] displayText];
-    }
-	
-	if (self.rowDescriptor.valueTransformer){
-		NSAssert([self.rowDescriptor.valueTransformer isSubclassOfClass:[NSValueTransformer class]], @"valueTransformer is not a subclass of NSValueTransformer");
-		NSValueTransformer * valueTransformer = [self.rowDescriptor.valueTransformer new];
-		NSString * tranformedValue = [valueTransformer transformedValue:[[self.rowDescriptor.selectorOptions objectAtIndex:row] valueData]];
-		if (tranformedValue){
-			return tranformedValue;
-		}
-	}
-    return [[self.rowDescriptor.selectorOptions objectAtIndex:row] displayText];
-}
-
-- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
-{
-    if (self.inlineRowDescriptor){
-        self.inlineRowDescriptor.value = [self.inlineRowDescriptor.selectorOptions objectAtIndex:row];
-        [self.formViewController updateFormRow:self.inlineRowDescriptor];
-    }
-    else{
-        [self becomeFirstResponder];
-        self.rowDescriptor.value = [self.rowDescriptor.selectorOptions objectAtIndex:row];
-    }
-}
-
-#pragma mark - UIPickerViewDataSource
-
-- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
-{
-    return 1;
-}
-
-- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
-{
-    if (self.inlineRowDescriptor){
-        return self.inlineRowDescriptor.selectorOptions.count;
-    }
-    return self.rowDescriptor.selectorOptions.count;
-}
-
-#pragma mark - helpers
-
--(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

+ 0 - 33
iOSClient/Library/XLForm/XL/Cell/XLFormSegmentedCell.h

@@ -1,33 +0,0 @@
-//
-//  XLFormSegmentedCell.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 "XLFormBaseCell.h"
-
-@interface XLFormSegmentedCell : XLFormBaseCell
-
-@property (nonatomic, readonly) UILabel * textLabel;
-@property (nonatomic, readonly) UISegmentedControl *segmentedControl;
-
-@end

+ 0 - 173
iOSClient/Library/XLForm/XL/Cell/XLFormSegmentedCell.m

@@ -1,173 +0,0 @@
-//
-//  XLFormSegmentedCell.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 "XLFormSegmentedCell.h"
-
-#import "NSObject+XLFormAdditions.h"
-#import "UIView+XLFormAdditions.h"
-
-@interface XLFormSegmentedCell()
-
-@property NSMutableArray * dynamicCustomConstraints;
-
-@end
-
-@implementation XLFormSegmentedCell
-
-@synthesize textLabel = _textLabel;
-@synthesize segmentedControl = _segmentedControl;
-
-#pragma mark - XLFormDescriptorCell
-
--(void)configure
-{
-    [super configure];
-    self.selectionStyle = UITableViewCellSelectionStyleNone;
-    [self.contentView addSubview:self.segmentedControl];
-    [self.contentView addSubview:self.textLabel];
-    [self.textLabel addObserver:self forKeyPath:@"text" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:0];
-    [self.segmentedControl addTarget:self action:@selector(valueChanged) forControlEvents:UIControlEventValueChanged];
-}
-
--(void)update
-{
-    [super update];
-    self.textLabel.text = [NSString stringWithFormat:@"%@%@", self.rowDescriptor.title, self.rowDescriptor.required && self.rowDescriptor.sectionDescriptor.formDescriptor.addAsteriskToRequiredRowsTitle ? @"*" : @""];
-    [self updateSegmentedControl];
-    self.segmentedControl.selectedSegmentIndex = [self selectedIndex];
-    self.segmentedControl.enabled = !self.rowDescriptor.isDisabled;
-}
-
-#pragma mark - KVO
-
--(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
-{
-    if (object == self.textLabel && [keyPath isEqualToString:@"text"]){
-        if ([[change objectForKey:NSKeyValueChangeKindKey] isEqualToNumber:@(NSKeyValueChangeSetting)]){
-            [self.contentView setNeedsUpdateConstraints];
-        }
-    }
-}
-
-#pragma mark - Properties
-
--(UISegmentedControl *)segmentedControl
-{
-    if (_segmentedControl) return _segmentedControl;
-    
-    _segmentedControl = [UISegmentedControl autolayoutView];
-    [_segmentedControl setContentHuggingPriority:500 forAxis:UILayoutConstraintAxisHorizontal];
-    return _segmentedControl;
-}
-
--(UILabel *)textLabel
-{
-    if (_textLabel) return _textLabel;
-    _textLabel = [UILabel autolayoutView];
-    [_textLabel setContentCompressionResistancePriority:500
-                                            forAxis:UILayoutConstraintAxisHorizontal];
-    return _textLabel;
-}
-
-#pragma mark - Action
-
--(void)valueChanged
-{
-    self.rowDescriptor.value = [self.rowDescriptor.selectorOptions objectAtIndex:self.segmentedControl.selectedSegmentIndex];
-}
-
-#pragma mark - Helper
-
--(NSArray *)getItems
-{
-    NSMutableArray * result = [[NSMutableArray alloc] init];
-    for (id option in self.rowDescriptor.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
-{
-    if (self.rowDescriptor.value){
-        for (id option in self.rowDescriptor.selectorOptions){
-            if ([[option valueData] isEqual:[self.rowDescriptor.value valueData]]){
-                return [self.rowDescriptor.selectorOptions indexOfObject:option];
-            }
-        }
-    }
-    return UISegmentedControlNoSegment;
-}
-
-#pragma mark - Layout Constraints
-
-
--(void)updateConstraints
-{
-    if (self.dynamicCustomConstraints){
-        [self.contentView removeConstraints:self.dynamicCustomConstraints];
-    }
-    self.dynamicCustomConstraints = [NSMutableArray array];
-    NSDictionary * views = @{@"segmentedControl": self.segmentedControl, @"textLabel": self.textLabel};
-    if (self.textLabel.text.length > 0){
-        [self.dynamicCustomConstraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[textLabel]-16-[segmentedControl]-|"
-                                                                                options:NSLayoutFormatAlignAllCenterY
-                                                                                metrics:0
-                                                                                  views:views]];
-        [self.dynamicCustomConstraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-12-[textLabel]-12-|"
-                                                                                options:0
-                                                                                metrics:0
-                                                                                  views:views]];
-        
-    }
-    else{
-        [self.dynamicCustomConstraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[segmentedControl]-|"
-                                                                                options:NSLayoutFormatAlignAllCenterY
-                                                                                metrics:0
-                                                                                  views:views]];
-        [self.dynamicCustomConstraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[segmentedControl]-|"
-                                                                                            options:0
-                                                                                                   metrics:0
-                                                                                                     views:views]];
-        
-    }
-    [self.contentView addConstraints:self.dynamicCustomConstraints];
-    [super updateConstraints];
-}
-
--(void)dealloc
-{
-    [self.textLabel removeObserver:self forKeyPath:@"text"];
-}
-
-@end

+ 0 - 31
iOSClient/Library/XLForm/XL/Cell/XLFormSelectorCell.h

@@ -1,31 +0,0 @@
-//
-//  XLFormSelectorCell.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 "XLFormBaseCell.h"
-#import <UIKit/UIKit.h>
-
-@interface XLFormSelectorCell : XLFormBaseCell
-
-@end

+ 0 - 415
iOSClient/Library/XLForm/XL/Cell/XLFormSelectorCell.m

@@ -1,415 +0,0 @@
-//
-//  XLFormSelectorCell.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 "XLForm.h"
-#import "NSObject+XLFormAdditions.h"
-#import "XLFormRowDescriptor.h"
-#import "XLFormSelectorCell.h"
-#import "NSArray+XLFormAdditions.h"
-
-@interface XLFormSelectorCell() <UIPickerViewDelegate, UIPickerViewDataSource, UIPopoverPresentationControllerDelegate>
-
-@property (nonatomic) UIPickerView * pickerView;
-
-@end
-
-
-@implementation XLFormSelectorCell
-{
-    UIColor * _beforeChangeColor;
-}
-
-
--(NSString *)valueDisplayText
-{
-    if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelector] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelectorPopover]){
-        if (!self.rowDescriptor.value || [self.rowDescriptor.value count] == 0){
-            return self.rowDescriptor.noValueDisplayText;
-        }
-        if (self.rowDescriptor.valueTransformer){
-            NSAssert([self.rowDescriptor.valueTransformer isSubclassOfClass:[NSValueTransformer class]], @"valueTransformer is not a subclass of NSValueTransformer");
-            NSValueTransformer * valueTransformer = [self.rowDescriptor.valueTransformer new];
-            NSString * tranformedValue = [valueTransformer transformedValue:self.rowDescriptor.value];
-            if (tranformedValue){
-                return tranformedValue;
-            }
-        }
-        NSMutableArray * descriptionArray = [NSMutableArray arrayWithCapacity:[self.rowDescriptor.value count]];
-        for (id option in self.rowDescriptor.selectorOptions) {
-            NSArray * selectedValues = self.rowDescriptor.value;
-            if ([selectedValues formIndexForItem:option] != NSNotFound){
-                if (self.rowDescriptor.valueTransformer){
-                    NSAssert([self.rowDescriptor.valueTransformer isSubclassOfClass:[NSValueTransformer class]], @"valueTransformer is not a subclass of NSValueTransformer");
-                    NSValueTransformer * valueTransformer = [self.rowDescriptor.valueTransformer new];
-                    NSString * tranformedValue = [valueTransformer transformedValue:option];
-                    if (tranformedValue){
-                        [descriptionArray addObject:tranformedValue];
-                    }
-                }
-                else{
-                    [descriptionArray addObject:[option displayText]];
-                }
-            }
-        }
-        return [descriptionArray componentsJoinedByString:@", "];
-    }
-    if (!self.rowDescriptor.value){
-        return self.rowDescriptor.noValueDisplayText;
-    }
-    if (self.rowDescriptor.valueTransformer){
-        NSAssert([self.rowDescriptor.valueTransformer isSubclassOfClass:[NSValueTransformer class]], @"valueTransformer is not a subclass of NSValueTransformer");
-        NSValueTransformer * valueTransformer = [self.rowDescriptor.valueTransformer new];
-        NSString * tranformedValue = [valueTransformer transformedValue:self.rowDescriptor.value];
-        if (tranformedValue){
-            return tranformedValue;
-        }
-    }
-    return self.rowDescriptor.displayTextValue;
-}
-
-
--(UIView *)inputView
-{
-    if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorPickerView]){
-        return self.pickerView;
-    }
-    return [super inputView];
-}
-
--(BOOL)formDescriptorCellCanBecomeFirstResponder
-{
-    return (!self.rowDescriptor.isDisabled && ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorPickerView]));
-}
-
--(BOOL)formDescriptorCellBecomeFirstResponder
-{
-    return  [self becomeFirstResponder];
-}
-
-- (BOOL)canBecomeFirstResponder
-{
-    if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorPickerView]){
-        return YES;
-    }
-    return [super canBecomeFirstResponder];
-}
-
-#pragma mark - Properties
-
--(UIPickerView *)pickerView
-{
-    if (_pickerView) return _pickerView;
-    _pickerView = [[UIPickerView alloc] init];
-    _pickerView.delegate = self;
-    _pickerView.dataSource = self;
-    [_pickerView selectRow:[self selectedIndex] inComponent:0 animated:NO];
-    return _pickerView;
-}
-
-#pragma mark - XLFormDescriptorCell
-
--(void)configure
-{
-    [super configure];
-}
-
--(void)update
-{
-    [super update];
-    self.accessoryType = self.rowDescriptor.isDisabled || !([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorPush] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelector]) ? UITableViewCellAccessoryNone : UITableViewCellAccessoryDisclosureIndicator;;
-    self.editingAccessoryType = self.accessoryType;
-    self.selectionStyle = self.rowDescriptor.isDisabled || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeInfo] ? UITableViewCellSelectionStyleNone : UITableViewCellSelectionStyleDefault;
-    self.textLabel.text = [NSString stringWithFormat:@"%@%@", self.rowDescriptor.title, self.rowDescriptor.required && self.rowDescriptor.sectionDescriptor.formDescriptor.addAsteriskToRequiredRowsTitle ? @"*" : @""];
-    self.detailTextLabel.text = [self valueDisplayText];
-}
-
--(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller
-{
-    if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorPush] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorPopover]){
-        UIViewController * controllerToPresent = nil;
-        if (self.rowDescriptor.action.formSegueIdentifier){
-            [controller performSegueWithIdentifier:self.rowDescriptor.action.formSegueIdentifier sender:self.rowDescriptor];
-        }
-        else if (self.rowDescriptor.action.formSegueClass){
-            UIViewController * controllerToPresent = [self controllerToPresent];
-            NSAssert(controllerToPresent, @"either rowDescriptor.action.viewControllerClass or rowDescriptor.action.viewControllerStoryboardId or rowDescriptor.action.viewControllerNibName must be assigned");
-            NSAssert([controllerToPresent conformsToProtocol:@protocol(XLFormRowDescriptorViewController)], @"selector view controller must conform to XLFormRowDescriptorViewController protocol");
-            UIStoryboardSegue * segue = [[self.rowDescriptor.action.formSegueClass alloc] initWithIdentifier:self.rowDescriptor.tag source:controller destination:controllerToPresent];
-            [controller prepareForSegue:segue sender:self.rowDescriptor];
-            [segue perform];
-        }
-        else if ((controllerToPresent = [self controllerToPresent])){
-            NSAssert([controllerToPresent conformsToProtocol:@protocol(XLFormRowDescriptorViewController)], @"rowDescriptor.action.viewControllerClass must conform to XLFormRowDescriptorViewController protocol");
-            UIViewController<XLFormRowDescriptorViewController> *selectorViewController = (UIViewController<XLFormRowDescriptorViewController> *)controllerToPresent;
-            selectorViewController.rowDescriptor = self.rowDescriptor;
-            selectorViewController.title = self.rowDescriptor.selectorTitle;
-
-            if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorPopover]) {
-                UIViewController *popoverController = self.formViewController.presentedViewController;
-                if (popoverController && popoverController.modalPresentationStyle == UIModalPresentationPopover) {
-                    [self.formViewController dismissViewControllerAnimated:NO completion:nil];
-                }
-                selectorViewController.modalPresentationStyle = UIModalPresentationPopover;
-                
-                selectorViewController.popoverPresentationController.delegate = self;
-                if (self.detailTextLabel.window){
-                    selectorViewController.popoverPresentationController.sourceRect = CGRectMake(0, 0, self.detailTextLabel.frame.size.width, self.detailTextLabel.frame.size.height);
-                    selectorViewController.popoverPresentationController.sourceView = self.detailTextLabel;
-                    selectorViewController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
-                } else {
-                    selectorViewController.popoverPresentationController.sourceRect = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
-                    selectorViewController.popoverPresentationController.sourceView = self;
-                    selectorViewController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
-                }
-                
-                [self.formViewController presentViewController:selectorViewController
-                                                      animated:YES
-                                                    completion:nil];
-                [controller.tableView deselectRowAtIndexPath:[controller.tableView indexPathForCell:self]
-                                                    animated:YES];
-            }
-            else {
-                [controller.navigationController pushViewController:selectorViewController animated:YES];
-            }
-        }
-        else if (self.rowDescriptor.selectorOptions){
-            XLFormOptionsViewController * optionsViewController = [[XLFormOptionsViewController alloc] initWithStyle:UITableViewStyleGrouped titleHeaderSection:nil titleFooterSection:nil];
-            optionsViewController.rowDescriptor = self.rowDescriptor;
-            optionsViewController.title = self.rowDescriptor.selectorTitle;
-
-			if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorPopover]) {
-                optionsViewController.modalPresentationStyle = UIModalPresentationPopover;
-                
-                optionsViewController.popoverPresentationController.delegate = self;
-                if (self.detailTextLabel.window){
-                    optionsViewController.popoverPresentationController.sourceRect = CGRectMake(0, 0, self.detailTextLabel.frame.size.width, self.detailTextLabel.frame.size.height);
-                    optionsViewController.popoverPresentationController.sourceView = self.detailTextLabel;
-                    optionsViewController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
-                } else {
-                    optionsViewController.popoverPresentationController.sourceRect = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
-                    optionsViewController.popoverPresentationController.sourceView = self;
-                    optionsViewController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
-                }
-                
-                [self.formViewController presentViewController:optionsViewController
-                                                      animated:YES
-                                                    completion:nil];
-                [controller.tableView deselectRowAtIndexPath:[controller.tableView indexPathForCell:self]
-                                                    animated:YES];
-			} else {
-				[controller.navigationController pushViewController:optionsViewController animated:YES];
-			}
-        }
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelector] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelectorPopover])
-    {
-        NSAssert(self.rowDescriptor.selectorOptions, @"selectorOptions property shopuld not be nil");
-        UIViewController * controllerToPresent = nil;
-        XLFormOptionsViewController * optionsViewController = nil;
-        if ((controllerToPresent = [self controllerToPresent])){
-            optionsViewController = (XLFormOptionsViewController *)controllerToPresent;
-        } else {
-            optionsViewController = [[XLFormOptionsViewController alloc] initWithStyle:UITableViewStyleGrouped titleHeaderSection:nil titleFooterSection:nil];
-        }
-        optionsViewController.rowDescriptor = self.rowDescriptor;
-        optionsViewController.title = self.rowDescriptor.selectorTitle;
-
-        if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelectorPopover]) {
-            optionsViewController.modalPresentationStyle = UIModalPresentationPopover;
-            
-            optionsViewController.popoverPresentationController.delegate = self;
-            if (self.detailTextLabel.window){
-                optionsViewController.popoverPresentationController.sourceRect = CGRectMake(0, 0, self.detailTextLabel.frame.size.width, self.detailTextLabel.frame.size.height);
-                optionsViewController.popoverPresentationController.sourceView = self.detailTextLabel;
-                optionsViewController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
-            } else {
-                optionsViewController.popoverPresentationController.sourceRect = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
-                optionsViewController.popoverPresentationController.sourceView = self;
-                optionsViewController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
-            }
-            
-            [self.formViewController presentViewController:optionsViewController
-                                                  animated:YES
-                                                completion:nil];
-            [controller.tableView deselectRowAtIndexPath:[controller.tableView indexPathForCell:self] animated:YES];
-        } else {
-            [controller.navigationController pushViewController:optionsViewController animated:YES];
-        }
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorActionSheet]){
-        XLFormViewController * formViewController = self.formViewController;
-        UIAlertController * alertController = [UIAlertController alertControllerWithTitle:self.rowDescriptor.selectorTitle
-                                                                                  message:nil
-                                                                           preferredStyle:UIAlertControllerStyleActionSheet];
-        [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
-                                                            style:UIAlertActionStyleCancel
-                                                          handler:nil]];
-        alertController.popoverPresentationController.sourceView = formViewController.tableView;
-        UIView* v = (self.detailTextLabel ?: self.textLabel) ?: self.contentView;
-        alertController.popoverPresentationController.sourceRect = [formViewController.tableView convertRect:v.frame fromView:self];
-        __weak __typeof(self)weakSelf = self;
-        for (id option in self.rowDescriptor.selectorOptions) {
-            NSString *optionTitle = [option displayText];
-            if (self.rowDescriptor.valueTransformer){
-                NSAssert([self.rowDescriptor.valueTransformer isSubclassOfClass:[NSValueTransformer class]], @"valueTransformer is not a subclass of NSValueTransformer");
-                NSValueTransformer * valueTransformer = [self.rowDescriptor.valueTransformer new];
-                NSString * transformedValue = [valueTransformer transformedValue:[option valueData]];
-                if (transformedValue) {
-                    optionTitle = transformedValue;
-                }
-            }
-            [alertController addAction:[UIAlertAction actionWithTitle:optionTitle
-                                                                style:UIAlertActionStyleDefault
-                                                              handler:^(UIAlertAction *action) {
-                                                                  [weakSelf.rowDescriptor setValue:option];
-                                                                  [formViewController.tableView reloadData];
-                                                              }]];
-        }
-        [formViewController presentViewController:alertController animated:YES completion:nil];
-        [controller.tableView deselectRowAtIndexPath:[controller.form indexPathOfFormRow:self.rowDescriptor] animated:YES];
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorAlertView]){
-        UIAlertController * alertController = [UIAlertController alertControllerWithTitle:self.rowDescriptor.selectorTitle
-                                                                                  message:nil
-                                                                           preferredStyle:UIAlertControllerStyleAlert];
-        __weak __typeof(self)weakSelf = self;
-        for (id option in self.rowDescriptor.selectorOptions) {
-            [alertController addAction:[UIAlertAction actionWithTitle:[option displayText]
-                                                                style:UIAlertActionStyleDefault
-                                                              handler:^(UIAlertAction *action) {
-                                                                  [weakSelf.rowDescriptor setValue:option];
-                                                                  [weakSelf.formViewController.tableView reloadData];
-                                                              }]];
-        }
-        [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
-                                                            style:UIAlertActionStyleCancel
-                                                          handler:nil]];
-        [controller presentViewController:alertController animated:YES completion:nil];
-        [controller.tableView deselectRowAtIndexPath:[controller.form indexPathOfFormRow:self.rowDescriptor] animated:YES];
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorPickerView]){
-        [controller.tableView selectRowAtIndexPath:nil animated:YES scrollPosition:UITableViewScrollPositionNone];
-    }
-}
-
--(void)highlight
-{
-    [super highlight];
-    _beforeChangeColor = self.detailTextLabel.textColor;
-    self.detailTextLabel.textColor = self.tintColor;
-}
-
--(void)unhighlight
-{
-    [super unhighlight];
-    self.detailTextLabel.textColor = _beforeChangeColor;
-}
-
-#pragma mark - UIPickerViewDelegate
-
-- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
-{
-	if (self.rowDescriptor.valueTransformer){
-		NSAssert([self.rowDescriptor.valueTransformer isSubclassOfClass:[NSValueTransformer class]], @"valueTransformer is not a subclass of NSValueTransformer");
-		NSValueTransformer * valueTransformer = [self.rowDescriptor.valueTransformer new];
-		NSString * tranformedValue = [valueTransformer transformedValue:[[self.rowDescriptor.selectorOptions objectAtIndex:row] valueData]];
-		if (tranformedValue){
-			return tranformedValue;
-		}
-	}
-	return [[self.rowDescriptor.selectorOptions objectAtIndex:row] displayText];
-}
-
-- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
-{
-    if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeSelectorPickerView]){
-        self.rowDescriptor.value = [self.rowDescriptor.selectorOptions objectAtIndex:row];
-        self.detailTextLabel.text = [self valueDisplayText];
-        [self setNeedsLayout];
-    }
-}
-
-#pragma mark - UIPickerViewDataSource
-
-- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
-{
-    return 1;
-}
-
-- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
-{
-    return self.rowDescriptor.selectorOptions.count;
-}
-
-#pragma mark - UIPopoverPresentationControllerDelegate
-
-- (void)popoverPresentationControllerDidDismissPopover:(UIPopoverPresentationController *)popoverPresentationController {
-    [self.formViewController.tableView reloadData];
-}
-
-#pragma mark - Helpers
-
--(NSInteger)selectedIndex
-{
-    if (self.rowDescriptor.value){
-        for (id option in self.rowDescriptor.selectorOptions){
-            if ([[option valueData] isEqual:[self.rowDescriptor.value valueData]]){
-                return [self.rowDescriptor.selectorOptions indexOfObject:option];
-            }
-        }
-    }
-    return -1;
-}
-
--(UIViewController *)controllerToPresent
-{
-    if (self.rowDescriptor.action.viewControllerClass){
-        return [[self.rowDescriptor.action.viewControllerClass alloc] init];
-    }
-    else if ([self.rowDescriptor.action.viewControllerStoryboardId length] != 0){
-        UIStoryboard * storyboard =  [self storyboardToPresent];
-        NSAssert(storyboard != nil, @"You must provide a storyboard when rowDescriptor.action.viewControllerStoryboardId is used");
-        return [storyboard instantiateViewControllerWithIdentifier:self.rowDescriptor.action.viewControllerStoryboardId];
-    }
-    else if ([self.rowDescriptor.action.viewControllerNibName length] != 0){
-        Class viewControllerClass = NSClassFromString(self.rowDescriptor.action.viewControllerNibName);
-        NSAssert(viewControllerClass, @"class owner of self.rowDescriptor.action.viewControllerNibName must be equal to %@", self.rowDescriptor.action.viewControllerNibName);
-        return [[viewControllerClass alloc] initWithNibName:self.rowDescriptor.action.viewControllerNibName bundle:nil];
-    }
-    return nil;
-}
-
--(UIStoryboard *)storyboardToPresent
-{
-    if ([self.formViewController respondsToSelector:@selector(storyboardForRow:)]){
-        return [self.formViewController storyboardForRow:self.rowDescriptor];
-    }
-    if (self.formViewController.storyboard){
-        return self.formViewController.storyboard;
-    }
-    return nil;
-}
-
-@end

+ 0 - 30
iOSClient/Library/XLForm/XL/Cell/XLFormSliderCell.h

@@ -1,30 +0,0 @@
-//
-//  XLFormSliderCell.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 "XLForm.h"
-
-@interface XLFormSliderCell : XLFormBaseCell
-
-@end

+ 0 - 91
iOSClient/Library/XLForm/XL/Cell/XLFormSliderCell.m

@@ -1,91 +0,0 @@
-//
-//  XLFormSliderCell.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 "XLFormSliderCell.h"
-#import "UIView+XLFormAdditions.h"
-
-@interface XLFormSliderCell ()
-
-@property (nonatomic) UISlider * slider;
-@property (nonatomic) UILabel * textLabel;
-@property NSUInteger steps;
-
-@end
-
-@implementation XLFormSliderCell
-
-@synthesize textLabel = _textLabel;
-
-- (void)configure
-{
-	self.steps = 0;
-	[self.slider addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
-	[self.contentView addSubview:self.slider];
-	[self.contentView addSubview:self.textLabel];
-    	self.selectionStyle = UITableViewCellSelectionStyleNone;
-	[self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.textLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1 constant:10]];
-	[self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.slider attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1 constant:44]];
-	[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[textLabel]-|" options:0 metrics:0 views:@{@"textLabel": self.textLabel}]];
-	[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-30-[slider]-30-|" options:0 metrics:0 views:@{@"slider": self.slider}]];
-	
-	[self valueChanged:nil];
-}
-
--(void)update {
-	
-    [super update];
-    self.textLabel.text = self.rowDescriptor.title;
-    self.slider.value = [self.rowDescriptor.value floatValue];
-    self.slider.enabled = !self.rowDescriptor.isDisabled;
-    [self valueChanged:nil];
-}
-
--(void)valueChanged:(UISlider*)_slider {
-	if(self.steps != 0) {
-		self.slider.value = roundf((self.slider.value-self.slider.minimumValue)/(self.slider.maximumValue-self.slider.minimumValue)*self.steps)*(self.slider.maximumValue-self.slider.minimumValue)/self.steps + self.slider.minimumValue;
-	}
-	self.rowDescriptor.value = @(self.slider.value);
-}
-
-+(CGFloat)formDescriptorCellHeightForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor {
-	return 88;
-}
-
-
--(UILabel *)textLabel
-{
-    if (_textLabel) return _textLabel;
-    _textLabel = [UILabel autolayoutView];
-    return _textLabel;
-}
-
--(UISlider *)slider
-{
-    if (_slider) return _slider;
-    _slider = [UISlider autolayoutView];
-    return _slider;
-}
-
-@end

+ 0 - 31
iOSClient/Library/XLForm/XL/Cell/XLFormStepCounterCell.h

@@ -1,31 +0,0 @@
-//
-//  XLFormStepCounterCell.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 "XLFormBaseCell.h"
-#import <UIKit/UIKit.h>
-
-@interface XLFormStepCounterCell : XLFormBaseCell
-
-@end

+ 0 - 121
iOSClient/Library/XLForm/XL/Cell/XLFormStepCounterCell.m

@@ -1,121 +0,0 @@
-//
-//  XLFormStepCounterCell.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 "XLFormStepCounterCell.h"
-#import "XLFormRowDescriptor.h"
-#import "UIView+XLFormAdditions.h"
-
-@interface XLFormStepCounterCell ()
-
-@property (nonatomic) UIStepper *stepControl;
-@property (nonatomic) UILabel *currentStepValue;
-
-@end
-
-@implementation XLFormStepCounterCell
-
-
-#pragma mark - XLFormStepCounterCell
-
-- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
-    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
-    if (self) {
-        // Initialization code
-    }
-    return self;
-}
-
-- (void)configure
-{
-    [super configure];
-    self.selectionStyle = UITableViewCellSelectionStyleNone;
-    
-    // Add subviews
-    [self.contentView addSubview:self.stepControl];
-    [self.contentView addSubview:self.currentStepValue];
-    
-    // Add constraints
-    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.stepControl attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterY multiplier:1 constant:0]];
-    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.currentStepValue attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterY multiplier:1 constant:0]];
-    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.currentStepValue attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:self.stepControl attribute:NSLayoutAttributeHeight multiplier:1 constant:0]];
-    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[value]-5-[control]-|" options:0 metrics:0 views:@{@"value": self.currentStepValue, @"control":self.stepControl}]];
-}
- 
-- (void)update
-{
-    [super update];
-    self.textLabel.text = self.rowDescriptor.title;
-    self.stepControl.value = [self.rowDescriptor.value doubleValue];
-    self.currentStepValue.text = self.rowDescriptor.value ? [NSString stringWithFormat:@"%@", self.rowDescriptor.value] : nil;
-    [self stepControl].enabled = !self.rowDescriptor.isDisabled;
-    [self currentStepValue].font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
-    CGFloat red, green, blue, alpha;
-    [self.tintColor getRed:&red green:&green blue:&blue alpha:&alpha];
-    if (self.rowDescriptor.isDisabled)
-    {
-        [self setTintColor:[UIColor colorWithRed:red green:green blue:blue alpha:0.3]];
-        [self currentStepValue].textColor = [UIColor colorWithRed:red green:green blue:blue alpha:0.3];
-    }
-    else{
-        [self setTintColor:[UIColor colorWithRed:red green:green blue:blue alpha:1]];
-        [self currentStepValue].textColor = [UIColor colorWithRed:red green:green blue:blue alpha:1];
-    }
-}
-
-
-#pragma mark - Events
-
-- (void)valueChanged:(id)sender
-{
-    UIStepper *stepper = self.stepControl;
-    
-    self.rowDescriptor.value = @(stepper.value);
-    self.currentStepValue.text = [NSString stringWithFormat:@"%.f", stepper.value];
-}
-
-
-#pragma mark - Properties
-
-- (UIStepper *)stepControl
-{
-    if (!_stepControl) {
-        _stepControl = [UIStepper autolayoutView];
-        [_stepControl addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
-    }
-    return _stepControl;
-}
-
--(UILabel *)currentStepValue
-{
-    if (!_currentStepValue) {
-        _currentStepValue = [UILabel autolayoutView];
-    }
-    return _currentStepValue;
-}
-
-@end
-
-

+ 0 - 30
iOSClient/Library/XLForm/XL/Cell/XLFormSwitchCell.h

@@ -1,30 +0,0 @@
-//
-//  XLFormSwitchCell.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 "XLFormBaseCell.h"
-
-@interface XLFormSwitchCell : XLFormBaseCell
-
-@end

+ 0 - 61
iOSClient/Library/XLForm/XL/Cell/XLFormSwitchCell.m

@@ -1,61 +0,0 @@
-//
-//  XLFormSwitchCell.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 "XLFormRowDescriptor.h"
-
-#import "XLFormSwitchCell.h"
-
-@implementation XLFormSwitchCell
-
-#pragma mark - XLFormDescriptorCell
-
-- (void)configure
-{
-    [super configure];
-    self.selectionStyle = UITableViewCellSelectionStyleNone;
-    self.accessoryView = [[UISwitch alloc] init];
-    self.editingAccessoryView = self.accessoryView;
-    [self.switchControl addTarget:self action:@selector(valueChanged) forControlEvents:UIControlEventValueChanged];
-}
-
-- (void)update
-{
-    [super update];
-    self.textLabel.text = self.rowDescriptor.title;
-    self.switchControl.on = [self.rowDescriptor.value boolValue];
-    self.switchControl.enabled = !self.rowDescriptor.isDisabled;
-}
-
-- (UISwitch *)switchControl
-{
-    return (UISwitch *)self.accessoryView;
-}
-
-- (void)valueChanged
-{
-    self.rowDescriptor.value = @(self.switchControl.on);
-}
-
-@end

+ 0 - 40
iOSClient/Library/XLForm/XL/Cell/XLFormTextFieldCell.h

@@ -1,40 +0,0 @@
-//
-//  XLFormTextFieldCell.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 "XLFormBaseCell.h"
-#import <UIKit/UIKit.h>
-
-extern NSString *const XLFormTextFieldLengthPercentage;
-extern NSString *const XLFormTextFieldMaxNumberOfCharacters;
-
-@interface XLFormTextFieldCell : XLFormBaseCell <XLFormReturnKeyProtocol>
-
-@property (nonatomic, readonly) UILabel * textLabel;
-@property (nonatomic, readonly) UITextField * textField;
-
-@property (nonatomic) NSNumber *textFieldLengthPercentage;
-@property (nonatomic) NSNumber *textFieldMaxNumberOfCharacters;
-
-@end

+ 0 - 368
iOSClient/Library/XLForm/XL/Cell/XLFormTextFieldCell.m

@@ -1,368 +0,0 @@
-//
-//  XLFormTextFieldCell.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 "NSObject+XLFormAdditions.h"
-#import "UIView+XLFormAdditions.h"
-#import "XLFormRowDescriptor.h"
-#import "XLForm.h"
-#import "XLFormTextFieldCell.h"
-
-NSString *const XLFormTextFieldLengthPercentage = @"textFieldLengthPercentage";
-NSString *const XLFormTextFieldMaxNumberOfCharacters = @"textFieldMaxNumberOfCharacters";
-
-@interface XLFormTextFieldCell() <UITextFieldDelegate>
-
-@property NSMutableArray * dynamicCustomConstraints;
-
-@end
-
-@implementation XLFormTextFieldCell
-
-@synthesize textField = _textField;
-@synthesize textLabel = _textLabel;
-@synthesize returnKeyType = _returnKeyType;
-@synthesize nextReturnKeyType = _nextReturnKeyType;
-
-
-#pragma mark - KVO
-
--(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
-{
-    if ((object == self.textLabel && [keyPath isEqualToString:@"text"]) ||  (object == self.imageView && [keyPath isEqualToString:@"image"])){
-        if ([[change objectForKey:NSKeyValueChangeKindKey] isEqualToNumber:@(NSKeyValueChangeSetting)]){
-            [self.contentView setNeedsUpdateConstraints];
-        }
-    }
-}
-
--(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
-{
-    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
-    if (self) {
-        _returnKeyType = UIReturnKeyDefault;
-        _nextReturnKeyType = UIReturnKeyNext;
-    }
-    return self;
-}
-
--(void)dealloc
-{
-    [self.textLabel removeObserver:self forKeyPath:@"text"];
-    [self.imageView removeObserver:self forKeyPath:@"image"];
-}
-
-#pragma mark - XLFormDescriptorCell
-
--(void)configure
-{
-    [super configure];
-    [self setSelectionStyle:UITableViewCellSelectionStyleNone];
-    [self.contentView addSubview:self.textLabel];
-    [self.contentView addSubview:self.textField];
-    [self.contentView addConstraints:[self layoutConstraints]];
-    [self.textLabel addObserver:self forKeyPath:@"text" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:0];
-    [self.imageView addObserver:self forKeyPath:@"image" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:0];
-    [self.textField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
-}
-
--(void)update
-{
-    [super update];
-    self.textField.delegate = self;
-    self.textField.clearButtonMode = UITextFieldViewModeWhileEditing;
-    if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeText]){
-        self.textField.autocorrectionType = UITextAutocorrectionTypeDefault;
-        self.textField.autocapitalizationType = UITextAutocapitalizationTypeSentences;
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeName]){
-        self.textField.autocorrectionType = UITextAutocorrectionTypeNo;
-        self.textField.autocapitalizationType = UITextAutocapitalizationTypeWords;
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeEmail]){
-        self.textField.keyboardType = UIKeyboardTypeEmailAddress;
-        self.textField.autocorrectionType = UITextAutocorrectionTypeNo;
-        self.textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeNumber]){
-        self.textField.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
-        self.textField.autocorrectionType = UITextAutocorrectionTypeNo;
-        self.textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeInteger]){
-        self.textField.keyboardType = UIKeyboardTypeNumberPad;
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDecimal]){
-        self.textField.keyboardType = UIKeyboardTypeDecimalPad;
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypePassword]){
-        self.textField.autocorrectionType = UITextAutocorrectionTypeNo;
-        self.textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
-        self.textField.keyboardType = UIKeyboardTypeASCIICapable;
-        self.textField.secureTextEntry = YES;
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypePhone]){
-        self.textField.keyboardType = UIKeyboardTypePhonePad;
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeURL]){
-        self.textField.autocorrectionType = UITextAutocorrectionTypeNo;
-        self.textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
-        self.textField.keyboardType = UIKeyboardTypeURL;
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeTwitter]){
-        self.textField.keyboardType = UIKeyboardTypeTwitter;
-        self.textField.autocorrectionType = UITextAutocorrectionTypeNo;
-        self.textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeAccount]){
-        self.textField.keyboardType = UIKeyboardTypeASCIICapable;
-        self.textField.autocorrectionType = UITextAutocorrectionTypeNo;
-        self.textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
-    }
-    else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeZipCode]){
-        self.textField.autocorrectionType = UITextAutocorrectionTypeNo;
-        self.textField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters;
-        self.textField.keyboardType = UIKeyboardTypeDefault;
-    }
-
-    self.textLabel.text = ((self.rowDescriptor.required && self.rowDescriptor.title && self.rowDescriptor.sectionDescriptor.formDescriptor.addAsteriskToRequiredRowsTitle) ? [NSString stringWithFormat:@"%@*", self.rowDescriptor.title] : self.rowDescriptor.title);
-
-    self.textField.text = self.rowDescriptor.value ? [self.rowDescriptor displayTextValue] : self.rowDescriptor.noValueDisplayText;
-    [self.textField setEnabled:!self.rowDescriptor.isDisabled];
-    self.textField.textColor = self.rowDescriptor.isDisabled ? [UIColor grayColor] : [UIColor blackColor];
-    self.textField.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
-}
-
--(BOOL)formDescriptorCellCanBecomeFirstResponder
-{
-    return (!self.rowDescriptor.isDisabled);
-}
-
--(BOOL)formDescriptorCellBecomeFirstResponder
-{
-    return [self.textField becomeFirstResponder];
-}
-
--(void)highlight
-{
-    [super highlight];
-    self.textLabel.textColor = self.tintColor;
-}
-
--(void)unhighlight
-{
-    [super unhighlight];
-    [self.formViewController updateFormRow:self.rowDescriptor];
-}
-
-#pragma mark - Properties
-
--(UILabel *)textLabel
-{
-    if (_textLabel) return _textLabel;
-    _textLabel = [UILabel autolayoutView];
-    return _textLabel;
-}
-
--(UITextField *)textField
-{
-    if (_textField) return _textField;
-    _textField = [UITextField autolayoutView];
-    return _textField;
-}
-
-#pragma mark - LayoutConstraints
-
--(NSArray *)layoutConstraints
-{
-    NSMutableArray * result = [[NSMutableArray alloc] init];
-    [self.textLabel setContentHuggingPriority:500 forAxis:UILayoutConstraintAxisHorizontal];
-    [self.textLabel setContentCompressionResistancePriority:1000 forAxis:UILayoutConstraintAxisHorizontal];
-
-    // Add Constraints
-    [result addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(margin)-[_textField]-(margin)-|"
-                                                                        options:NSLayoutFormatAlignAllBaseline
-                                                                        metrics:[NSDictionary dictionaryWithObjectsAndKeys:@(11.0), @"margin", nil]
-                                                                          views:NSDictionaryOfVariableBindings(_textField)]];
-    [result addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(margin)-[_textLabel]-(margin)-|"
-                                                                        options:NSLayoutFormatAlignAllBaseline
-                                                                        metrics:[NSDictionary dictionaryWithObjectsAndKeys:@(11.0), @"margin", nil]
-                                                                          views:NSDictionaryOfVariableBindings(_textLabel)]];
-
-    return result;
-}
-
--(void)updateConstraints
-{
-    if (self.dynamicCustomConstraints){
-        [self.contentView removeConstraints:self.dynamicCustomConstraints];
-    }
-    NSMutableDictionary * views = [[NSMutableDictionary alloc] initWithDictionary: @{@"label": self.textLabel, @"textField": self.textField}];
-    if (self.imageView.image){
-        views[@"image"] = self.imageView;
-        if (self.textLabel.text.length > 0){
-            self.dynamicCustomConstraints = [NSMutableArray arrayWithArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[image]-[label]-[textField]-|" options:0 metrics:nil views:views]];
-            [self.dynamicCustomConstraints addObject:[NSLayoutConstraint constraintWithItem:_textField
-                                                                                  attribute:NSLayoutAttributeWidth
-                                                                                  relatedBy:self.textFieldLengthPercentage ? NSLayoutRelationEqual : NSLayoutRelationGreaterThanOrEqual
-                                                                                     toItem:self.contentView
-                                                                                  attribute:NSLayoutAttributeWidth
-                                                                                 multiplier:self.textFieldLengthPercentage ? [self.textFieldLengthPercentage floatValue] : 0.3
-                                                                                   constant:0.0]];
-        }
-        else{
-            self.dynamicCustomConstraints = [NSMutableArray arrayWithArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[image]-[textField]-|" options:0 metrics:nil views:views]];
-        }
-    }
-    else{
-        if (self.textLabel.text.length > 0){
-            self.dynamicCustomConstraints = [NSMutableArray arrayWithArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[label]-[textField]-|" options:0 metrics:nil views:views]];
-            [self.dynamicCustomConstraints addObject:[NSLayoutConstraint constraintWithItem:_textField
-                                                                                  attribute:NSLayoutAttributeWidth
-                                                                                  relatedBy:self.textFieldLengthPercentage ? NSLayoutRelationEqual : NSLayoutRelationGreaterThanOrEqual
-                                                                                     toItem:self.contentView
-                                                                                  attribute:NSLayoutAttributeWidth
-                                                                                 multiplier:self.textFieldLengthPercentage ? [self.textFieldLengthPercentage floatValue] : 0.3
-                                                                                   constant:0.0]];
-        }
-        else{
-            self.dynamicCustomConstraints = [NSMutableArray arrayWithArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[textField]-|" options:0 metrics:nil views:views]];
-        }
-    }
-
-    [self.contentView addConstraints:self.dynamicCustomConstraints];
-    [super updateConstraints];
-}
-
-
-#pragma mark - UITextFieldDelegate
-
-- (BOOL)textFieldShouldClear:(UITextField *)textField
-{
-    return [self.formViewController textFieldShouldClear:textField];
-}
-
-- (BOOL)textFieldShouldReturn:(UITextField *)textField
-{
-    return [self.formViewController textFieldShouldReturn:textField];
-}
-
-- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
-{
-    return [self.formViewController textFieldShouldBeginEditing:textField];
-}
-
-- (BOOL)textFieldShouldEndEditing:(UITextField *)textField
-{
-    return [self.formViewController textFieldShouldEndEditing:textField];
-}
-
-- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
-    if (self.textFieldMaxNumberOfCharacters) {
-        // Check maximum length requirement
-        NSString *newString = [textField.text stringByReplacingCharactersInRange:range withString:string];
-        if (newString.length > self.textFieldMaxNumberOfCharacters.integerValue) {
-            return NO;
-        }
-    }
-
-    // Otherwise, leave response to view controller
-    return [self.formViewController textField:textField shouldChangeCharactersInRange:range replacementString:string];
-}
-
-- (void)textFieldDidBeginEditing:(UITextField *)textField
-{
-    [self.formViewController beginEditing:self.rowDescriptor];
-    [self.formViewController textFieldDidBeginEditing:textField];
-    // set the input to the raw value if we have a formatter and it shouldn't be used during input
-    if (self.rowDescriptor.valueFormatter) {
-        self.textField.text = [self.rowDescriptor editTextValue];
-    }
-}
-
-- (void)textFieldDidEndEditing:(UITextField *)textField
-{
-    // process text change before we stick a formatted value in the UITextField
-    [self textFieldDidChange:textField];
-    
-    // losing input, replace the text field with the formatted value
-    if (self.rowDescriptor.valueFormatter) {
-        self.textField.text = [self.rowDescriptor.value displayText];
-    }
-    
-    [self.formViewController endEditing:self.rowDescriptor];
-    [self.formViewController textFieldDidEndEditing:textField];
-}
-
-
-#pragma mark - Helper
-
-- (void)textFieldDidChange:(UITextField *)textField{
-    if([self.textField.text length] > 0) {
-        BOOL didUseFormatter = NO;
-        
-        if (self.rowDescriptor.valueFormatter && self.rowDescriptor.useValueFormatterDuringInput)
-        {
-            // use generic getObjectValue:forString:errorDescription and stringForObjectValue
-            NSString *errorDescription = nil;
-            NSString *objectValue = nil;
-            
-            if ([ self.rowDescriptor.valueFormatter getObjectValue:&objectValue forString:textField.text errorDescription:&errorDescription]) {
-                NSString *formattedValue = [self.rowDescriptor.valueFormatter stringForObjectValue:objectValue];
-                
-                self.rowDescriptor.value = objectValue;
-                textField.text = formattedValue;
-                didUseFormatter = YES;
-            }
-        }
-        
-        // only do this conversion if we didn't use the formatter
-        if (!didUseFormatter)
-        {
-            if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeNumber] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDecimal]){
-                self.rowDescriptor.value =  [NSDecimalNumber decimalNumberWithString:self.textField.text locale:NSLocale.currentLocale];
-            } else if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeInteger]){
-                self.rowDescriptor.value = @([self.textField.text integerValue]);
-            } else {
-                self.rowDescriptor.value = self.textField.text;
-            }
-        }
-    } else {
-        self.rowDescriptor.value = nil;
-    }
-}
-
--(void)setReturnKeyType:(UIReturnKeyType)returnKeyType
-{
-    _returnKeyType = returnKeyType;
-    self.textField.returnKeyType = returnKeyType;
-}
-
--(UIReturnKeyType)returnKeyType
-{
-    return _returnKeyType;
-}
-
-
-@end

+ 0 - 42
iOSClient/Library/XLForm/XL/Cell/XLFormTextViewCell.h

@@ -1,42 +0,0 @@
-//
-//  XLFormTextViewCell.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 "XLFormTextView.h"
-#import "XLFormBaseCell.h"
-#import <UIKit/UIKit.h>
-
-extern NSString *const XLFormTextViewLengthPercentage;
-extern NSString *const XLFormTextViewMaxNumberOfCharacters;
-
-@interface XLFormTextViewCell : XLFormBaseCell
-
-@property (nonatomic, readonly) UILabel * label DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use textLabel instead");
-@property (nonatomic, readonly) UILabel * textLabel;
-@property (nonatomic, readonly) XLFormTextView * textView;
-
-@property (nonatomic) NSNumber *textViewLengthPercentage;
-@property (nonatomic) NSNumber *textViewMaxNumberOfCharacters;
-
-@end

+ 0 - 222
iOSClient/Library/XLForm/XL/Cell/XLFormTextViewCell.m

@@ -1,222 +0,0 @@
-//
-//  XLFormTextViewCell.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 "XLFormRowDescriptor.h"
-#import "UIView+XLFormAdditions.h"
-#import "XLFormViewController.h"
-#import "XLFormTextView.h"
-#import "XLFormTextViewCell.h"
-
-NSString *const XLFormTextViewLengthPercentage = @"textViewLengthPercentage";
-NSString *const XLFormTextViewMaxNumberOfCharacters = @"textViewMaxNumberOfCharacters";
-
-@interface XLFormTextViewCell() <UITextViewDelegate>
-
-@end
-
-@implementation XLFormTextViewCell
-{
-    NSMutableArray * _dynamicCustomConstraints;
-}
-
-@synthesize textLabel = _textLabel;
-@synthesize textView = _textView;
-
--(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
-{
-    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
-    if (self) {
-        _dynamicCustomConstraints = [NSMutableArray array];
-    }
-    return self;
-}
-
--(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
-{
-    if (object == self.textLabel && [keyPath isEqualToString:@"text"]){
-        if ([[change objectForKey:NSKeyValueChangeKindKey] isEqualToNumber:@(NSKeyValueChangeSetting)]){
-            [self needsUpdateConstraints];
-        }
-    }
-}
-
--(void)dealloc
-{
-    [self.textLabel removeObserver:self forKeyPath:@"text"];
-}
-
-
-#pragma mark - Properties
-
--(UILabel *)textLabel
-{
-    if (_textLabel) return _textLabel;
-    _textLabel = [UILabel autolayoutView];
-    [_textLabel setContentHuggingPriority:500 forAxis:UILayoutConstraintAxisHorizontal];
-    return _textLabel;
-}
-
--(UILabel *)label
-{
-    return self.textLabel;
-}
-
--(XLFormTextView *)textView
-{
-    if (_textView) return _textView;
-    _textView = [XLFormTextView autolayoutView];
-    return _textView;
-}
-
-#pragma mark - XLFormDescriptorCell
-
--(void)configure
-{
-    [super configure];
-    [self setSelectionStyle:UITableViewCellSelectionStyleNone];
-    [self.contentView addSubview:self.textLabel];
-    [self.contentView addSubview:self.textView];
-    [self.textLabel addObserver:self forKeyPath:@"text" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:0];
-    NSDictionary * views = @{@"label": self.textLabel, @"textView": self.textView};
-    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-8-[label]" options:0 metrics:0 views:views]];
-    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.textView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1 constant:0]];
-    [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:self.textView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1 constant:0]];
-    [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[textView]-0-|" options:0 metrics:0 views:views]];
-}
-
--(void)update
-{
-    [super update];
-    self.textView.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
-    self.textView.placeHolderLabel.font = self.textView.font;
-    self.textView.delegate = self;
-    self.textView.keyboardType = UIKeyboardTypeDefault;
-    self.textView.text = self.rowDescriptor.value;
-    [self.textView setEditable:!self.rowDescriptor.isDisabled];
-    self.textView.textColor  = self.rowDescriptor.isDisabled ? [UIColor grayColor] : [UIColor blackColor];
-    self.textLabel.text = ((self.rowDescriptor.required && self.rowDescriptor.title && self.rowDescriptor.sectionDescriptor.formDescriptor.addAsteriskToRequiredRowsTitle) ? [NSString stringWithFormat:@"%@*", self.rowDescriptor.title]: self.rowDescriptor.title);
-}
-
-+(CGFloat)formDescriptorCellHeightForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor
-{
-    return 110.f;
-}
-
--(BOOL)formDescriptorCellCanBecomeFirstResponder
-{
-    return (!self.rowDescriptor.isDisabled);
-}
-
--(BOOL)formDescriptorCellBecomeFirstResponder
-{
-    return [self.textView becomeFirstResponder];
-}
-
--(void)highlight
-{
-    [super highlight];
-    self.textLabel.textColor = self.tintColor;
-}
-
--(void)unhighlight
-{
-    [super unhighlight];
-    [self.formViewController updateFormRow:self.rowDescriptor];
-}
-
-#pragma mark - Constraints
-
--(void)updateConstraints
-{
-    if (_dynamicCustomConstraints){
-        [self.contentView removeConstraints:_dynamicCustomConstraints];
-        [_dynamicCustomConstraints removeAllObjects];
-    }
-    NSDictionary * views = @{@"label": self.textLabel, @"textView": self.textView};
-    if (!self.textLabel.text || [self.textLabel.text isEqualToString:@""]){
-        [_dynamicCustomConstraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[textView]-|" options:0 metrics:0 views:views]];
-    }
-    else{
-        [_dynamicCustomConstraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[label]-[textView]-|" options:0 metrics:0 views:views]];
-        if (self.textViewLengthPercentage) {
-            [_dynamicCustomConstraints addObject:[NSLayoutConstraint constraintWithItem:_textView
-                                                                              attribute:NSLayoutAttributeWidth
-                                                                              relatedBy:NSLayoutRelationEqual
-                                                                                 toItem:self.contentView
-                                                                              attribute:NSLayoutAttributeWidth
-                                                                             multiplier:[self.textViewLengthPercentage floatValue]
-                                                                               constant:0.0]];
-        }
-    }
-    [self.contentView addConstraints:_dynamicCustomConstraints];
-    [super updateConstraints];
-}
-
-#pragma mark - UITextViewDelegate
-
--(void)textViewDidBeginEditing:(UITextView *)textView
-{
-    [self.formViewController beginEditing:self.rowDescriptor];
-    return [self.formViewController textViewDidBeginEditing:textView];
-}
-
--(void)textViewDidEndEditing:(UITextView *)textView
-{
-    if ([self.textView.text length] > 0) {
-        self.rowDescriptor.value = self.textView.text;
-    } else {
-        self.rowDescriptor.value = nil;
-    }
-    [self.formViewController endEditing:self.rowDescriptor];
-    [self.formViewController textViewDidEndEditing:textView];
-}
-
-- (BOOL)textViewShouldBeginEditing:(UITextView *)textView
-{
-    return [self.formViewController textViewShouldBeginEditing:textView];
-}
-
--(void)textViewDidChange:(UITextView *)textView{
-    if ([self.textView.text length] > 0) {
-        self.rowDescriptor.value = self.textView.text;
-    } else {
-        self.rowDescriptor.value = nil;
-    }
-}
-
-- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
-    if (self.textViewMaxNumberOfCharacters) {
-        // Check maximum length requirement
-        NSString *newText = [textView.text stringByReplacingCharactersInRange:range withString:text];
-        if (newText.length > self.textViewMaxNumberOfCharacters.integerValue) {
-            return NO;
-        }
-    }
-    
-    // Otherwise, leave response to view controller
-	return [self.formViewController textView:textView shouldChangeTextInRange:range replacementText:text];
-}
-
-@end

+ 0 - 38
iOSClient/Library/XLForm/XL/Controllers/XLFormOptionsObject.h

@@ -1,38 +0,0 @@
-//
-//  XLFormOptionsObject.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 "XLFormRowDescriptor.h"
-#import <Foundation/Foundation.h>
-
-@interface XLFormOptionsObject : NSObject <XLFormOptionObject,NSCoding>
-
-@property (nonatomic) NSString * formDisplaytext;
-@property (nonatomic) id formValue;
-
-+(XLFormOptionsObject *)formOptionsObjectWithValue:(id)value displayText:(NSString *)displayText;
-+(XLFormOptionsObject *)formOptionsOptionForValue:(id)value fromOptions:(NSArray *)options;
-+(XLFormOptionsObject *)formOptionsOptionForDisplayText:(NSString *)displayText fromOptions:(NSArray *)options;
-
-@end

+ 0 - 110
iOSClient/Library/XLForm/XL/Controllers/XLFormOptionsObject.m

@@ -1,110 +0,0 @@
-//
-//  XLFormOptionsObject.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 "XLFormOptionsObject.h"
-
-@implementation XLFormOptionsObject
-
-+(XLFormOptionsObject *)formOptionsObjectWithValue:(id)value displayText:(NSString *)displayText
-{
-    return [[XLFormOptionsObject alloc] initWithValue:value displayText:displayText];
-}
-
--(instancetype)initWithValue:(id)value displayText:(NSString *)displayText
-{
-    self = [super init];
-    if (self){
-        _formValue = value;
-        _formDisplaytext = displayText;
-    }
-    return self;
-}
-
-+(XLFormOptionsObject *)formOptionsOptionForValue:(id)value fromOptions:(NSArray *)options
-{
-    for (XLFormOptionsObject * option in options) {
-        if ([option.formValue isEqual:value]){
-            return option;
-        }
-    }
-    return nil;
-}
-
-+(XLFormOptionsObject *)formOptionsOptionForDisplayText:(NSString *)displayText fromOptions:(NSArray *)options
-{
-    for (XLFormOptionsObject * option in options) {
-        if ([option.formDisplayText isEqualToString:displayText]){
-            return option;
-        }
-    }
-    return nil;
-}
-
--(BOOL)isEqual:(id)object
-{
-    if (![[self class] isEqual:[object class]]){
-        return NO;
-    }
-    return [self.formValue isEqual:((XLFormOptionsObject *)object).formValue];
-}
-
-#pragma mark - XLFormOptionObject
-
--(NSString *)formDisplayText
-{
-    return _formDisplaytext;
-}
-
--(id)formValue
-{
-    return _formValue;
-}
-
-#pragma mark - NSCoding
--(void)encodeWithCoder:(NSCoder *)encoder
-{
-    
-    [encoder encodeObject:self.formValue
-                   forKey:@"formValue"];
-    [encoder encodeObject:self.formDisplayText
-                   forKey:@"formDisplayText"];
-}
-
--(instancetype)initWithCoder:(NSCoder *)decoder
-{
-    if ((self=[super init])) {
-        
-        [self setValue:[decoder decodeObjectForKey:@"formValue"]
-                forKey:@"formValue"];
-        [self setValue:[decoder decodeObjectForKey:@"formDisplayText"]
-                forKey:@"formDisplaytext"];
-        
-    }
-    
-    return self;
-    
-}
-
-@end

+ 0 - 41
iOSClient/Library/XLForm/XL/Controllers/XLFormOptionsViewController.h

@@ -1,41 +0,0 @@
-//
-//  XLFormOptionsViewController.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 "XLFormRowDescriptorViewController.h"
-#import "XLFormRowDescriptor.h"
-
-@interface XLFormOptionsViewController : UITableViewController<XLFormRowDescriptorViewController>
-
-- (instancetype)initWithStyle:(UITableViewStyle)style;
-
-
-- (instancetype)initWithStyle:(UITableViewStyle)style
-    titleHeaderSection:(NSString *)titleHeaderSection
-    titleFooterSection:(NSString *)titleFooterSection;
-
-
-@end

+ 0 - 238
iOSClient/Library/XLForm/XL/Controllers/XLFormOptionsViewController.m

@@ -1,238 +0,0 @@
-//
-//  XLFormOptionsViewController.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 "NSObject+XLFormAdditions.h"
-#import "XLFormOptionsViewController.h"
-#import "XLFormRightDetailCell.h"
-#import "XLForm.h"
-#import "NSObject+XLFormAdditions.h"
-#import "NSArray+XLFormAdditions.h"
-
-#define CELL_REUSE_IDENTIFIER  @"OptionCell"
-
-@interface XLFormOptionsViewController () <UITableViewDataSource>
-
-@property NSString * titleHeaderSection;
-@property NSString * titleFooterSection;
-
-
-@end
-
-@implementation XLFormOptionsViewController
-
-@synthesize titleHeaderSection = _titleHeaderSection;
-@synthesize titleFooterSection = _titleFooterSection;
-@synthesize rowDescriptor = _rowDescriptor;
-
-- (instancetype)initWithStyle:(UITableViewStyle)style
-{
-    self = [super initWithStyle:style];
-    if (self){
-        _titleFooterSection = nil;
-        _titleHeaderSection = nil;
-    }
-    return self;
-}
-
-- (instancetype)initWithStyle:(UITableViewStyle)style titleHeaderSection:(NSString *)titleHeaderSection titleFooterSection:(NSString *)titleFooterSection
-{
-    self = [self initWithStyle:style];
-    if (self){
-        _titleFooterSection = titleFooterSection;
-        _titleHeaderSection = titleHeaderSection;
-    }
-    return self;
-}
-
-- (void)viewDidLoad
-{
-    [super viewDidLoad];
-    // register option cell
-    [self.tableView registerClass:[XLFormRightDetailCell class] forCellReuseIdentifier:CELL_REUSE_IDENTIFIER];
-}
-
-
-#pragma mark - UITableViewDataSource
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
-    return [[self selectorOptions] count];
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    XLFormRightDetailCell * cell = [tableView dequeueReusableCellWithIdentifier:CELL_REUSE_IDENTIFIER forIndexPath:indexPath];
-    id cellObject =  [[self selectorOptions] objectAtIndex:indexPath.row];
-
-    [self.rowDescriptor.cellConfigForSelector enumerateKeysAndObjectsUsingBlock:^(NSString *keyPath, id value, __unused BOOL *stop) {
-        [cell setValue:(value == [NSNull null]) ? nil : value forKeyPath:keyPath];
-    }];
-    
-    cell.textLabel.text = [self valueDisplayTextForOption:cellObject];
-    if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelector] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelectorPopover]){
-        cell.accessoryType = ([self selectedValuesContainsOption:cellObject] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone);
-    }
-    else{
-        if ([[self.rowDescriptor.value valueData] isEqual:[cellObject valueData]]){
-            cell.accessoryType = UITableViewCellAccessoryCheckmark;
-        }
-        else{
-            cell.accessoryType = UITableViewCellAccessoryNone;
-        }
-    }
-    return cell;
-}
-
-
-- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
-{
-    return self.titleFooterSection;
-}
-
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
-{
-    return self.titleHeaderSection;
-}
-
-#pragma mark - UITableViewDelegate
-
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
-    id cellObject =  [[self selectorOptions] objectAtIndex:indexPath.row];
-    if ([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelector] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelectorPopover]){
-        if ([self selectedValuesContainsOption:cellObject]){
-            self.rowDescriptor.value = [self selectedValuesRemoveOption:cellObject];
-            cell.accessoryType = UITableViewCellAccessoryNone;
-        }
-        else{
-            self.rowDescriptor.value = [self selectedValuesAddOption:cellObject];
-            cell.accessoryType = UITableViewCellAccessoryCheckmark;
-        }
-    }
-    else{
-        if ([[self.rowDescriptor.value valueData] isEqual:[cellObject valueData]]){
-            if (!self.rowDescriptor.required){
-                self.rowDescriptor.value = nil;
-				cell.accessoryType = UITableViewCellAccessoryNone;
-            }
-        }
-        else{
-            if (self.rowDescriptor.value){
-                NSInteger index = [[self selectorOptions] formIndexForItem:self.rowDescriptor.value];
-                if (index != NSNotFound){
-                    NSIndexPath * oldSelectedIndexPath = [NSIndexPath indexPathForRow:index inSection:0];
-                    UITableViewCell *oldSelectedCell = [tableView cellForRowAtIndexPath:oldSelectedIndexPath];
-                    oldSelectedCell.accessoryType = UITableViewCellAccessoryNone;
-                }
-            }
-            self.rowDescriptor.value = cellObject;
-            cell.accessoryType = UITableViewCellAccessoryCheckmark;
-        }
-        if (self.modalPresentationStyle == UIModalPresentationPopover){
-            [[self presentingViewController] dismissViewControllerAnimated:YES completion:nil];
-        }
-        else if ([self.parentViewController isKindOfClass:[UINavigationController class]]){
-            [self.navigationController popViewControllerAnimated:YES];
-        }
-    }
-    [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
-}
-
-#pragma mark - Helper
-
--(NSMutableArray *)selectedValues
-{
-    if (self.rowDescriptor.value == nil){
-        return [NSMutableArray array];
-    }
-    NSAssert([self.rowDescriptor.value isKindOfClass:[NSArray class]], @"XLFormRowDescriptor value must be NSMutableArray");
-    return [NSMutableArray arrayWithArray:self.rowDescriptor.value];
-}
-
--(BOOL)selectedValuesContainsOption:(id)option
-{
-    return ([self.selectedValues formIndexForItem:option] != NSNotFound);
-}
-
--(NSMutableArray *)selectedValuesRemoveOption:(id)option
-{
-    for (id selectedValueItem in self.selectedValues) {
-        if ([[selectedValueItem valueData] isEqual:[option valueData]]){
-            NSMutableArray * result = self.selectedValues;
-            [result removeObject:selectedValueItem];
-            return result;
-        }
-    }
-    return self.selectedValues;
-}
-
--(NSMutableArray *)selectedValuesAddOption:(id)option
-{
-    NSAssert([self.selectedValues formIndexForItem:option] == NSNotFound, @"XLFormRowDescriptor value must not contain the option");
-    NSMutableArray * result = self.selectedValues;
-    [result addObject:option];
-    return result;
-}
-
-
-
--(NSString *)valueDisplayTextForOption:(id)option
-{
-    if (self.rowDescriptor.valueTransformer){
-        NSAssert([self.rowDescriptor.valueTransformer isSubclassOfClass:[NSValueTransformer class]], @"valueTransformer is not a subclass of NSValueTransformer");
-        NSValueTransformer * valueTransformer = [self.rowDescriptor.valueTransformer new];
-        NSString * transformedValue = [valueTransformer transformedValue:option];
-        if (transformedValue){
-            return transformedValue;
-        }
-    }
-    return [option displayText];
-}
-
-#pragma mark - Helpers
-
--(NSArray *)selectorOptions
-{
-    if (self.rowDescriptor.rowType == XLFormRowDescriptorTypeSelectorLeftRight){
-        XLFormLeftRightSelectorOption * option = [self leftOptionForOption:self.rowDescriptor.leftRightSelectorLeftOptionSelected];
-        return option.rightOptions;
-    }
-    else{
-        return self.rowDescriptor.selectorOptions;
-    }
-}
-
--(XLFormLeftRightSelectorOption *)leftOptionForOption:(id)option
-{
-    return [[self.rowDescriptor.selectorOptions filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary * __unused bindings) {
-        XLFormLeftRightSelectorOption * evaluatedLeftOption = (XLFormLeftRightSelectorOption *)evaluatedObject;
-        return [evaluatedLeftOption.leftValue isEqual:option];
-    }]] firstObject];
-}
-
-
-@end

+ 0 - 35
iOSClient/Library/XLForm/XL/Controllers/XLFormRowDescriptorViewController.h

@@ -1,35 +0,0 @@
-//
-//  XLFormRowDescriptorViewController.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 "XLFormRowDescriptor.h"
-#import <Foundation/Foundation.h>
-
-@protocol XLFormRowDescriptorViewController <NSObject>
-
-@required
-@property (nonatomic) XLFormRowDescriptor * rowDescriptor;
-
-@end

+ 0 - 96
iOSClient/Library/XLForm/XL/Controllers/XLFormViewController.h

@@ -1,96 +0,0 @@
-//
-//  XLFormViewController.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 <UIKit/UIKit.h>
-#import "XLFormOptionsViewController.h"
-#import "XLFormDescriptor.h"
-#import "XLFormSectionDescriptor.h"
-#import "XLFormDescriptorDelegate.h"
-#import "XLFormRowNavigationAccessoryView.h"
-#import "XLFormBaseCell.h"
-
-@class XLFormViewController;
-@class XLFormRowDescriptor;
-@class XLFormSectionDescriptor;
-@class XLFormDescriptor;
-@class XLFormBaseCell;
-
-typedef NS_ENUM(NSUInteger, XLFormRowNavigationDirection) {
-    XLFormRowNavigationDirectionPrevious = 0,
-    XLFormRowNavigationDirectionNext
-};
-
-@protocol XLFormViewControllerDelegate <NSObject>
-
-@optional
-
--(void)didSelectFormRow:(XLFormRowDescriptor *)formRow;
--(void)deselectFormRow:(XLFormRowDescriptor *)formRow;
--(void)reloadFormRow:(XLFormRowDescriptor *)formRow;
--(XLFormBaseCell *)updateFormRow:(XLFormRowDescriptor *)formRow;
-
--(NSDictionary *)formValues;
--(NSDictionary *)httpParameters;
-
--(XLFormRowDescriptor *)formRowFormMultivaluedFormSection:(XLFormSectionDescriptor *)formSection;
--(void)multivaluedInsertButtonTapped:(XLFormRowDescriptor *)formRow;
--(UIStoryboard *)storyboardForRow:(XLFormRowDescriptor *)formRow;
-
--(NSArray *)formValidationErrors;
--(void)showFormValidationError:(NSError *)error;
--(void)showFormValidationError:(NSError *)error withTitle:(NSString*)title;
-
--(UITableViewRowAnimation)insertRowAnimationForRow:(XLFormRowDescriptor *)formRow;
--(UITableViewRowAnimation)deleteRowAnimationForRow:(XLFormRowDescriptor *)formRow;
--(UITableViewRowAnimation)insertRowAnimationForSection:(XLFormSectionDescriptor *)formSection;
--(UITableViewRowAnimation)deleteRowAnimationForSection:(XLFormSectionDescriptor *)formSection;
-
-// InputAccessoryView
--(UIView *)inputAccessoryViewForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor;
--(XLFormRowDescriptor *)nextRowDescriptorForRow:(XLFormRowDescriptor*)currentRow withDirection:(XLFormRowNavigationDirection)direction;
-
-// highlight/unhighlight
--(void)beginEditing:(XLFormRowDescriptor *)rowDescriptor;
--(void)endEditing:(XLFormRowDescriptor *)rowDescriptor;
-
--(void)ensureRowIsVisible:(XLFormRowDescriptor *)inlineRowDescriptor;
-
-@end
-
-@interface XLFormViewController : UIViewController<UITableViewDataSource, UITableViewDelegate, XLFormDescriptorDelegate, UITextFieldDelegate, UITextViewDelegate, XLFormViewControllerDelegate>
-
-@property XLFormDescriptor * form;
-@property IBOutlet UITableView * tableView;
-
--(instancetype)initWithForm:(XLFormDescriptor *)form;
--(instancetype)initWithForm:(XLFormDescriptor *)form style:(UITableViewStyle)style;
--(instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;
--(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil NS_DESIGNATED_INITIALIZER;
-+(NSMutableDictionary *)cellClassesForRowDescriptorTypes;
-+(NSMutableDictionary *)inlineRowDescriptorTypesForRowDescriptorTypes;
-
--(void)performFormSelector:(SEL)selector withObject:(id)sender;
-
-@end

+ 0 - 1036
iOSClient/Library/XLForm/XL/Controllers/XLFormViewController.m

@@ -1,1036 +0,0 @@
-//
-//  XLFormViewController.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 "UIView+XLFormAdditions.h"
-#import "NSObject+XLFormAdditions.h"
-#import "XLFormViewController.h"
-#import "UIView+XLFormAdditions.h"
-#import "XLForm.h"
-#import "NSString+XLFormAdditions.h"
-
-
-@interface XLFormRowDescriptor(_XLFormViewController)
-
-@property (readonly) NSArray * observers;
--(BOOL)evaluateIsDisabled;
--(BOOL)evaluateIsHidden;
-
-@end
-
-@interface XLFormSectionDescriptor(_XLFormViewController)
-
--(BOOL)evaluateIsHidden;
-
-@end
-
-@interface XLFormDescriptor (_XLFormViewController)
-
-@property NSMutableDictionary* rowObservers;
-
-@end
-
-
-@interface XLFormViewController()
-{
-    NSNumber *_oldBottomTableContentInset;
-    CGRect _keyboardFrame;
-}
-@property UITableViewStyle tableViewStyle;
-@property (nonatomic) XLFormRowNavigationAccessoryView * navigationAccessoryView;
-
-@end
-
-@implementation XLFormViewController
-
-@synthesize form = _form;
-
-#pragma mark - Initialization
-
--(instancetype)initWithForm:(XLFormDescriptor *)form
-{
-    return [self initWithForm:form style:UITableViewStyleGrouped];
-}
-
--(instancetype)initWithForm:(XLFormDescriptor *)form style:(UITableViewStyle)style
-{
-    self = [self initWithNibName:nil bundle:nil];
-    if (self){
-        _tableViewStyle = style;
-        _form = form;
-    }
-    return self;
-}
-
--(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
-{
-    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
-    if (self){
-        _form = nil;
-        _tableViewStyle = UITableViewStyleGrouped;
-    }
-    return self;
-}
-
--(instancetype)initWithCoder:(NSCoder *)aDecoder
-{
-    self = [super initWithCoder:aDecoder];
-    if (self) {
-        _form = nil;
-        _tableViewStyle = UITableViewStyleGrouped;
-    }
-    
-    return self;
-}
-
-- (void)dealloc
-{
-    self.tableView.delegate = nil;
-    self.tableView.dataSource = nil;
-}
-
-- (void)viewDidLoad
-{
-    [super viewDidLoad];
-    if (!self.tableView){
-        self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds
-                                                      style:self.tableViewStyle];
-        self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-        if([self.tableView respondsToSelector:@selector(cellLayoutMarginsFollowReadableWidth)]){
-            self.tableView.cellLayoutMarginsFollowReadableWidth = NO;
-        }
-    }
-    if (!self.tableView.superview){
-        [self.view addSubview:self.tableView];
-    }
-    if (!self.tableView.delegate){
-        self.tableView.delegate = self;
-    }
-    if (!self.tableView.dataSource){
-        self.tableView.dataSource = self;
-    }
-    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")){
-        self.tableView.rowHeight = UITableViewAutomaticDimension;
-        self.tableView.estimatedRowHeight = 44.0;
-    }
-    if (self.form.title){
-        self.title = self.form.title;
-    }
-    [self.tableView setEditing:YES animated:NO];
-    self.tableView.allowsSelectionDuringEditing = YES;
-    self.form.delegate = self;
-    _oldBottomTableContentInset = nil;
-}
-
--(void)viewWillAppear:(BOOL)animated
-{
-    [super viewWillAppear:animated];
-    NSIndexPath *selected = [self.tableView indexPathForSelectedRow];
-    if (selected){
-        // Trigger a cell refresh
-        XLFormRowDescriptor * rowDescriptor = [self.form formRowAtIndex:selected];
-        [self updateFormRow:rowDescriptor];
-        [self.tableView selectRowAtIndexPath:selected animated:NO scrollPosition:UITableViewScrollPositionNone];
-        [self.tableView deselectRowAtIndexPath:selected animated:YES];
-    }
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(contentSizeCategoryChanged:)
-                                                 name:UIContentSizeCategoryDidChangeNotification
-                                               object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(keyboardWillShow:)
-                                                 name:UIKeyboardWillShowNotification
-                                               object:nil];
-
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(keyboardWillHide:)
-                                                 name:UIKeyboardWillHideNotification
-                                               object:nil];
-
-}
-
--(void)viewDidDisappear:(BOOL)animated
-{
-    [super viewDidDisappear:animated];
-    [[NSNotificationCenter defaultCenter] removeObserver:self
-                                                    name:UIContentSizeCategoryDidChangeNotification
-                                                  object:nil];
-    [[NSNotificationCenter defaultCenter] removeObserver:self
-                                                    name:UIKeyboardWillShowNotification
-                                                  object:nil];
-    [[NSNotificationCenter defaultCenter] removeObserver:self
-                                                    name:UIKeyboardWillHideNotification
-                                                  object:nil];
-}
-
-- (void)viewDidAppear:(BOOL)animated
-{
-    [super viewDidAppear:animated];
-    if (self.form.assignFirstResponderOnShow) {
-        self.form.assignFirstResponderOnShow = NO;
-        [self.form setFirstResponder:self];
-    }
-}
-
-- (void)didReceiveMemoryWarning
-{
-    [super didReceiveMemoryWarning];
-}
-
-#pragma mark - CellClasses
-
-+(NSMutableDictionary *)cellClassesForRowDescriptorTypes
-{
-    static NSMutableDictionary * _cellClassesForRowDescriptorTypes;
-
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        _cellClassesForRowDescriptorTypes = [@{XLFormRowDescriptorTypeText:[XLFormTextFieldCell class],
-                                               XLFormRowDescriptorTypeName: [XLFormTextFieldCell class],
-                                               XLFormRowDescriptorTypePhone:[XLFormTextFieldCell class],
-                                               XLFormRowDescriptorTypeURL:[XLFormTextFieldCell class],
-                                               XLFormRowDescriptorTypeEmail: [XLFormTextFieldCell class],
-                                               XLFormRowDescriptorTypeTwitter: [XLFormTextFieldCell class],
-                                               XLFormRowDescriptorTypeAccount: [XLFormTextFieldCell class],
-                                               XLFormRowDescriptorTypePassword: [XLFormTextFieldCell class],
-                                               XLFormRowDescriptorTypeNumber: [XLFormTextFieldCell class],
-                                               XLFormRowDescriptorTypeInteger: [XLFormTextFieldCell class],
-                                               XLFormRowDescriptorTypeDecimal: [XLFormTextFieldCell class],
-                                               XLFormRowDescriptorTypeZipCode: [XLFormTextFieldCell class],
-                                               XLFormRowDescriptorTypeSelectorPush: [XLFormSelectorCell class],
-                                               XLFormRowDescriptorTypeSelectorPopover: [XLFormSelectorCell class],
-                                               XLFormRowDescriptorTypeSelectorActionSheet: [XLFormSelectorCell class],
-                                               XLFormRowDescriptorTypeSelectorAlertView: [XLFormSelectorCell class],
-                                               XLFormRowDescriptorTypeSelectorPickerView: [XLFormSelectorCell class],
-                                               XLFormRowDescriptorTypeSelectorPickerViewInline: [XLFormInlineSelectorCell class],
-                                               XLFormRowDescriptorTypeSelectorSegmentedControl: [XLFormSegmentedCell class],
-                                               XLFormRowDescriptorTypeMultipleSelector: [XLFormSelectorCell class],
-                                               XLFormRowDescriptorTypeMultipleSelectorPopover: [XLFormSelectorCell class],
-                                               XLFormRowDescriptorTypeImage: [XLFormImageCell class],
-                                               XLFormRowDescriptorTypeTextView: [XLFormTextViewCell class],
-                                               XLFormRowDescriptorTypeButton: [XLFormButtonCell class],
-                                               XLFormRowDescriptorTypeInfo: [XLFormSelectorCell class],
-                                               XLFormRowDescriptorTypeBooleanSwitch : [XLFormSwitchCell class],
-                                               XLFormRowDescriptorTypeBooleanCheck : [XLFormCheckCell class],
-                                               XLFormRowDescriptorTypeDate: [XLFormDateCell class],
-                                               XLFormRowDescriptorTypeTime: [XLFormDateCell class],
-                                               XLFormRowDescriptorTypeDateTime : [XLFormDateCell class],
-                                               XLFormRowDescriptorTypeCountDownTimer : [XLFormDateCell class],
-                                               XLFormRowDescriptorTypeDateInline: [XLFormDateCell class],
-                                               XLFormRowDescriptorTypeTimeInline: [XLFormDateCell class],
-                                               XLFormRowDescriptorTypeDateTimeInline: [XLFormDateCell class],
-                                               XLFormRowDescriptorTypeCountDownTimerInline : [XLFormDateCell class],
-                                               XLFormRowDescriptorTypeDatePicker : [XLFormDatePickerCell class],
-                                               XLFormRowDescriptorTypePicker : [XLFormPickerCell class],
-                                               XLFormRowDescriptorTypeSlider : [XLFormSliderCell class],
-                                               XLFormRowDescriptorTypeSelectorLeftRight : [XLFormLeftRightSelectorCell class],
-                                               XLFormRowDescriptorTypeStepCounter: [XLFormStepCounterCell class]
-                                               } mutableCopy];
-    });
-    return _cellClassesForRowDescriptorTypes;
-}
-
-#pragma mark - inlineRowDescriptorTypes
-
-+(NSMutableDictionary *)inlineRowDescriptorTypesForRowDescriptorTypes
-{
-    static NSMutableDictionary * _inlineRowDescriptorTypesForRowDescriptorTypes;
-
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        _inlineRowDescriptorTypesForRowDescriptorTypes = [
-                                                          @{XLFormRowDescriptorTypeSelectorPickerViewInline: XLFormRowDescriptorTypePicker,
-                                                            XLFormRowDescriptorTypeDateInline: XLFormRowDescriptorTypeDatePicker,
-                                                            XLFormRowDescriptorTypeDateTimeInline: XLFormRowDescriptorTypeDatePicker,
-                                                            XLFormRowDescriptorTypeTimeInline: XLFormRowDescriptorTypeDatePicker,
-                                                            XLFormRowDescriptorTypeCountDownTimerInline: XLFormRowDescriptorTypeDatePicker
-                                                            } mutableCopy];
-    });
-    return _inlineRowDescriptorTypesForRowDescriptorTypes;
-}
-
-#pragma mark - XLFormDescriptorDelegate
-
--(void)formRowHasBeenAdded:(XLFormRowDescriptor *)formRow atIndexPath:(NSIndexPath *)indexPath
-{
-    [self.tableView beginUpdates];
-    [self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:[self insertRowAnimationForRow:formRow]];
-    [self.tableView endUpdates];
-}
-
--(void)formRowHasBeenRemoved:(XLFormRowDescriptor *)formRow atIndexPath:(NSIndexPath *)indexPath
-{
-    [self.tableView beginUpdates];
-    [self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:[self deleteRowAnimationForRow:formRow]];
-    [self.tableView endUpdates];
-}
-
--(void)formSectionHasBeenRemoved:(XLFormSectionDescriptor *)formSection atIndex:(NSUInteger)index
-{
-    [self.tableView beginUpdates];
-    [self.tableView deleteSections:[NSIndexSet indexSetWithIndex:index] withRowAnimation:[self deleteRowAnimationForSection:formSection]];
-    [self.tableView endUpdates];
-}
-
--(void)formSectionHasBeenAdded:(XLFormSectionDescriptor *)formSection atIndex:(NSUInteger)index
-{
-    [self.tableView beginUpdates];
-    [self.tableView insertSections:[NSIndexSet indexSetWithIndex:index] withRowAnimation:[self insertRowAnimationForSection:formSection]];
-    [self.tableView endUpdates];
-}
-
--(void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)formRow oldValue:(id)oldValue newValue:(id)newValue
-{
-    [self updateAfterDependentRowChanged:formRow];
-}
-
--(void)formRowDescriptorPredicateHasChanged:(XLFormRowDescriptor *)formRow oldValue:(id)oldValue newValue:(id)newValue predicateType:(XLPredicateType)predicateType
-{
-    if (oldValue != newValue) {
-        [self updateAfterDependentRowChanged:formRow];
-    }
-}
-
--(void)updateAfterDependentRowChanged:(XLFormRowDescriptor *)formRow
-{
-    NSMutableArray* revaluateHidden   = self.form.rowObservers[[formRow.tag formKeyForPredicateType:XLPredicateTypeHidden]];
-    NSMutableArray* revaluateDisabled = self.form.rowObservers[[formRow.tag formKeyForPredicateType:XLPredicateTypeDisabled]];
-    for (id object in revaluateDisabled) {
-        if ([object isKindOfClass:[NSString class]]) {
-            XLFormRowDescriptor* row = [self.form formRowWithTag:object];
-            if (row){
-                [row evaluateIsDisabled];
-                [self updateFormRow:row];
-            }
-        }
-    }
-    for (id object in revaluateHidden) {
-        if ([object isKindOfClass:[NSString class]]) {
-            XLFormRowDescriptor* row = [self.form formRowWithTag:object];
-            if (row){
-                [row evaluateIsHidden];
-            }
-        }
-        else if ([object isKindOfClass:[XLFormSectionDescriptor class]]) {
-            XLFormSectionDescriptor* section = (XLFormSectionDescriptor*) object;
-            [section evaluateIsHidden];
-        }
-    }
-}
-
-#pragma mark - XLFormViewControllerDelegate
-
--(NSDictionary *)formValues
-{
-    return [self.form formValues];
-}
-
--(NSDictionary *)httpParameters
-{
-    return [self.form httpParameters:self];
-}
-
-
--(void)didSelectFormRow:(XLFormRowDescriptor *)formRow
-{
-    if ([[formRow cellForFormController:self] respondsToSelector:@selector(formDescriptorCellDidSelectedWithFormController:)]){
-        [[formRow cellForFormController:self] formDescriptorCellDidSelectedWithFormController:self];
-    }
-}
-
--(UITableViewRowAnimation)insertRowAnimationForRow:(XLFormRowDescriptor *)formRow
-{
-    if (formRow.sectionDescriptor.sectionOptions & XLFormSectionOptionCanInsert){
-        if (formRow.sectionDescriptor.sectionInsertMode == XLFormSectionInsertModeButton){
-            return UITableViewRowAnimationAutomatic;
-        }
-        else if (formRow.sectionDescriptor.sectionInsertMode == XLFormSectionInsertModeLastRow){
-            return YES;
-        }
-    }
-    return UITableViewRowAnimationFade;
-}
-
--(UITableViewRowAnimation)deleteRowAnimationForRow:(XLFormRowDescriptor *)formRow
-{
-    return UITableViewRowAnimationFade;
-}
-
--(UITableViewRowAnimation)insertRowAnimationForSection:(XLFormSectionDescriptor *)formSection
-{
-    return UITableViewRowAnimationAutomatic;
-}
-
--(UITableViewRowAnimation)deleteRowAnimationForSection:(XLFormSectionDescriptor *)formSection
-{
-    return UITableViewRowAnimationAutomatic;
-}
-
--(UIView *)inputAccessoryViewForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor
-{
-    if ((self.form.rowNavigationOptions & XLFormRowNavigationOptionEnabled) != XLFormRowNavigationOptionEnabled){
-        return nil;
-    }
-    if ([[[[self class] inlineRowDescriptorTypesForRowDescriptorTypes] allKeys] containsObject:rowDescriptor.rowType]) {
-        return nil;
-    }
-    UITableViewCell<XLFormDescriptorCell> * cell = (UITableViewCell<XLFormDescriptorCell> *)[rowDescriptor cellForFormController:self];
-    if (![cell formDescriptorCellCanBecomeFirstResponder]){
-        return nil;
-    }
-    XLFormRowDescriptor * previousRow = [self nextRowDescriptorForRow:rowDescriptor
-                                                            withDirection:XLFormRowNavigationDirectionPrevious];
-    XLFormRowDescriptor * nextRow     = [self nextRowDescriptorForRow:rowDescriptor
-                                                            withDirection:XLFormRowNavigationDirectionNext];
-    [self.navigationAccessoryView.previousButton setEnabled:(previousRow != nil)];
-    [self.navigationAccessoryView.nextButton setEnabled:(nextRow != nil)];
-    return self.navigationAccessoryView;
-}
-
--(void)beginEditing:(XLFormRowDescriptor *)rowDescriptor
-{
-    [[rowDescriptor cellForFormController:self] highlight];
-}
-
--(void)endEditing:(XLFormRowDescriptor *)rowDescriptor
-{
-    [[rowDescriptor cellForFormController:self] unhighlight];
-}
-
--(XLFormRowDescriptor *)formRowFormMultivaluedFormSection:(XLFormSectionDescriptor *)formSection
-{
-    if (formSection.multivaluedRowTemplate){
-        return [formSection.multivaluedRowTemplate copy];
-    }
-    XLFormRowDescriptor * formRowDescriptor = [[formSection.formRows objectAtIndex:0] copy];
-    formRowDescriptor.tag = nil;
-    return formRowDescriptor;
-}
-
--(void)multivaluedInsertButtonTapped:(XLFormRowDescriptor *)formRow
-{
-    [self deselectFormRow:formRow];
-    XLFormSectionDescriptor * multivaluedFormSection = formRow.sectionDescriptor;
-    XLFormRowDescriptor * formRowDescriptor = [self formRowFormMultivaluedFormSection:multivaluedFormSection];
-    [multivaluedFormSection addFormRow:formRowDescriptor];
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.02 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        self.tableView.editing = !self.tableView.editing;
-        self.tableView.editing = !self.tableView.editing;
-    });
-    UITableViewCell<XLFormDescriptorCell> * cell = (UITableViewCell<XLFormDescriptorCell> *)[formRowDescriptor cellForFormController:self];
-    if ([cell formDescriptorCellCanBecomeFirstResponder]){
-        [cell formDescriptorCellBecomeFirstResponder];
-    }
-}
-
--(void)ensureRowIsVisible:(XLFormRowDescriptor *)inlineRowDescriptor
-{
-    XLFormBaseCell * inlineCell = [inlineRowDescriptor cellForFormController:self];
-    NSIndexPath * indexOfOutOfWindowCell = [self.form indexPathOfFormRow:inlineRowDescriptor];
-    if(!inlineCell.window || (self.tableView.contentOffset.y + self.tableView.frame.size.height <= inlineCell.frame.origin.y + inlineCell.frame.size.height)){
-        [self.tableView scrollToRowAtIndexPath:indexOfOutOfWindowCell atScrollPosition:UITableViewScrollPositionBottom animated:YES];
-    }
-}
-
-#pragma mark - Methods
-
--(NSArray *)formValidationErrors
-{
-    return [self.form localValidationErrors:self];
-}
-
--(void)showFormValidationError:(NSError *)error
-{
-    UIAlertController * alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"XLFormViewController_ValidationErrorTitle", nil)
-                                                                              message:error.localizedDescription
-                                                                       preferredStyle:UIAlertControllerStyleAlert];
-    [alertController addAction:[UIAlertAction actionWithTitle:@"OK"
-                                                        style:UIAlertActionStyleDefault
-                                                      handler:nil]];
-    [self presentViewController:alertController animated:YES completion:nil];
-}
-
--(void)showFormValidationError:(NSError *)error withTitle:(NSString*)title
-{
-    UIAlertController * alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(title, nil)
-                                                                              message:error.localizedDescription
-                                                                       preferredStyle:UIAlertControllerStyleAlert];
-    [alertController addAction:[UIAlertAction actionWithTitle:@"OK"
-                                                        style:UIAlertActionStyleDefault
-                                                      handler:nil]];
-    [self presentViewController:alertController animated:YES completion:nil];
-}
-
--(void)performFormSelector:(SEL)selector withObject:(id)sender
-{
-    UIResponder * responder = [self targetForAction:selector withSender:sender];;
-    if (responder) {
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warc-performSelector-leaks"
-        [responder performSelector:selector withObject:sender];
-#pragma GCC diagnostic pop
-    }
-}
-
-#pragma mark - Private
-
-- (void)contentSizeCategoryChanged:(NSNotification *)notification
-{
-    [self.tableView reloadData];
-}
-
-- (void)keyboardWillShow:(NSNotification *)notification
-{
-    UIView * firstResponderView = [self.tableView findFirstResponder];
-    UITableViewCell<XLFormDescriptorCell> * cell = [firstResponderView formDescriptorCell];
-    if (cell){
-        NSDictionary *keyboardInfo = [notification userInfo];
-        _keyboardFrame = [self.tableView.window convertRect:[keyboardInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue] toView:self.tableView.superview];
-        CGFloat newBottomInset = self.tableView.frame.origin.y + self.tableView.frame.size.height - _keyboardFrame.origin.y;
-        UIEdgeInsets tableContentInset = self.tableView.contentInset;
-        UIEdgeInsets tableScrollIndicatorInsets = self.tableView.scrollIndicatorInsets;
-        _oldBottomTableContentInset = _oldBottomTableContentInset ?: @(tableContentInset.bottom);
-        if (newBottomInset > [_oldBottomTableContentInset floatValue]){
-            tableContentInset.bottom = newBottomInset;
-            tableScrollIndicatorInsets.bottom = tableContentInset.bottom;
-            [UIView beginAnimations:nil context:nil];
-            [UIView setAnimationDuration:[keyboardInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue]];
-            [UIView setAnimationCurve:[keyboardInfo[UIKeyboardAnimationCurveUserInfoKey] intValue]];
-            self.tableView.contentInset = tableContentInset;
-            self.tableView.scrollIndicatorInsets = tableScrollIndicatorInsets;
-            NSIndexPath *selectedRow = [self.tableView indexPathForCell:cell];
-            [self.tableView scrollToRowAtIndexPath:selectedRow atScrollPosition:UITableViewScrollPositionNone animated:NO];
-            [UIView commitAnimations];
-        }
-    }
-}
-
-- (void)keyboardWillHide:(NSNotification *)notification
-{
-    UIView * firstResponderView = [self.tableView findFirstResponder];
-    UITableViewCell<XLFormDescriptorCell> * cell = [firstResponderView formDescriptorCell];
-    if (cell){
-        _keyboardFrame = CGRectZero;
-        NSDictionary *keyboardInfo = [notification userInfo];
-        UIEdgeInsets tableContentInset = self.tableView.contentInset;
-        UIEdgeInsets tableScrollIndicatorInsets = self.tableView.scrollIndicatorInsets;
-        tableContentInset.bottom = [_oldBottomTableContentInset floatValue];
-        tableScrollIndicatorInsets.bottom = tableContentInset.bottom;
-        _oldBottomTableContentInset = nil;
-        [UIView beginAnimations:nil context:nil];
-        [UIView setAnimationDuration:[keyboardInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue]];
-        [UIView setAnimationCurve:[keyboardInfo[UIKeyboardAnimationCurveUserInfoKey] intValue]];
-        self.tableView.contentInset = tableContentInset;
-        self.tableView.scrollIndicatorInsets = tableScrollIndicatorInsets;
-        [UIView commitAnimations];
-    }
-}
-
-#pragma mark - Helpers
-
--(void)deselectFormRow:(XLFormRowDescriptor *)formRow
-{
-    NSIndexPath * indexPath = [self.form indexPathOfFormRow:formRow];
-    if (indexPath){
-        [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
-    }
-}
-
--(void)reloadFormRow:(XLFormRowDescriptor *)formRow
-{
-    NSIndexPath * indexPath = [self.form indexPathOfFormRow:formRow];
-    if (indexPath){
-        [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
-    }
-}
-
--(XLFormBaseCell *)updateFormRow:(XLFormRowDescriptor *)formRow
-{
-    XLFormBaseCell * cell = [formRow cellForFormController:self];
-    [self configureCell:cell];
-    [cell setNeedsUpdateConstraints];
-    [cell setNeedsLayout];
-    return cell;
-}
-
--(void)configureCell:(XLFormBaseCell*) cell
-{
-    [cell update];
-    [cell.rowDescriptor.cellConfig enumerateKeysAndObjectsUsingBlock:^(NSString *keyPath, id value, BOOL * __unused stop) {
-        [cell setValue:(value == [NSNull null]) ? nil : value forKeyPath:keyPath];
-    }];
-    if (cell.rowDescriptor.isDisabled){
-        [cell.rowDescriptor.cellConfigIfDisabled enumerateKeysAndObjectsUsingBlock:^(NSString *keyPath, id value, BOOL * __unused stop) {
-            [cell setValue:(value == [NSNull null]) ? nil : value forKeyPath:keyPath];
-        }];
-    }
-}
-
-#pragma mark - UITableViewDataSource
-
--(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
-    return [self.form.formSections count];
-}
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
-    if (section >= self.form.formSections.count){
-        @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"" userInfo:nil];
-    }
-    return [[[self.form.formSections objectAtIndex:section] formRows] count];
-}
-
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    XLFormRowDescriptor * rowDescriptor = [self.form formRowAtIndex:indexPath];
-    [self updateFormRow:rowDescriptor];
-    return [rowDescriptor cellForFormController:self];
-}
-
-
--(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    XLFormRowDescriptor *rowDescriptor = [self.form formRowAtIndex:indexPath];
-    if (rowDescriptor.isDisabled || !rowDescriptor.sectionDescriptor.isMultivaluedSection){
-        return NO;
-    }
-    XLFormBaseCell * baseCell = [rowDescriptor cellForFormController:self];
-    if ([baseCell conformsToProtocol:@protocol(XLFormInlineRowDescriptorCell)] && ((id<XLFormInlineRowDescriptorCell>)baseCell).inlineRowDescriptor){
-        return NO;
-    }
-    return YES;
-}
-
-- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
-    XLFormRowDescriptor *rowDescriptor = [self.form formRowAtIndex:indexPath];
-    XLFormSectionDescriptor * section = rowDescriptor.sectionDescriptor;
-    if (section.sectionOptions & XLFormSectionOptionCanReorder && section.formRows.count > 1) {
-        if (section.sectionInsertMode == XLFormSectionInsertModeButton && section.sectionOptions & XLFormSectionOptionCanInsert){
-            if (section.formRows.count <= 2 || rowDescriptor == section.multivaluedAddButton){
-                return NO;
-            }
-        }
-        XLFormBaseCell * baseCell = [rowDescriptor cellForFormController:self];
-        return !([baseCell conformsToProtocol:@protocol(XLFormInlineRowDescriptorCell)] && ((id<XLFormInlineRowDescriptorCell>)baseCell).inlineRowDescriptor);
-    }
-    return NO;
-}
-
-
-- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath
-{
-    XLFormRowDescriptor * row = [self.form formRowAtIndex:sourceIndexPath];
-    XLFormSectionDescriptor * section = row.sectionDescriptor;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Warc-performSelector-leaks"
-    [section performSelector:NSSelectorFromString(@"moveRowAtIndexPath:toIndexPath:") withObject:sourceIndexPath withObject:destinationIndexPath];
-#pragma GCC diagnostic pop
-    // update the accessory view
-    [self inputAccessoryViewForRowDescriptor:row];
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-        self.tableView.editing = !self.tableView.editing;
-        self.tableView.editing = !self.tableView.editing;
-    });
-
-}
-
--(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    if (editingStyle == UITableViewCellEditingStyleDelete){
-        XLFormRowDescriptor * multivaluedFormRow = [self.form formRowAtIndex:indexPath];
-        // end editing
-        UIView * firstResponder = [[multivaluedFormRow cellForFormController:self] findFirstResponder];
-        if (firstResponder){
-                [self.tableView endEditing:YES];
-        }
-        [multivaluedFormRow.sectionDescriptor removeFormRowAtIndex:indexPath.row];
-        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.02 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-            self.tableView.editing = !self.tableView.editing;
-            self.tableView.editing = !self.tableView.editing;
-        });
-        if (firstResponder){
-            UITableViewCell<XLFormDescriptorCell> * firstResponderCell = [firstResponder formDescriptorCell];
-            XLFormRowDescriptor * rowDescriptor = firstResponderCell.rowDescriptor;
-            [self inputAccessoryViewForRowDescriptor:rowDescriptor];
-        }
-    }
-    else if (editingStyle == UITableViewCellEditingStyleInsert){
-
-        XLFormSectionDescriptor * multivaluedFormSection = [self.form formSectionAtIndex:indexPath.section];
-        if (multivaluedFormSection.sectionInsertMode == XLFormSectionInsertModeButton && multivaluedFormSection.sectionOptions & XLFormSectionOptionCanInsert){
-            [self multivaluedInsertButtonTapped:multivaluedFormSection.multivaluedAddButton];
-        }
-        else{
-            XLFormRowDescriptor * formRowDescriptor = [self formRowFormMultivaluedFormSection:multivaluedFormSection];
-            [multivaluedFormSection addFormRow:formRowDescriptor];
-            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.02 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-                self.tableView.editing = !self.tableView.editing;
-                self.tableView.editing = !self.tableView.editing;
-            });
-            [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:indexPath.row + 1 inSection:indexPath.section] atScrollPosition:UITableViewScrollPositionBottom animated:YES];
-            UITableViewCell<XLFormDescriptorCell> * cell = (UITableViewCell<XLFormDescriptorCell> *)[formRowDescriptor cellForFormController:self];
-            if ([cell formDescriptorCellCanBecomeFirstResponder]){
-                [cell formDescriptorCellBecomeFirstResponder];
-            }
-        }
-    }
-}
-
-#pragma mark - UITableViewDelegate
-
--(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
-{
-    return [[self.form.formSections objectAtIndex:section] title];
-}
-
--(NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
-{
-    return [[self.form.formSections objectAtIndex:section] footerTitle];
-}
-
--(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    XLFormRowDescriptor *rowDescriptor = [self.form formRowAtIndex:indexPath];
-    [rowDescriptor cellForFormController:self];
-    CGFloat height = rowDescriptor.height;
-    if (height != XLFormUnspecifiedCellHeight){
-        return height;
-    }
-    return self.tableView.rowHeight;
-}
-
--(CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    XLFormRowDescriptor *rowDescriptor = [self.form formRowAtIndex:indexPath];
-    [rowDescriptor cellForFormController:self];
-    CGFloat height = rowDescriptor.height;
-    if (height != XLFormUnspecifiedCellHeight){
-        return height;
-    }
-    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")){
-        return self.tableView.estimatedRowHeight;
-    }
-    return 44;
-}
-
--(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    XLFormRowDescriptor * row = [self.form formRowAtIndex:indexPath];
-    if (row.isDisabled) {
-        return;
-    }
-    UITableViewCell<XLFormDescriptorCell> * cell = (UITableViewCell<XLFormDescriptorCell> *)[row cellForFormController:self];
-    if (!([cell formDescriptorCellCanBecomeFirstResponder] && [cell formDescriptorCellBecomeFirstResponder])){
-        [self.tableView endEditing:YES];
-    }
-    [self didSelectFormRow:row];
-}
-
--(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    XLFormRowDescriptor * row = [self.form formRowAtIndex:indexPath];
-    XLFormSectionDescriptor * section = row.sectionDescriptor;
-    if (section.sectionOptions & XLFormSectionOptionCanInsert){
-        if (section.formRows.count == indexPath.row + 2){
-            if ([[XLFormViewController inlineRowDescriptorTypesForRowDescriptorTypes].allKeys containsObject:row.rowType]){
-                UITableViewCell<XLFormDescriptorCell> * cell = [row cellForFormController:self];
-                UIView * firstResponder = [cell findFirstResponder];
-                if (firstResponder){
-                    return UITableViewCellEditingStyleInsert;
-                }
-            }
-        }
-        else if (section.formRows.count == (indexPath.row + 1)){
-            return UITableViewCellEditingStyleInsert;
-        }
-    }
-    if (section.sectionOptions & XLFormSectionOptionCanDelete){
-        return UITableViewCellEditingStyleDelete;
-    }
-    return UITableViewCellEditingStyleNone;
-}
-
-
-- (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath
-       toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath
-{
-    if (sourceIndexPath.section != proposedDestinationIndexPath.section) {
-        return sourceIndexPath;
-    }
-    XLFormSectionDescriptor * sectionDescriptor = [self.form formSectionAtIndex:sourceIndexPath.section];
-    XLFormRowDescriptor * proposedDestination = [sectionDescriptor.formRows objectAtIndex:proposedDestinationIndexPath.row];
-    XLFormBaseCell * proposedDestinationCell = [proposedDestination cellForFormController:self];
-    if (([proposedDestinationCell conformsToProtocol:@protocol(XLFormInlineRowDescriptorCell)] && ((id<XLFormInlineRowDescriptorCell>)proposedDestinationCell).inlineRowDescriptor) || ([[XLFormViewController inlineRowDescriptorTypesForRowDescriptorTypes].allKeys containsObject:proposedDestinationCell.rowDescriptor.rowType] && [[proposedDestinationCell findFirstResponder] formDescriptorCell] == proposedDestinationCell)) {
-        if (sourceIndexPath.row < proposedDestinationIndexPath.row){
-            return [NSIndexPath indexPathForRow:proposedDestinationIndexPath.row + 1 inSection:sourceIndexPath.section];
-        }
-        else{
-            return [NSIndexPath indexPathForRow:proposedDestinationIndexPath.row - 1 inSection:sourceIndexPath.section];
-        }
-    }
-
-    if ((sectionDescriptor.sectionInsertMode == XLFormSectionInsertModeButton && sectionDescriptor.sectionOptions & XLFormSectionOptionCanInsert)){
-        if (proposedDestinationIndexPath.row == sectionDescriptor.formRows.count - 1){
-            return [NSIndexPath indexPathForRow:(sectionDescriptor.formRows.count - 2) inSection:sourceIndexPath.section];
-        }
-    }
-    return proposedDestinationIndexPath;
-}
-
-- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    UITableViewCellEditingStyle editingStyle = [self tableView:tableView editingStyleForRowAtIndexPath:indexPath];
-    if (editingStyle == UITableViewCellEditingStyleNone){
-        return NO;
-    }
-    return YES;
-}
-
-- (void)tableView:(UITableView *)tableView willBeginReorderingRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    // end editing if inline cell is first responder
-    UITableViewCell<XLFormDescriptorCell> * cell = [[self.tableView findFirstResponder] formDescriptorCell];
-    if ([[self.form indexPathOfFormRow:cell.rowDescriptor] isEqual:indexPath]){
-        if ([[XLFormViewController inlineRowDescriptorTypesForRowDescriptorTypes].allKeys containsObject:cell.rowDescriptor.rowType]){
-            [self.tableView endEditing:YES];
-        }
-    }
-}
-
-#pragma mark - UITextFieldDelegate
-
-
-- (BOOL)textFieldShouldClear:(UITextField *)textField
-{
-    return YES;
-}
-
-- (BOOL)textFieldShouldReturn:(UITextField *)textField
-{
-    // called when 'return' key pressed. return NO to ignore.
-    UITableViewCell<XLFormDescriptorCell> * cell = [textField formDescriptorCell];
-    XLFormRowDescriptor * currentRow = cell.rowDescriptor;
-    XLFormRowDescriptor * nextRow = [self nextRowDescriptorForRow:currentRow
-                                                    withDirection:XLFormRowNavigationDirectionNext];
-    if (nextRow){
-        UITableViewCell<XLFormDescriptorCell> * nextCell = (UITableViewCell<XLFormDescriptorCell> *)[nextRow cellForFormController:self];
-        if ([nextCell formDescriptorCellCanBecomeFirstResponder]){
-            [nextCell formDescriptorCellBecomeFirstResponder];
-            return YES;
-        }
-    }
-    [self.tableView endEditing:YES];
-    return YES;
-}
-
-- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
-{
-    UITableViewCell<XLFormDescriptorCell>* cell = textField.formDescriptorCell;
-    XLFormRowDescriptor * nextRow     = [self nextRowDescriptorForRow:textField.formDescriptorCell.rowDescriptor
-                                                        withDirection:XLFormRowNavigationDirectionNext];
-    
-    
-    if ([cell conformsToProtocol:@protocol(XLFormReturnKeyProtocol)]) {
-        textField.returnKeyType = nextRow ? ((id<XLFormReturnKeyProtocol>)cell).nextReturnKeyType : ((id<XLFormReturnKeyProtocol>)cell).returnKeyType;
-    }
-    else {
-        textField.returnKeyType = nextRow ? UIReturnKeyNext : UIReturnKeyDefault;
-    }
-    return YES;
-}
-
-- (BOOL)textFieldShouldEndEditing:(UITextField *)textField
-{
-    return YES;
-}
-
-- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
-    return YES;
-}
-
-- (void)textFieldDidBeginEditing:(UITextField *)textField
-{
-}
-
--(void)textFieldDidEndEditing:(UITextField *)textField
-{
-}
-
-#pragma mark - UITextViewDelegate
-
-- (BOOL)textViewShouldBeginEditing:(UITextView *)textView
-{
-    return YES;
-}
-
--(void)textViewDidBeginEditing:(UITextView *)textView
-{
-}
-
--(void)textViewDidEndEditing:(UITextView *)textView
-{
-}
-
-- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
-	return YES;
-}
-
-#pragma mark - UIScrollViewDelegate
-
-- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
-{
-    //dismiss keyboard
-    if (NO == self.form.endEditingTableViewOnScroll) {
-        return;
-    }
-
-    UIView * firstResponder = [self.tableView findFirstResponder];
-    if ([firstResponder conformsToProtocol:@protocol(XLFormDescriptorCell)]){
-        id<XLFormDescriptorCell> cell = (id<XLFormDescriptorCell>)firstResponder;
-        if ([[XLFormViewController inlineRowDescriptorTypesForRowDescriptorTypes].allKeys containsObject:cell.rowDescriptor.rowType]){
-            return;
-        }
-    }
-    [self.tableView endEditing:YES];
-}
-
-
-#pragma mark - Segue
-
--(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
-{
-    if ([sender isKindOfClass:[XLFormRowDescriptor class]]){
-        UIViewController * destinationViewController = segue.destinationViewController;
-        XLFormRowDescriptor * rowDescriptor = (XLFormRowDescriptor *)sender;
-        if (rowDescriptor.rowType == XLFormRowDescriptorTypeSelectorPush || rowDescriptor.rowType == XLFormRowDescriptorTypeSelectorPopover){
-            NSAssert([destinationViewController conformsToProtocol:@protocol(XLFormRowDescriptorViewController)], @"Segue destinationViewController must conform to XLFormRowDescriptorViewController protocol");
-            UIViewController<XLFormRowDescriptorViewController> * rowDescriptorViewController = (UIViewController<XLFormRowDescriptorViewController> *)destinationViewController;
-            rowDescriptorViewController.rowDescriptor = rowDescriptor;
-        }
-        else if ([destinationViewController conformsToProtocol:@protocol(XLFormRowDescriptorViewController)]){
-            UIViewController<XLFormRowDescriptorViewController> * rowDescriptorViewController = (UIViewController<XLFormRowDescriptorViewController> *)destinationViewController;
-            rowDescriptorViewController.rowDescriptor = rowDescriptor;
-        }
-    }
-}
-
-#pragma mark - Navigation Between Fields
-
-
--(void)rowNavigationAction:(UIBarButtonItem *)sender
-{
-    [self navigateToDirection:(sender == self.navigationAccessoryView.nextButton ? XLFormRowNavigationDirectionNext : XLFormRowNavigationDirectionPrevious)];
-}
-
--(void)rowNavigationDone:(UIBarButtonItem *)sender
-{
-    [self.tableView endEditing:YES];
-}
-
--(void)navigateToDirection:(XLFormRowNavigationDirection)direction
-{
-    UIView * firstResponder = [self.tableView findFirstResponder];
-    UITableViewCell<XLFormDescriptorCell> * currentCell = [firstResponder formDescriptorCell];
-    NSIndexPath * currentIndexPath = [self.tableView indexPathForCell:currentCell];
-    XLFormRowDescriptor * currentRow = [self.form formRowAtIndex:currentIndexPath];
-    XLFormRowDescriptor * nextRow = [self nextRowDescriptorForRow:currentRow withDirection:direction];
-    if (nextRow) {
-        UITableViewCell<XLFormDescriptorCell> * cell = (UITableViewCell<XLFormDescriptorCell> *)[nextRow cellForFormController:self];
-        if ([cell formDescriptorCellCanBecomeFirstResponder]){
-            NSIndexPath * indexPath = [self.form indexPathOfFormRow:nextRow];
-            [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionNone animated:NO];
-            [cell formDescriptorCellBecomeFirstResponder];
-        }
-    }
-}
-
--(XLFormRowDescriptor *)nextRowDescriptorForRow:(XLFormRowDescriptor*)currentRow withDirection:(XLFormRowNavigationDirection)direction
-{
-    if (!currentRow || (self.form.rowNavigationOptions & XLFormRowNavigationOptionEnabled) != XLFormRowNavigationOptionEnabled) {
-        return nil;
-    }
-    XLFormRowDescriptor * nextRow = (direction == XLFormRowNavigationDirectionNext) ? [self.form nextRowDescriptorForRow:currentRow] : [self.form previousRowDescriptorForRow:currentRow];
-    if (!nextRow) {
-        return nil;
-    }
-    if ([[nextRow cellForFormController:self] conformsToProtocol:@protocol(XLFormInlineRowDescriptorCell)]) {
-        id<XLFormInlineRowDescriptorCell> inlineCell = (id<XLFormInlineRowDescriptorCell>)[nextRow cellForFormController:self];
-        if (inlineCell.inlineRowDescriptor){
-            return [self nextRowDescriptorForRow:nextRow withDirection:direction];
-        }
-    }
-    XLFormRowNavigationOptions rowNavigationOptions = self.form.rowNavigationOptions;
-    if (nextRow.isDisabled && ((rowNavigationOptions & XLFormRowNavigationOptionStopDisableRow) == XLFormRowNavigationOptionStopDisableRow)){
-        return nil;
-    }
-    if (!nextRow.isDisabled && ((rowNavigationOptions & XLFormRowNavigationOptionStopInlineRow) == XLFormRowNavigationOptionStopInlineRow) && [[[XLFormViewController inlineRowDescriptorTypesForRowDescriptorTypes] allKeys] containsObject:nextRow.rowType]){
-        return nil;
-    }
-    UITableViewCell<XLFormDescriptorCell> * cell = (UITableViewCell<XLFormDescriptorCell> *)[nextRow cellForFormController:self];
-    if (!nextRow.isDisabled && ((rowNavigationOptions & XLFormRowNavigationOptionSkipCanNotBecomeFirstResponderRow) != XLFormRowNavigationOptionSkipCanNotBecomeFirstResponderRow) && (![cell formDescriptorCellCanBecomeFirstResponder])){
-        return nil;
-    }
-    if (!nextRow.isDisabled && [cell formDescriptorCellCanBecomeFirstResponder]){
-        return nextRow;
-    }
-    return [self nextRowDescriptorForRow:nextRow withDirection:direction];
-}
-
-#pragma mark - properties
-
--(void)setForm:(XLFormDescriptor *)form
-{
-    _form.delegate = nil;
-    [self.tableView endEditing:YES];
-    _form = form;
-    _form.delegate = self;
-    [_form forceEvaluate];
-    if ([self isViewLoaded]){
-        [self.tableView reloadData];
-    }
-}
-
--(XLFormDescriptor *)form
-{
-    return _form;
-}
-
--(XLFormRowNavigationAccessoryView *)navigationAccessoryView
-{
-    if (_navigationAccessoryView) return _navigationAccessoryView;
-    _navigationAccessoryView = [XLFormRowNavigationAccessoryView new];
-    _navigationAccessoryView.previousButton.target = self;
-    _navigationAccessoryView.previousButton.action = @selector(rowNavigationAction:);
-    _navigationAccessoryView.nextButton.target = self;
-    _navigationAccessoryView.nextButton.action = @selector(rowNavigationAction:);
-    _navigationAccessoryView.doneButton.target = self;
-    _navigationAccessoryView.doneButton.action = @selector(rowNavigationDone:);
-    _navigationAccessoryView.tintColor = self.view.tintColor;
-    return _navigationAccessoryView;
-}
-
-@end
-

+ 0 - 95
iOSClient/Library/XLForm/XL/Descriptors/XLFormDescriptor.h

@@ -1,95 +0,0 @@
-//
-//  XLFormDescriptor.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 "XLFormSectionDescriptor.h"
-#import "XLFormRowDescriptor.h"
-#import "XLFormDescriptorDelegate.h"
-#import <Foundation/Foundation.h>
-
-extern NSString * __nonnull const XLFormErrorDomain;
-extern NSString * __nonnull const XLValidationStatusErrorKey;
-
-typedef NS_ENUM(NSInteger, XLFormErrorCode)
-{
-    XLFormErrorCodeGen = -999,
-    XLFormErrorCodeRequired = -1000
-};
-
-typedef NS_OPTIONS(NSUInteger, XLFormRowNavigationOptions) {
-    XLFormRowNavigationOptionNone                               = 0,
-    XLFormRowNavigationOptionEnabled                            = 1 << 0,
-    XLFormRowNavigationOptionStopDisableRow                     = 1 << 1,
-    XLFormRowNavigationOptionSkipCanNotBecomeFirstResponderRow  = 1 << 2,
-    XLFormRowNavigationOptionStopInlineRow                      = 1 << 3,
-};
-
-@class XLFormSectionDescriptor;
-
-@interface XLFormDescriptor : NSObject
-
-@property (readonly, nonatomic, nonnull) NSMutableArray * formSections;
-@property (readonly, nullable) NSString * title;
-@property (nonatomic) BOOL endEditingTableViewOnScroll;
-@property (nonatomic) BOOL assignFirstResponderOnShow;
-@property (nonatomic) BOOL addAsteriskToRequiredRowsTitle;
-@property (getter=isDisabled) BOOL disabled;
-@property (nonatomic) XLFormRowNavigationOptions rowNavigationOptions;
-
-@property (weak, nullable) id<XLFormDescriptorDelegate> delegate;
-
-+(nonnull instancetype)formDescriptor;
-+(nonnull instancetype)formDescriptorWithTitle:(nullable NSString *)title;
-
--(void)addFormSection:(nonnull XLFormSectionDescriptor *)formSection;
--(void)addFormSection:(nonnull XLFormSectionDescriptor *)formSection atIndex:(NSUInteger)index;
--(void)addFormSection:(nonnull XLFormSectionDescriptor *)formSection afterSection:(nonnull XLFormSectionDescriptor *)afterSection;
--(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow beforeRow:(nonnull XLFormRowDescriptor *)afterRow;
--(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow beforeRowTag:(nonnull NSString *)afterRowTag;
--(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow afterRow:(nonnull XLFormRowDescriptor *)afterRow;
--(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow afterRowTag:(nonnull NSString *)afterRowTag;
--(void)removeFormSectionAtIndex:(NSUInteger)index;
--(void)removeFormSection:(nonnull XLFormSectionDescriptor *)formSection;
--(void)removeFormRow:(nonnull XLFormRowDescriptor *)formRow;
--(void)removeFormRowWithTag:(nonnull NSString *)tag;
-
--(nullable XLFormRowDescriptor *)formRowWithTag:(nonnull NSString *)tag;
--(nullable XLFormRowDescriptor *)formRowAtIndex:(nonnull NSIndexPath *)indexPath;
--(nullable XLFormRowDescriptor *)formRowWithHash:(NSUInteger)hash;
--(nullable XLFormSectionDescriptor *)formSectionAtIndex:(NSUInteger)index;
-
--(nullable NSIndexPath *)indexPathOfFormRow:(nonnull XLFormRowDescriptor *)formRow;
-
--(nonnull NSDictionary *)formValues;
--(nonnull NSDictionary *)httpParameters:(nonnull XLFormViewController *)formViewController;
-
--(nonnull NSArray *)localValidationErrors:(nonnull XLFormViewController *)formViewController;
--(void)setFirstResponder:(nonnull XLFormViewController *)formViewController;
-
--(nullable XLFormRowDescriptor *)nextRowDescriptorForRow:(nonnull XLFormRowDescriptor *)currentRow;
--(nullable XLFormRowDescriptor *)previousRowDescriptorForRow:(nonnull XLFormRowDescriptor *)currentRow;
-
--(void)forceEvaluate;
-
-@end

+ 0 - 631
iOSClient/Library/XLForm/XL/Descriptors/XLFormDescriptor.m

@@ -1,631 +0,0 @@
-//
-//  XLFormDescriptor.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 "NSObject+XLFormAdditions.h"
-#import "XLFormDescriptor.h"
-#import "NSPredicate+XLFormAdditions.h"
-#import "NSString+XLFormAdditions.h"
-
-NSString * const XLFormErrorDomain = @"XLFormErrorDomain";
-NSString * const XLValidationStatusErrorKey = @"XLValidationStatusErrorKey";
-
-
-@interface XLFormSectionDescriptor (_XLFormDescriptor)
-
-@property NSArray * allRows;
--(BOOL)evaluateIsHidden;
-
-@end
-
-
-@interface XLFormRowDescriptor(_XLFormDescriptor)
-
--(BOOL)evaluateIsDisabled;
--(BOOL)evaluateIsHidden;
-
-@end
-
-
-@interface XLFormDescriptor()
-
-@property NSMutableArray * formSections;
-@property (readonly) NSMutableArray * allSections;
-@property NSString * title;
-@property (readonly) NSMutableDictionary* allRowsByTag;
-@property NSMutableDictionary* rowObservers;
-
-@end
-
-@implementation XLFormDescriptor
-
--(instancetype)init
-{
-    return [self initWithTitle:nil];
-}
-
--(instancetype)initWithTitle:(NSString *)title;
-{
-    self = [super init];
-    if (self){
-        _formSections = [NSMutableArray array];
-        _allSections = [NSMutableArray array];
-        _allRowsByTag = [NSMutableDictionary dictionary];
-        _rowObservers = [NSMutableDictionary dictionary];
-        _title = title;
-        _addAsteriskToRequiredRowsTitle = NO;
-        _disabled = NO;
-        _endEditingTableViewOnScroll = YES;
-        _rowNavigationOptions = XLFormRowNavigationOptionEnabled;
-        [self addObserver:self forKeyPath:@"formSections" options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld) context:0];
-    }
-    return self;
-}
-
-+(instancetype)formDescriptor
-{
-    return [[self class] formDescriptorWithTitle:nil];
-}
-
-+(instancetype)formDescriptorWithTitle:(NSString *)title
-{
-    return [[[self class] alloc] initWithTitle:title];
-}
-
--(void)addFormSection:(XLFormSectionDescriptor *)formSection
-{
-    [self insertObject:formSection inAllSectionsAtIndex:[self.allSections count]];
-}
-
--(void)addFormSection:(XLFormSectionDescriptor *)formSection atIndex:(NSUInteger)index
-{
-    if (index == 0){
-        [self insertObject:formSection inAllSectionsAtIndex:0];
-    }
-    else{
-        XLFormSectionDescriptor* previousSection = [self.formSections objectAtIndex:MIN(self.formSections.count, index-1)];
-        [self addFormSection:formSection afterSection:previousSection];
-    }
-}
-
--(void)addFormSection:(XLFormSectionDescriptor *)formSection afterSection:(XLFormSectionDescriptor *)afterSection
-{
-    NSUInteger sectionIndex;
-    NSUInteger allSectionIndex;
-    if ((sectionIndex = [self.allSections indexOfObject:formSection]) == NSNotFound){
-        allSectionIndex = [self.allSections indexOfObject:afterSection];
-        if (allSectionIndex != NSNotFound) {
-            [self insertObject:formSection inAllSectionsAtIndex:(allSectionIndex + 1)];
-        }
-        else { //case when afterSection does not exist. Just insert at the end.
-            [self addFormSection:formSection];
-            return;
-        }
-    }
-    formSection.hidden = formSection.hidden;
-}
-
-
--(void)addFormRow:(XLFormRowDescriptor *)formRow beforeRow:(XLFormRowDescriptor *)beforeRow
-{
-    if (beforeRow.sectionDescriptor){
-        [beforeRow.sectionDescriptor addFormRow:formRow beforeRow:beforeRow];
-    }
-    else{
-        [[self.allSections lastObject] addFormRow:formRow beforeRow:beforeRow];
-    }
-}
-
--(void)addFormRow:(XLFormRowDescriptor *)formRow beforeRowTag:(NSString *)beforeRowTag
-{
-    XLFormRowDescriptor * beforeRowForm = [self formRowWithTag:beforeRowTag];
-    [self addFormRow:formRow beforeRow:beforeRowForm];
-}
-
-
-
--(void)addFormRow:(XLFormRowDescriptor *)formRow afterRow:(XLFormRowDescriptor *)afterRow
-{
-    if (afterRow.sectionDescriptor){
-        [afterRow.sectionDescriptor addFormRow:formRow afterRow:afterRow];
-    }
-    else{
-        [[self.allSections lastObject] addFormRow:formRow afterRow:afterRow];
-    }
-}
-
--(void)addFormRow:(XLFormRowDescriptor *)formRow afterRowTag:(NSString *)afterRowTag
-{
-    XLFormRowDescriptor * afterRowForm = [self formRowWithTag:afterRowTag];
-    [self addFormRow:formRow afterRow:afterRowForm];
-}
-
--(void)removeFormSectionAtIndex:(NSUInteger)index
-{
-    if (self.formSections.count > index){
-        XLFormSectionDescriptor *formSection = [self.formSections objectAtIndex:index];
-        [self removeObjectFromFormSectionsAtIndex:index];
-        NSUInteger allSectionIndex = [self.allSections indexOfObject:formSection];
-        [self removeObjectFromAllSectionsAtIndex:allSectionIndex];
-    }
-}
-
--(void)removeFormSection:(XLFormSectionDescriptor *)formSection
-{
-    NSUInteger index = NSNotFound;
-    if ((index = [self.formSections indexOfObject:formSection]) != NSNotFound){
-        [self removeFormSectionAtIndex:index];
-    }
-    else if ((index = [self.allSections indexOfObject:formSection]) != NSNotFound){
-        [self removeObjectFromAllSectionsAtIndex:index];
-    };
-}
-
--(void)removeFormRow:(XLFormRowDescriptor *)formRow
-{
-    for (XLFormSectionDescriptor * section in self.formSections){
-        if ([section.formRows containsObject:formRow]){
-            [section removeFormRow:formRow];
-        }
-    }
-}
-
--(void)showFormSection:(XLFormSectionDescriptor*)formSection
-{
-    NSUInteger formIndex = [self.formSections indexOfObject:formSection];
-    if (formIndex != NSNotFound) {
-        return;
-    }
-    NSUInteger index = [self.allSections indexOfObject:formSection];
-    if (index != NSNotFound){
-        while (formIndex == NSNotFound && index > 0) {
-            XLFormSectionDescriptor* previous = [self.allSections objectAtIndex:--index];
-            formIndex = [self.formSections indexOfObject:previous];
-        }
-        [self insertObject:formSection inFormSectionsAtIndex:(formIndex == NSNotFound ? 0 : ++formIndex)];
-    }
-}
-
--(void)hideFormSection:(XLFormSectionDescriptor*)formSection
-{
-    NSUInteger index = [self.formSections indexOfObject:formSection];
-    if (index != NSNotFound){
-        [self removeObjectFromFormSectionsAtIndex:index];
-    }
-}
-
-
--(XLFormRowDescriptor *)formRowWithTag:(NSString *)tag
-{
-    return self.allRowsByTag[tag];
-}
-
--(XLFormRowDescriptor *)formRowWithHash:(NSUInteger)hash
-{
-    for (XLFormSectionDescriptor * section in self.allSections){
-        for (XLFormRowDescriptor * row in section.allRows) {
-            if ([row hash] == hash){
-                return row;
-            }
-        }
-    }
-    return nil;
-}
-
-
--(void)removeFormRowWithTag:(NSString *)tag
-{
-    XLFormRowDescriptor * formRow = [self formRowWithTag:tag];
-    [self removeFormRow:formRow];
-}
-
--(XLFormRowDescriptor *)formRowAtIndex:(NSIndexPath *)indexPath
-{
-    if ((self.formSections.count > indexPath.section) && [[self.formSections objectAtIndex:indexPath.section] formRows].count > indexPath.row){
-        return [[[self.formSections objectAtIndex:indexPath.section] formRows] objectAtIndex:indexPath.row];
-    }
-    return nil;
-}
-
--(XLFormSectionDescriptor *)formSectionAtIndex:(NSUInteger)index
-{
-    return [self objectInFormSectionsAtIndex:index];
-}
-
--(NSIndexPath *)indexPathOfFormRow:(XLFormRowDescriptor *)formRow
-{
-    XLFormSectionDescriptor * section = formRow.sectionDescriptor;
-    if (section){
-        NSUInteger sectionIndex = [self.formSections indexOfObject:section];
-        if (sectionIndex != NSNotFound){
-            NSUInteger rowIndex = [section.formRows indexOfObject:formRow];
-            if (rowIndex != NSNotFound){
-                return [NSIndexPath indexPathForRow:rowIndex inSection:sectionIndex];
-            }
-        }
-    }
-    return nil;
-}
-
--(NSIndexPath *)globalIndexPathOfFormRow:(XLFormRowDescriptor *)formRow
-{
-    XLFormSectionDescriptor * section = formRow.sectionDescriptor;
-    if (section){
-        NSUInteger sectionIndex = [self.allSections indexOfObject:section];
-        if (sectionIndex != NSNotFound){
-            NSUInteger rowIndex = [section.allRows indexOfObject:formRow];
-            if (rowIndex != NSNotFound){
-                return [NSIndexPath indexPathForRow:rowIndex inSection:sectionIndex];
-            }
-        }
-    }
-    return nil;
-}
-
--(NSDictionary *)formValues
-{
-    NSMutableDictionary * result = [NSMutableDictionary dictionary];
-    for (XLFormSectionDescriptor * section in self.formSections) {
-        if (section.multivaluedTag.length > 0){
-            NSMutableArray * multiValuedValuesArray = [NSMutableArray new];
-            for (XLFormRowDescriptor * row in section.formRows) {
-                if (row.value){
-                    [multiValuedValuesArray addObject:row.value];
-                }
-            }
-            [result setObject:multiValuedValuesArray forKey:section.multivaluedTag];
-        }
-        else{
-            for (XLFormRowDescriptor * row in section.formRows) {
-                if (row.tag.length > 0){
-                    [result setObject:(row.value ?: [NSNull null]) forKey:row.tag];
-                }
-            }
-        }
-    }
-    return result;
-}
-
--(NSDictionary *)httpParameters:(XLFormViewController *)formViewController
-{
-    NSMutableDictionary * result = [NSMutableDictionary dictionary];
-    for (XLFormSectionDescriptor * section in self.formSections) {
-        if (section.multivaluedTag.length > 0){
-            NSMutableArray * multiValuedValuesArray = [NSMutableArray new];
-            for (XLFormRowDescriptor * row in section.formRows) {
-                if ([row.value valueData]){
-                    [multiValuedValuesArray addObject:[row.value valueData]];
-                }
-            }
-            [result setObject:multiValuedValuesArray forKey:section.multivaluedTag];
-        }
-        else{
-            for (XLFormRowDescriptor * row in section.formRows) {
-                NSString * httpParameterKey = nil;
-                if ((httpParameterKey = [self httpParameterKeyForRow:row cell:[row cellForFormController:formViewController]])){
-                    id parameterValue = [row.value valueData] ?: [NSNull null];
-                    [result setObject:parameterValue forKey:httpParameterKey];
-                }
-            }
-        }
-    }
-    return result;
-}
-
--(NSString *)httpParameterKeyForRow:(XLFormRowDescriptor *)row cell:(UITableViewCell<XLFormDescriptorCell> *)descriptorCell
-{
-    if ([descriptorCell respondsToSelector:@selector(formDescriptorHttpParameterName)]){
-        return [descriptorCell formDescriptorHttpParameterName];
-    }
-    if (row.tag.length > 0){
-        return row.tag;
-    }
-    return nil;
-}
-
--(NSArray *)localValidationErrors:(XLFormViewController *)formViewController {
-    NSMutableArray * result = [NSMutableArray array];
-    for (XLFormSectionDescriptor * section in self.formSections) {
-        for (XLFormRowDescriptor * row in section.formRows) {
-            XLFormValidationStatus* status = [row doValidation];
-            if (status != nil && (![status isValid])) {
-                NSDictionary *userInfo = @{ NSLocalizedDescriptionKey: status.msg,
-                                            XLValidationStatusErrorKey: status };
-                NSError * error = [[NSError alloc] initWithDomain:XLFormErrorDomain code:XLFormErrorCodeGen userInfo:userInfo];
-                if (error){
-                    [result addObject:error];
-                }
-            }
-        }
-    }
-    
-    return result;
-}
-
-
-- (void)setFirstResponder:(XLFormViewController *)formViewController
-{
-    for (XLFormSectionDescriptor * formSection in self.formSections) {
-        for (XLFormRowDescriptor * row in formSection.formRows) {
-            UITableViewCell<XLFormDescriptorCell> * cell = [row cellForFormController:formViewController];
-            if ([cell formDescriptorCellCanBecomeFirstResponder]){
-                if ([cell formDescriptorCellBecomeFirstResponder]){
-                    return;
-                }
-            }
-        }
-    }
-}
-
-
-#pragma mark - KVO
-
--(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
-{
-    if (!self.delegate) return;
-    if ([keyPath isEqualToString:@"formSections"]){
-        if ([[change objectForKey:NSKeyValueChangeKindKey] isEqualToNumber:@(NSKeyValueChangeInsertion)]){
-            NSIndexSet * indexSet = [change objectForKey:NSKeyValueChangeIndexesKey];
-            XLFormSectionDescriptor * section = [self.formSections objectAtIndex:indexSet.firstIndex];
-            [self.delegate formSectionHasBeenAdded:section atIndex:indexSet.firstIndex];
-        }
-        else if ([[change objectForKey:NSKeyValueChangeKindKey] isEqualToNumber:@(NSKeyValueChangeRemoval)]){
-            NSIndexSet * indexSet = [change objectForKey:NSKeyValueChangeIndexesKey];
-            XLFormSectionDescriptor * removedSection = [[change objectForKey:NSKeyValueChangeOldKey] objectAtIndex:0];
-            [self.delegate formSectionHasBeenRemoved:removedSection atIndex:indexSet.firstIndex];
-        }
-    }
-}
-
--(void)dealloc
-{
-    @try {
-        [self removeObserver:self forKeyPath:@"formSections"];
-    }
-    @catch (NSException * __unused exception) {}
-}
-
-#pragma mark - KVC
-
--(NSUInteger)countOfFormSections
-{
-    return self.formSections.count;
-}
-
-- (id)objectInFormSectionsAtIndex:(NSUInteger)index {
-    return [self.formSections objectAtIndex:index];
-}
-
-- (NSArray *)formSectionsAtIndexes:(NSIndexSet *)indexes {
-    return [self.formSections objectsAtIndexes:indexes];
-}
-
-- (void)insertObject:(XLFormSectionDescriptor *)formSection inFormSectionsAtIndex:(NSUInteger)index {
-    [self.formSections insertObject:formSection atIndex:index];
-}
-
-- (void)removeObjectFromFormSectionsAtIndex:(NSUInteger)index {
-    [self.formSections removeObjectAtIndex:index];
-}
-
-#pragma mark - allSections KVO
-
--(NSUInteger)countOfAllSections
-{
-    return self.allSections.count;
-}
-
-- (id)objectInAllSectionsAtIndex:(NSUInteger)index {
-    return [self.allSections objectAtIndex:index];
-}
-
-- (NSArray *)allSectionsAtIndexes:(NSIndexSet *)indexes {
-    return [self.allSections objectsAtIndexes:indexes];
-}
-
-- (void)removeObjectFromAllSectionsAtIndex:(NSUInteger)index {
-    XLFormSectionDescriptor* section = [self.allSections objectAtIndex:index];
-    [section.allRows enumerateObjectsUsingBlock:^(id obj, NSUInteger __unused idx, BOOL *stop) {
-        XLFormRowDescriptor * row = (id)obj;
-        [self removeObserversOfObject:row predicateType:XLPredicateTypeDisabled];
-        [self removeObserversOfObject:row predicateType:XLPredicateTypeHidden];
-    }];
-    [self removeObserversOfObject:section predicateType:XLPredicateTypeHidden];
-    [self.allSections removeObjectAtIndex:index];
-}
-
-- (void)insertObject:(XLFormSectionDescriptor *)section inAllSectionsAtIndex:(NSUInteger)index {
-    section.formDescriptor = self;
-    [self.allSections insertObject:section atIndex:index];
-    section.hidden = section.hidden;
-    [section.allRows enumerateObjectsUsingBlock:^(id obj, NSUInteger __unused idx, BOOL * __unused stop) {
-        XLFormRowDescriptor * row = (id)obj;
-        [self addRowToTagCollection:obj];
-        row.hidden = row.hidden;
-        row.disabled = row.disabled;
-    }];
-
-    
-}
-
-#pragma mark - EvaluateForm
-
--(void)forceEvaluate
-{
-    for (XLFormSectionDescriptor* section in self.allSections){
-        for (XLFormRowDescriptor* row in section.allRows) {
-            [self addRowToTagCollection:row];
-        }
-    }
-    for (XLFormSectionDescriptor* section in self.allSections){
-        for (XLFormRowDescriptor* row in section.allRows) {
-            [row evaluateIsDisabled];
-            [row evaluateIsHidden];
-        }
-        [section evaluateIsHidden];
-    }
-}
-
-#pragma mark - private
-
-
--(NSMutableArray *)formSections
-{
-    return _formSections;
-}
-
-#pragma mark - Helpers
-
--(XLFormRowDescriptor *)nextRowDescriptorForRow:(XLFormRowDescriptor *)row
-{
-    NSUInteger indexOfRow = [row.sectionDescriptor.formRows indexOfObject:row];
-    if (indexOfRow != NSNotFound){
-        if (indexOfRow + 1 < row.sectionDescriptor.formRows.count){
-            return [row.sectionDescriptor.formRows objectAtIndex:++indexOfRow];
-        }
-        else{
-            NSUInteger sectionIndex = [self.formSections indexOfObject:row.sectionDescriptor];
-            NSUInteger numberOfSections = [self.formSections count];
-            if (sectionIndex != NSNotFound && sectionIndex < numberOfSections - 1){
-                sectionIndex++;
-                XLFormSectionDescriptor * sectionDescriptor;
-                while ([[(sectionDescriptor = [row.sectionDescriptor.formDescriptor.formSections objectAtIndex:sectionIndex]) formRows] count] == 0 && sectionIndex < numberOfSections - 1){
-                    sectionIndex++;
-                }
-                return [sectionDescriptor.formRows firstObject];
-            }
-        }
-    }
-    return nil;
-}
-
-
--(XLFormRowDescriptor *)previousRowDescriptorForRow:(XLFormRowDescriptor *)row
-{
-    NSUInteger indexOfRow = [row.sectionDescriptor.formRows indexOfObject:row];
-    if (indexOfRow != NSNotFound){
-        if (indexOfRow > 0 ){
-            return [row.sectionDescriptor.formRows objectAtIndex:--indexOfRow];
-        }
-        else{
-            NSUInteger sectionIndex = [self.formSections indexOfObject:row.sectionDescriptor];
-            if (sectionIndex != NSNotFound && sectionIndex > 0){
-                sectionIndex--;
-                XLFormSectionDescriptor * sectionDescriptor;
-                while ([[(sectionDescriptor = [row.sectionDescriptor.formDescriptor.formSections objectAtIndex:sectionIndex]) formRows] count] == 0 && sectionIndex > 0 ){
-                    sectionIndex--;
-                }
-                return [sectionDescriptor.formRows lastObject];
-            }
-        }
-    }
-    return nil;
-}
-
--(void)addRowToTagCollection:(XLFormRowDescriptor*) rowDescriptor
-{
-    if (rowDescriptor.tag) {
-        self.allRowsByTag[rowDescriptor.tag] = rowDescriptor;
-    }
-}
-
--(void)removeRowFromTagCollection:(XLFormRowDescriptor *)rowDescriptor
-{
-    if (rowDescriptor.tag){
-        [self.allRowsByTag removeObjectForKey:rowDescriptor.tag];
-    }
-}
-
-
--(void)addObserversOfObject:(id)sectionOrRow predicateType:(XLPredicateType)predicateType
-{
-    NSPredicate* predicate;
-    id descriptor;
-    switch(predicateType){
-        case XLPredicateTypeHidden:
-            if ([sectionOrRow isKindOfClass:([XLFormRowDescriptor class])]) {
-                descriptor = ((XLFormRowDescriptor*)sectionOrRow).tag;
-                predicate = ((XLFormRowDescriptor*)sectionOrRow).hidden;
-            }
-            else if ([sectionOrRow isKindOfClass:([XLFormSectionDescriptor class])]) {
-                descriptor = sectionOrRow;
-                predicate = ((XLFormSectionDescriptor*)sectionOrRow).hidden;
-            }
-            break;
-        case XLPredicateTypeDisabled:
-            if ([sectionOrRow isKindOfClass:([XLFormRowDescriptor class])]) {
-                descriptor = ((XLFormRowDescriptor*)sectionOrRow).tag;
-                predicate = ((XLFormRowDescriptor*)sectionOrRow).disabled;
-            }
-            else return;
-            
-            break;
-    }
-    NSMutableArray* tags = [predicate getPredicateVars];
-    for (NSString* tag in tags) {
-        NSString* auxTag = [tag formKeyForPredicateType:predicateType];
-        if (!self.rowObservers[auxTag]){
-            self.rowObservers[auxTag] = [NSMutableArray array];
-        }
-        if (![self.rowObservers[auxTag] containsObject:descriptor])
-            [self.rowObservers[auxTag] addObject:descriptor];
-    }
-    
-}
-
--(void)removeObserversOfObject:(id)sectionOrRow predicateType:(XLPredicateType)predicateType
-{
-    NSPredicate* predicate;
-    id descriptor;
-    switch(predicateType){
-        case XLPredicateTypeHidden:
-            if ([sectionOrRow isKindOfClass:([XLFormRowDescriptor class])]) {
-                descriptor = ((XLFormRowDescriptor*)sectionOrRow).tag;
-                predicate = ((XLFormRowDescriptor*)sectionOrRow).hidden;
-            }
-            else if ([sectionOrRow isKindOfClass:([XLFormSectionDescriptor class])]) {
-                descriptor = sectionOrRow;
-                predicate = ((XLFormSectionDescriptor*)sectionOrRow).hidden;
-            }
-            break;
-        case XLPredicateTypeDisabled:
-            if ([sectionOrRow isKindOfClass:([XLFormRowDescriptor class])]) {
-                descriptor = ((XLFormRowDescriptor*)sectionOrRow).tag;
-                predicate = ((XLFormRowDescriptor*)sectionOrRow).disabled;
-            }
-            break;
-    }
-    if (descriptor && [predicate isKindOfClass:[NSPredicate class] ]) {
-        NSMutableArray* tags = [predicate getPredicateVars];
-        for (NSString* tag in tags) {
-            NSString* auxTag = [tag formKeyForPredicateType:predicateType];
-            if (self.rowObservers[auxTag]){
-                [self.rowObservers[auxTag] removeObject:descriptor];
-            }
-        }
-    }
-}
-
-@end

+ 0 - 51
iOSClient/Library/XLForm/XL/Descriptors/XLFormDescriptorDelegate.h

@@ -1,51 +0,0 @@
-//
-//  XLFormDescriptorDelegate.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 "XLFormDescriptor.h"
-#import <Foundation/Foundation.h>
-
-@class XLFormSectionDescriptor;
-
-typedef NS_ENUM(NSUInteger, XLPredicateType) {
-    XLPredicateTypeDisabled = 0,
-    XLPredicateTypeHidden
-};
-
-
-@protocol XLFormDescriptorDelegate <NSObject>
-
-@required
-
--(void)formSectionHasBeenRemoved:(XLFormSectionDescriptor *)formSection atIndex:(NSUInteger)index;
--(void)formSectionHasBeenAdded:(XLFormSectionDescriptor *)formSection atIndex:(NSUInteger)index;
--(void)formRowHasBeenAdded:(XLFormRowDescriptor *)formRow atIndexPath:(NSIndexPath *)indexPath;
--(void)formRowHasBeenRemoved:(XLFormRowDescriptor *)formRow atIndexPath:(NSIndexPath *)indexPath;
--(void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)formRow oldValue:(id)oldValue newValue:(id)newValue;
--(void)formRowDescriptorPredicateHasChanged:(XLFormRowDescriptor *)formRow
-                                   oldValue:(id)oldValue
-                                   newValue:(id)newValue
-                              predicateType:(XLPredicateType)predicateType;
-
-@end

+ 0 - 169
iOSClient/Library/XLForm/XL/Descriptors/XLFormRowDescriptor.h

@@ -1,169 +0,0 @@
-//
-//  XLFormRowDescriptor.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>
-#import "XLFormBaseCell.h"
-#import "XLFormValidatorProtocol.h"
-#import "XLFormValidationStatus.h"
-
-extern CGFloat XLFormUnspecifiedCellHeight;
-
-@class XLFormViewController;
-@class XLFormSectionDescriptor;
-@protocol XLFormValidatorProtocol;
-@class XLFormAction;
-@class XLFormBaseCell;
-
-typedef NS_ENUM(NSUInteger, XLFormPresentationMode) {
-    XLFormPresentationModeDefault = 0,
-    XLFormPresentationModePush,
-    XLFormPresentationModePresent
-};
-
-typedef void(^XLOnChangeBlock)(id __nullable oldValue,id __nullable newValue,XLFormRowDescriptor* __nonnull rowDescriptor);
-
-@interface XLFormRowDescriptor : NSObject
-
-@property (nullable) id cellClass;
-@property (readwrite, nullable) NSString * tag;
-@property (readonly, nonnull) NSString * rowType;
-@property (nullable) NSString * title;
-@property (nonatomic, nullable) id value;
-@property (nullable) Class valueTransformer;
-@property UITableViewCellStyle cellStyle;
-@property (nonatomic) CGFloat height;
-
-@property (copy, nullable) XLOnChangeBlock onChangeBlock;
-@property BOOL useValueFormatterDuringInput;
-@property (nullable) NSFormatter *valueFormatter;
-
-// returns the display text for the row descriptor, taking into account NSFormatters and default placeholder values
-- (nonnull NSString *) displayTextValue;
-
-// returns the editing text value for the row descriptor, taking into account NSFormatters.
-- (nonnull NSString *) editTextValue;
-
-@property (nonatomic, readonly, nonnull) NSMutableDictionary * cellConfig;
-@property (nonatomic, readonly, nonnull) NSMutableDictionary * cellConfigForSelector;
-@property (nonatomic, readonly, nonnull) NSMutableDictionary * cellConfigIfDisabled;
-@property (nonatomic, readonly, nonnull) NSMutableDictionary * cellConfigAtConfigure;
-
-@property (nonnull) id disabled;
--(BOOL)isDisabled;
-@property (nonnull) id hidden;
--(BOOL)isHidden;
-@property (getter=isRequired) BOOL required;
-
-@property (nonnull) XLFormAction * action;
-
-@property (weak, null_unspecified) XLFormSectionDescriptor * sectionDescriptor;
-
-+(nonnull instancetype)formRowDescriptorWithTag:(nullable NSString *)tag rowType:(nonnull NSString *)rowType;
-+(nonnull instancetype)formRowDescriptorWithTag:(nullable NSString *)tag rowType:(nonnull NSString *)rowType title:(nullable NSString *)title;
--(nonnull instancetype)initWithTag:(nullable NSString *)tag rowType:(nonnull NSString *)rowType title:(nullable NSString *)title;
-
--(nonnull XLFormBaseCell *)cellForFormController:(nonnull XLFormViewController *)formController;
-
-@property (nullable) NSString *requireMsg;
--(void)addValidator:(nonnull id<XLFormValidatorProtocol>)validator;
--(void)removeValidator:(nonnull id<XLFormValidatorProtocol>)validator;
--(nullable XLFormValidationStatus *)doValidation;
-
-// ===========================
-// property used for Selectors
-// ===========================
-@property (nullable) NSString * noValueDisplayText;
-@property (nullable) NSString * selectorTitle;
-@property (nullable) NSArray * selectorOptions;
-
-@property (null_unspecified) id leftRightSelectorLeftOptionSelected;
-
-
-// =====================================
-// Deprecated
-// =====================================
-@property (null_unspecified) Class buttonViewController DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use action.viewControllerClass instead");
-@property XLFormPresentationMode buttonViewControllerPresentationMode DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("use action.viewControllerPresentationMode instead");
-@property (null_unspecified) Class selectorControllerClass DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use action.viewControllerClass instead");
-
-
-@end
-
-typedef NS_ENUM(NSUInteger, XLFormLeftRightSelectorOptionLeftValueChangePolicy)
-{
-    XLFormLeftRightSelectorOptionLeftValueChangePolicyNullifyRightValue = 0,
-    XLFormLeftRightSelectorOptionLeftValueChangePolicyChooseFirstOption,
-    XLFormLeftRightSelectorOptionLeftValueChangePolicyChooseLastOption
-};
-
-
-// =====================================
-// helper object used for LEFTRIGHTSelector Descriptor
-// =====================================
-@interface XLFormLeftRightSelectorOption : NSObject
-
-@property (nonatomic, assign) XLFormLeftRightSelectorOptionLeftValueChangePolicy leftValueChangePolicy;
-@property (readonly, nonnull) id leftValue;
-@property (readonly, nonnull) NSArray *  rightOptions;
-@property (readonly, null_unspecified) NSString * httpParameterKey;
-@property (nullable) Class rightSelectorControllerClass;
-
-@property (nullable) NSString * noValueDisplayText;
-@property (nullable) NSString * selectorTitle;
-
-
-+(nonnull XLFormLeftRightSelectorOption *)formLeftRightSelectorOptionWithLeftValue:(nonnull id)leftValue
-                                                          httpParameterKey:(null_unspecified NSString *)httpParameterKey
-                                                              rightOptions:(nonnull NSArray *)rightOptions;
-
-
-@end
-
-
-@protocol XLFormOptionObject
-
-@required
-
--(nonnull NSString *)formDisplayText;
--(nonnull id)formValue;
-
-@end
-
-@interface XLFormAction : NSObject
-
-@property (nullable, nonatomic, strong) Class viewControllerClass;
-@property (nullable, nonatomic, strong) NSString * viewControllerStoryboardId;
-@property (nullable, nonatomic, strong) NSString * viewControllerNibName;
-
-@property (nonatomic) XLFormPresentationMode viewControllerPresentationMode;
-
-@property (nullable, nonatomic, strong) void (^formBlock)(XLFormRowDescriptor * __nonnull sender);
-@property (nullable, nonatomic) SEL formSelector;
-@property (nullable, nonatomic, strong) NSString * formSegueIdenfifier DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use formSegueIdentifier instead");
-@property (nullable, nonatomic, strong) NSString * formSegueIdentifier;
-@property (nullable, nonatomic, strong) Class formSegueClass;
-
-@end

+ 0 - 713
iOSClient/Library/XLForm/XL/Descriptors/XLFormRowDescriptor.m

@@ -1,713 +0,0 @@
-//
-//  XLFormRowDescriptor.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 "XLForm.h"
-#import "XLFormViewController.h"
-#import "XLFormRowDescriptor.h"
-#import "NSString+XLFormAdditions.h"
-
-CGFloat XLFormUnspecifiedCellHeight = -3.0;
-CGFloat XLFormRowInitialHeight = -2;
-
-@interface XLFormDescriptor (_XLFormRowDescriptor)
-
-@property (readonly) NSDictionary* allRowsByTag;
-
--(void)addObserversOfObject:(id)sectionOrRow predicateType:(XLPredicateType)predicateType;
--(void)removeObserversOfObject:(id)sectionOrRow predicateType:(XLPredicateType)predicateType;
-
-@end
-
-@interface XLFormSectionDescriptor (_XLFormRowDescriptor)
-
--(void)showFormRow:(XLFormRowDescriptor*)formRow;
--(void)hideFormRow:(XLFormRowDescriptor*)formRow;
-
-@end
-
-#import "NSObject+XLFormAdditions.h"
-
-@interface XLFormRowDescriptor() <NSCopying>
-
-@property XLFormBaseCell * cell;
-@property (nonatomic) NSMutableArray *validators;
-
-@property BOOL isDirtyDisablePredicateCache;
-@property (nonatomic) NSNumber* disablePredicateCache;
-@property BOOL isDirtyHidePredicateCache;
-@property (nonatomic) NSNumber* hidePredicateCache;
-
-@end
-
-@implementation XLFormRowDescriptor
-
-@synthesize action = _action;
-@synthesize disabled = _disabled;
-@synthesize hidden = _hidden;
-@synthesize hidePredicateCache = _hidePredicateCache;
-@synthesize disablePredicateCache = _disablePredicateCache;
-@synthesize cellConfig = _cellConfig;
-@synthesize cellConfigForSelector = _cellConfigForSelector;
-@synthesize cellConfigIfDisabled = _cellConfigIfDisabled;
-@synthesize cellConfigAtConfigure = _cellConfigAtConfigure;
-@synthesize height = _height;
-
--(instancetype)init
-{
-    @throw [NSException exceptionWithName:NSGenericException reason:@"initWithTag:(NSString *)tag rowType:(NSString *)rowType title:(NSString *)title must be used" userInfo:nil];
-}
-
--(instancetype)initWithTag:(NSString *)tag rowType:(NSString *)rowType title:(NSString *)title;
-{
-    self = [super init];
-    if (self){
-        NSAssert(((![rowType isEqualToString:XLFormRowDescriptorTypeSelectorPopover] && ![rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelectorPopover]) || (([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) && ([rowType isEqualToString:XLFormRowDescriptorTypeSelectorPopover] || [rowType isEqualToString:XLFormRowDescriptorTypeMultipleSelectorPopover]))), @"You must be running under UIUserInterfaceIdiomPad to use either XLFormRowDescriptorTypeSelectorPopover or XLFormRowDescriptorTypeMultipleSelectorPopover rows.");
-        _tag = tag;
-        _disabled = @NO;
-        _hidden = @NO;
-        _rowType = rowType;
-        _title = title;
-        _cellStyle = [rowType isEqualToString:XLFormRowDescriptorTypeButton] ? UITableViewCellStyleDefault : UITableViewCellStyleValue1;
-        _validators = [NSMutableArray new];
-        _cellConfig = [NSMutableDictionary dictionary];
-        _cellConfigIfDisabled = [NSMutableDictionary dictionary];
-        _cellConfigAtConfigure = [NSMutableDictionary dictionary];
-        _isDirtyDisablePredicateCache = YES;
-        _disablePredicateCache = nil;
-        _isDirtyHidePredicateCache = YES;
-        _hidePredicateCache = nil;
-        _height = XLFormRowInitialHeight;
-        [self addObserver:self forKeyPath:@"value" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:0];
-        [self addObserver:self forKeyPath:@"disablePredicateCache" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:0];
-        [self addObserver:self forKeyPath:@"hidePredicateCache" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:0];
-        
-    }
-    return self;
-}
-
-+(instancetype)formRowDescriptorWithTag:(NSString *)tag rowType:(NSString *)rowType
-{
-    return [[self class] formRowDescriptorWithTag:tag rowType:rowType title:nil];
-}
-
-+(instancetype)formRowDescriptorWithTag:(NSString *)tag rowType:(NSString *)rowType title:(NSString *)title
-{
-    return [[[self class] alloc] initWithTag:tag rowType:rowType title:title];
-}
-
--(XLFormBaseCell *)cellForFormController:(XLFormViewController * __unused)formController
-{
-    if (!_cell){
-        id cellClass = self.cellClass ?: [XLFormViewController cellClassesForRowDescriptorTypes][self.rowType];
-        NSAssert(cellClass, @"Not defined XLFormRowDescriptorType: %@", self.rowType ?: @"");
-        if ([cellClass isKindOfClass:[NSString class]]) {
-            NSString *cellClassString = cellClass;
-            NSString *cellResource = nil;
-            NSBundle *bundle = nil;
-            if ([cellClassString rangeOfString:@"/"].location != NSNotFound) {
-                NSArray *components = [cellClassString componentsSeparatedByString:@"/"];
-                cellResource = [components lastObject];
-                NSString *folderName = [components firstObject];
-                NSString *bundlePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:folderName];
-                bundle = [NSBundle bundleWithPath:bundlePath];
-            } else {
-                bundle = [NSBundle bundleForClass:NSClassFromString(cellClass)];
-                cellResource = cellClassString;
-            }
-            NSParameterAssert(bundle != nil);
-            NSParameterAssert(cellResource != nil);
-            
-            if ([bundle pathForResource:cellResource ofType:@"nib"]){
-                _cell = [[bundle loadNibNamed:cellResource owner:nil options:nil] firstObject];
-            }
-        } else {
-            _cell = [[cellClass alloc] initWithStyle:self.cellStyle reuseIdentifier:nil];
-        }
-        _cell.rowDescriptor = self;
-        NSAssert([_cell isKindOfClass:[XLFormBaseCell class]], @"UITableViewCell must extend from XLFormBaseCell");
-        [self configureCellAtCreationTime];
-    }
-    return _cell;
-}
-
-- (void)configureCellAtCreationTime
-{
-    [self.cellConfigAtConfigure enumerateKeysAndObjectsUsingBlock:^(NSString *keyPath, id value, __unused BOOL *stop) {
-        [_cell setValue:(value == [NSNull null]) ? nil : value forKeyPath:keyPath];
-    }];
-}
-
--(NSMutableDictionary *)cellConfig
-{
-    if (_cellConfig) return _cellConfig;
-    _cellConfig = [NSMutableDictionary dictionary];
-    return _cellConfig;
-}
-
--(NSMutableDictionary *)cellConfigForSelector
-{
-    if (_cellConfigForSelector) return _cellConfigForSelector;
-    _cellConfigForSelector = [NSMutableDictionary dictionary];
-    return _cellConfigForSelector;
-}
-
-
--(NSMutableDictionary *)cellConfigIfDisabled
-{
-    if (_cellConfigIfDisabled) return _cellConfigIfDisabled;
-    _cellConfigIfDisabled = [NSMutableDictionary dictionary];
-    return _cellConfigIfDisabled;
-}
-
--(NSMutableDictionary *)cellConfigAtConfigure
-{
-    if (_cellConfigAtConfigure) return _cellConfigAtConfigure;
-    _cellConfigAtConfigure = [NSMutableDictionary dictionary];
-    return _cellConfigAtConfigure;
-}
-
--(NSString*)editTextValue
-{
-    if (self.value) {
-        if (self.valueFormatter) {
-            if (self.useValueFormatterDuringInput) {
-                return [self displayTextValue];
-            }else{
-                // have formatter, but we don't want to use it during editing
-                return [self.value displayText];
-            }
-        }else{
-            // have value, but no formatter, use the value's displayText
-            return [self.value displayText];
-        }
-    }else{
-        // placeholder
-        return @"";
-    }
-}
-
--(NSString*)displayTextValue
-{
-    if (self.value) {
-        if (self.valueFormatter) {
-            return [self.valueFormatter stringForObjectValue:self.value];
-        }
-        else{
-            return [self.value displayText];
-        }
-    }
-    else {
-        return self.noValueDisplayText;
-    }
-}
-
--(NSString *)description
-{
-    return self.tag;  // [NSString stringWithFormat:@"%@ - %@ (%@)", [super description], self.tag, self.rowType];
-}
-
--(XLFormAction *)action
-{
-    if (!_action){
-        _action = [[XLFormAction alloc] init];
-    }
-    return _action;
-}
-
--(void)setAction:(XLFormAction *)action
-{
-    _action = action;
-}
-
--(CGFloat)height
-{
-    if (_height == XLFormRowInitialHeight){
-        if ([[self.cell class] respondsToSelector:@selector(formDescriptorCellHeightForRowDescriptor:)]){
-            return [[self.cell class] formDescriptorCellHeightForRowDescriptor:self];
-        } else {
-            _height = XLFormUnspecifiedCellHeight;
-        }
-    }
-    return _height;
-}
-
--(void)setHeight:(CGFloat)height {
-    _height = height;
-}
-
-// In the implementation
--(id)copyWithZone:(NSZone *)zone
-{
-    XLFormRowDescriptor * rowDescriptorCopy = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:[self.rowType copy] title:[self.title copy]];
-    rowDescriptorCopy.cellClass = [self.cellClass copy];
-    [rowDescriptorCopy.cellConfig addEntriesFromDictionary:self.cellConfig];
-    [rowDescriptorCopy.cellConfigAtConfigure addEntriesFromDictionary:self.cellConfigAtConfigure];
-    rowDescriptorCopy.valueTransformer = [self.valueTransformer copy];
-    rowDescriptorCopy->_hidden = _hidden;
-    rowDescriptorCopy->_disabled = _disabled;
-    rowDescriptorCopy.required = self.isRequired;
-    rowDescriptorCopy.isDirtyDisablePredicateCache = YES;
-    rowDescriptorCopy.isDirtyHidePredicateCache = YES;
-    rowDescriptorCopy.validators = [self.validators mutableCopy];
-
-    // =====================
-    // properties for Button
-    // =====================
-    rowDescriptorCopy.action = [self.action copy];
-
-
-    // ===========================
-    // property used for Selectors
-    // ===========================
-
-    rowDescriptorCopy.noValueDisplayText = [self.noValueDisplayText copy];
-    rowDescriptorCopy.selectorTitle = [self.selectorTitle copy];
-    rowDescriptorCopy.selectorOptions = [self.selectorOptions copy];
-    rowDescriptorCopy.leftRightSelectorLeftOptionSelected = [self.leftRightSelectorLeftOptionSelected copy];
-
-    return rowDescriptorCopy;
-}
-
--(void)dealloc
-{
-    [self.sectionDescriptor.formDescriptor removeObserversOfObject:self predicateType:XLPredicateTypeDisabled];
-    [self.sectionDescriptor.formDescriptor removeObserversOfObject:self predicateType:XLPredicateTypeHidden];
-    @try {
-        [self removeObserver:self forKeyPath:@"value"];
-    }
-    @catch (NSException * __unused exception) {}
-    @try {
-        [self removeObserver:self forKeyPath:@"disablePredicateCache"];
-    }
-    @catch (NSException * __unused exception) {}
-    @try {
-        [self removeObserver:self forKeyPath:@"hidePredicateCache"];
-    }
-    @catch (NSException * __unused exception) {}
-}
-
-#pragma mark - KVO
-
--(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
-{
-    if (!self.sectionDescriptor) return;
-    if (object == self && ([keyPath isEqualToString:@"value"] || [keyPath isEqualToString:@"hidePredicateCache"] || [keyPath isEqualToString:@"disablePredicateCache"])){
-        if ([[change objectForKey:NSKeyValueChangeKindKey] isEqualToNumber:@(NSKeyValueChangeSetting)]){
-            id newValue = [change objectForKey:NSKeyValueChangeNewKey];
-            id oldValue = [change objectForKey:NSKeyValueChangeOldKey];
-            if ([keyPath isEqualToString:@"value"]){
-                [self.sectionDescriptor.formDescriptor.delegate formRowDescriptorValueHasChanged:object oldValue:oldValue newValue:newValue];
-                if (self.onChangeBlock) {
-                    self.onChangeBlock(oldValue, newValue, self);
-                }
-            }
-            else{
-                [self.sectionDescriptor.formDescriptor.delegate formRowDescriptorPredicateHasChanged:object oldValue:oldValue newValue:newValue predicateType:([keyPath isEqualToString:@"hidePredicateCache"] ? XLPredicateTypeHidden : XLPredicateTypeDisabled)];
-            }
-        }
-    }
-}
-
-#pragma mark - Disable Predicate functions
-
--(BOOL)isDisabled
-{
-    if (self.sectionDescriptor.formDescriptor.isDisabled){
-        return YES;
-    }
-    if (self.isDirtyDisablePredicateCache) {
-        [self evaluateIsDisabled];
-    }
-    return [self.disablePredicateCache boolValue];
-}
-
--(void)setDisabled:(id)disabled
-{
-    if ([_disabled isKindOfClass:[NSPredicate class]]){
-        [self.sectionDescriptor.formDescriptor removeObserversOfObject:self predicateType:XLPredicateTypeDisabled];
-    }
-    _disabled = [disabled isKindOfClass:[NSString class]] ? [disabled formPredicate] : disabled;
-    if ([_disabled isKindOfClass:[NSPredicate class]]){
-        [self.sectionDescriptor.formDescriptor addObserversOfObject:self predicateType:XLPredicateTypeDisabled];
-    }
-
-    [self evaluateIsDisabled];
-}
-
--(BOOL)evaluateIsDisabled
-{
-    if ([_disabled isKindOfClass:[NSPredicate class]]) {
-        if (!self.sectionDescriptor.formDescriptor) {
-            self.isDirtyDisablePredicateCache = YES;
-        } else {
-            @try {
-                self.disablePredicateCache = @([_disabled evaluateWithObject:self substitutionVariables:self.sectionDescriptor.formDescriptor.allRowsByTag ?: @{}]);
-            }
-            @catch (NSException *exception) {
-                // predicate syntax error.
-                self.isDirtyDisablePredicateCache = YES;
-            };
-        }
-    }
-    else{
-        self.disablePredicateCache = _disabled;
-    }
-    if ([self.disablePredicateCache boolValue]){
-        [self.cell resignFirstResponder];
-    }
-    return [self.disablePredicateCache boolValue];
-}
-
--(id)disabled
-{
-    return _disabled;
-}
-
--(void)setDisablePredicateCache:(NSNumber*)disablePredicateCache
-{
-    NSParameterAssert(disablePredicateCache);
-    self.isDirtyDisablePredicateCache = NO;
-    if (!_disablePredicateCache || ![_disablePredicateCache isEqualToNumber:disablePredicateCache]){
-        _disablePredicateCache = disablePredicateCache;
-    }
-}
-
--(NSNumber*)disablePredicateCache
-{
-    return _disablePredicateCache;
-}
-
-#pragma mark - Hide Predicate functions
-
--(NSNumber *)hidePredicateCache
-{
-    return _hidePredicateCache;
-}
-
--(void)setHidePredicateCache:(NSNumber *)hidePredicateCache
-{
-    NSParameterAssert(hidePredicateCache);
-    self.isDirtyHidePredicateCache = NO;
-    if (!_hidePredicateCache || ![_hidePredicateCache isEqualToNumber:hidePredicateCache]){
-        _hidePredicateCache = hidePredicateCache;
-    }
-}
-
--(BOOL)isHidden
-{
-    if (self.isDirtyHidePredicateCache) {
-        return [self evaluateIsHidden];
-    }
-    return [self.hidePredicateCache boolValue];
-}
-
--(BOOL)evaluateIsHidden
-{
-    if ([_hidden isKindOfClass:[NSPredicate class]]) {
-        if (!self.sectionDescriptor.formDescriptor) {
-            self.isDirtyHidePredicateCache = YES;
-        } else {
-            @try {
-                self.hidePredicateCache = @([_hidden evaluateWithObject:self substitutionVariables:self.sectionDescriptor.formDescriptor.allRowsByTag ?: @{}]);
-            }
-            @catch (NSException *exception) {
-                // predicate syntax error or for has not finished loading.
-                self.isDirtyHidePredicateCache = YES;
-            };
-        }
-    }
-    else{
-        self.hidePredicateCache = _hidden;
-    }
-    if ([self.hidePredicateCache boolValue]){
-        [self.cell resignFirstResponder];
-        [self.sectionDescriptor hideFormRow:self];
-    }
-    else{
-        [self.sectionDescriptor showFormRow:self];
-    }
-    return [self.hidePredicateCache boolValue];
-}
-
-
--(void)setHidden:(id)hidden
-{
-    if ([_hidden isKindOfClass:[NSPredicate class]]){
-        [self.sectionDescriptor.formDescriptor removeObserversOfObject:self predicateType:XLPredicateTypeHidden];
-    }
-    _hidden = [hidden isKindOfClass:[NSString class]] ? [hidden formPredicate] : hidden;
-    if ([_hidden isKindOfClass:[NSPredicate class]]){
-        [self.sectionDescriptor.formDescriptor addObserversOfObject:self predicateType:XLPredicateTypeHidden];
-    }
-    [self evaluateIsHidden]; // check and update if this row should be hidden.
-}
-
--(id)hidden
-{
-    return _hidden;
-}
-
-
-#pragma mark - validation
-
--(void)addValidator:(id<XLFormValidatorProtocol>)validator
-{
-    if (validator == nil || ![validator conformsToProtocol:@protocol(XLFormValidatorProtocol)])
-        return;
-
-    if(![self.validators containsObject:validator]) {
-        [self.validators addObject:validator];
-    }
-}
-
--(void)removeValidator:(id<XLFormValidatorProtocol>)validator
-{
-    if (validator == nil|| ![validator conformsToProtocol:@protocol(XLFormValidatorProtocol)])
-        return;
-
-    if ([self.validators containsObject:validator]) {
-        [self.validators removeObject:validator];
-    }
-}
-
-- (BOOL)valueIsEmpty
-{
-    return self.value == nil || [self.value isKindOfClass:[NSNull class]] || ([self.value respondsToSelector:@selector(length)] && [self.value length]==0) ||
-    ([self.value respondsToSelector:@selector(count)] && [self.value count]==0);
-}
-
--(XLFormValidationStatus *)doValidation
-{
-    XLFormValidationStatus *valStatus = nil;
-
-    if (self.required) {
-        // do required validation here
-        if ([self valueIsEmpty]) {
-            valStatus = [XLFormValidationStatus formValidationStatusWithMsg:@"" status:NO rowDescriptor:self];
-            NSString *msg = nil;
-            if (self.requireMsg != nil) {
-                msg = self.requireMsg;
-            } else {
-                // default message for required msg
-                msg = NSLocalizedString(@"%@ can't be empty", nil);
-            }
-
-            if (self.title != nil) {
-                valStatus.msg = [NSString stringWithFormat:msg, self.title];
-            } else {
-                valStatus.msg = [NSString stringWithFormat:msg, self.tag];
-            }
-
-            return valStatus;
-        }
-    }
-    // custom validator
-    for(id<XLFormValidatorProtocol> v in self.validators) {
-        if ([v conformsToProtocol:@protocol(XLFormValidatorProtocol)]) {
-            XLFormValidationStatus *vStatus = [v isValid:self];
-            // fail validation
-            if (vStatus != nil && !vStatus.isValid) {
-                return vStatus;
-            }
-            valStatus = vStatus;
-        } else {
-            valStatus = nil;
-        }
-    }
-    return valStatus;
-}
-
-
-#pragma mark - Deprecations
-
--(void)setButtonViewController:(Class)buttonViewController
-{
-    self.action.viewControllerClass = buttonViewController;
-}
-
--(Class)buttonViewController
-{
-    return self.action.viewControllerClass;
-}
-
--(void)setSelectorControllerClass:(Class)selectorControllerClass
-{
-    self.action.viewControllerClass = selectorControllerClass;
-}
-
--(Class)selectorControllerClass
-{
-    return self.action.viewControllerClass;
-}
-
--(void)setButtonViewControllerPresentationMode:(XLFormPresentationMode)buttonViewControllerPresentationMode
-{
-    self.action.viewControllerPresentationMode = buttonViewControllerPresentationMode;
-}
-
--(XLFormPresentationMode)buttonViewControllerPresentationMode
-{
-    return self.action.viewControllerPresentationMode;
-}
-
-@end
-
-
-
-@implementation XLFormLeftRightSelectorOption
-
-
-+(XLFormLeftRightSelectorOption *)formLeftRightSelectorOptionWithLeftValue:(id)leftValue
-                                                          httpParameterKey:(NSString *)httpParameterKey
-                                                              rightOptions:(NSArray *)rightOptions;
-{
-    return [[XLFormLeftRightSelectorOption alloc] initWithLeftValue:leftValue
-                                                   httpParameterKey:httpParameterKey
-                                                       rightOptions:rightOptions];
-}
-
-
--(instancetype)initWithLeftValue:(NSString *)leftValue httpParameterKey:(NSString *)httpParameterKey rightOptions:(NSArray *)rightOptions
-{
-    self = [super init];
-    if (self){
-        _selectorTitle = nil;
-        _leftValue = leftValue;
-        _rightOptions = rightOptions;
-        _httpParameterKey = httpParameterKey;
-    }
-    return self;
-}
-
-
-@end
-
-@implementation XLFormAction
-
-- (instancetype)init
-{
-    self = [super init];
-    if (self) {
-        _viewControllerPresentationMode = XLFormPresentationModeDefault;
-    }
-    return self;
-}
-
-// In the implementation
--(id)copyWithZone:(NSZone *)zone
-{
-    XLFormAction * actionCopy = [[XLFormAction alloc] init];
-    actionCopy.viewControllerPresentationMode = self.viewControllerPresentationMode;
-    if (self.viewControllerClass){
-        actionCopy.viewControllerClass = [self.viewControllerClass copy];
-    }
-    else if ([self.viewControllerStoryboardId length]  != 0){
-        actionCopy.viewControllerStoryboardId = [self.viewControllerStoryboardId copy];
-    }
-    else if ([self.viewControllerNibName length] != 0){
-        actionCopy.viewControllerNibName = [self.viewControllerNibName copy];
-    }
-    if (self.formBlock){
-        actionCopy.formBlock = [self.formBlock copy];
-    }
-    else if (self.formSelector){
-        actionCopy.formSelector = self.formSelector;
-    }
-    else if (self.formSegueIdentifier){
-        actionCopy.formSegueIdentifier = [self.formSegueIdentifier copy];
-    }
-    else if (self.formSegueClass){
-        actionCopy.formSegueClass = [self.formSegueClass copy];
-    }
-    return actionCopy;
-}
-
--(void)setViewControllerClass:(Class)viewControllerClass
-{
-    _viewControllerClass = viewControllerClass;
-    _viewControllerNibName = nil;
-    _viewControllerStoryboardId = nil;
-}
-
--(void)setViewControllerNibName:(NSString *)viewControllerNibName
-{
-    _viewControllerClass = nil;
-    _viewControllerNibName = viewControllerNibName;
-    _viewControllerStoryboardId = nil;
-}
-
--(void)setViewControllerStoryboardId:(NSString *)viewControllerStoryboardId
-{
-    _viewControllerClass = nil;
-    _viewControllerNibName = nil;
-    _viewControllerStoryboardId = viewControllerStoryboardId;
-}
-
-
--(void)setFormSelector:(SEL)formSelector
-{
-    _formBlock = nil;
-    _formSegueClass = nil;
-    _formSegueIdentifier = nil;
-    _formSelector = formSelector;
-}
-
-
--(void)setFormBlock:(void (^)(XLFormRowDescriptor *))formBlock
-{
-    _formSegueClass = nil;
-    _formSegueIdentifier = nil;
-    _formSelector = nil;
-    _formBlock = formBlock;
-}
-
--(void)setFormSegueClass:(Class)formSegueClass
-{
-    _formSelector = nil;
-    _formBlock = nil;
-    _formSegueIdentifier = nil;
-    _formSegueClass = formSegueClass;
-}
-
--(void)setFormSegueIdentifier:(NSString *)formSegueIdentifier
-{
-    _formSelector = nil;
-    _formBlock = nil;
-    _formSegueClass = nil;
-    _formSegueIdentifier = formSegueIdentifier;
-}
-
-// Deprecated:
--(void)setFormSegueIdenfifier:(NSString *)formSegueIdenfifier
-{
-    self.formSegueIdentifier = formSegueIdenfifier;
-}
-
--(NSString *)formSegueIdenfifier
-{
-    return self.formSegueIdentifier;
-}
-
-@end

+ 0 - 74
iOSClient/Library/XLForm/XL/Descriptors/XLFormSectionDescriptor.h

@@ -1,74 +0,0 @@
-//
-//  XLFormSectionDescriptor.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 "XLFormRowDescriptor.h"
-#import <Foundation/Foundation.h>
-
-typedef NS_OPTIONS(NSUInteger, XLFormSectionOptions) {
-    XLFormSectionOptionNone        = 0,
-    XLFormSectionOptionCanInsert   = 1 << 0,
-    XLFormSectionOptionCanDelete   = 1 << 1,
-    XLFormSectionOptionCanReorder  = 1 << 2
-};
-
-typedef NS_ENUM(NSUInteger, XLFormSectionInsertMode) {
-    XLFormSectionInsertModeLastRow = 0,
-    XLFormSectionInsertModeButton = 2
-};
-
-@class XLFormDescriptor;
-
-@interface XLFormSectionDescriptor : NSObject
-
-@property (nonatomic, nullable) NSString * title;
-@property (nonatomic, nullable) NSString * footerTitle;
-@property (readonly, nonnull) NSMutableArray * formRows;
-
-@property (readonly) XLFormSectionInsertMode sectionInsertMode;
-@property (readonly) XLFormSectionOptions sectionOptions;
-@property (nullable) XLFormRowDescriptor * multivaluedRowTemplate;
-@property (readonly, nullable) XLFormRowDescriptor * multivaluedAddButton;
-@property (nonatomic, nullable) NSString * multivaluedTag;
-
-@property (weak, null_unspecified) XLFormDescriptor * formDescriptor;
-
-@property (nonnull) id hidden;
--(BOOL)isHidden;
-
-+(nonnull instancetype)formSection;
-+(nonnull instancetype)formSectionWithTitle:(nullable NSString *)title;
-+(nonnull instancetype)formSectionWithTitle:(nullable NSString *)title multivaluedSection:(BOOL)multivaluedSection DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use formSectionWithTitle:sectionType: instead");
-+(nonnull instancetype)formSectionWithTitle:(nullable NSString *)title sectionOptions:(XLFormSectionOptions)sectionOptions;
-+(nonnull instancetype)formSectionWithTitle:(nullable NSString *)title sectionOptions:(XLFormSectionOptions)sectionOptions sectionInsertMode:(XLFormSectionInsertMode)sectionInsertMode;
-
--(BOOL)isMultivaluedSection;
--(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow;
--(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow afterRow:(nonnull XLFormRowDescriptor *)afterRow;
--(void)addFormRow:(nonnull XLFormRowDescriptor *)formRow beforeRow:(nonnull XLFormRowDescriptor *)beforeRow;
--(void)removeFormRowAtIndex:(NSUInteger)index;
--(void)removeFormRow:(nonnull XLFormRowDescriptor *)formRow;
--(void)moveRowAtIndexPath:(nonnull NSIndexPath *)sourceIndex toIndexPath:(nonnull NSIndexPath *)destinationIndex;
-
-@end

+ 0 - 411
iOSClient/Library/XLForm/XL/Descriptors/XLFormSectionDescriptor.m

@@ -1,411 +0,0 @@
-//
-//  XLFormSectionDescriptor.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 "XLForm.h"
-#import "XLFormSectionDescriptor.h"
-#import "NSPredicate+XLFormAdditions.h"
-#import "NSString+XLFormAdditions.h"
-#import "UIView+XLFormAdditions.h"
-
-
-@interface XLFormDescriptor (_XLFormSectionDescriptor)
-
-@property (readonly) NSDictionary* allRowsByTag;
-
--(void)addRowToTagCollection:(XLFormRowDescriptor*)rowDescriptor;
--(void)removeRowFromTagCollection:(XLFormRowDescriptor*) rowDescriptor;
--(void)showFormSection:(XLFormSectionDescriptor*)formSection;
--(void)hideFormSection:(XLFormSectionDescriptor*)formSection;
-
--(void)addObserversOfObject:(id)sectionOrRow predicateType:(XLPredicateType)predicateType;
--(void)removeObserversOfObject:(id)sectionOrRow predicateType:(XLPredicateType)predicateType;
-
-@end
-
-@interface XLFormSectionDescriptor()
-
-@property NSMutableArray * formRows;
-@property NSMutableArray * allRows;
-@property BOOL isDirtyHidePredicateCache;
-@property (nonatomic) NSNumber* hidePredicateCache;
-
-@end
-
-@implementation XLFormSectionDescriptor
-
-@synthesize hidden = _hidden;
-@synthesize hidePredicateCache = _hidePredicateCache;
-
--(instancetype)init
-{
-    self = [super init];
-    if (self){
-        _formRows = [NSMutableArray array];
-        _allRows = [NSMutableArray array];
-        _sectionInsertMode = XLFormSectionInsertModeLastRow;
-        _sectionOptions = XLFormSectionOptionNone;
-        _title = nil;
-        _footerTitle = nil;
-        _hidden = @NO;
-        _hidePredicateCache = @NO;
-        _isDirtyHidePredicateCache = YES;
-        [self addObserver:self forKeyPath:@"formRows" options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld) context:0];
-    }
-    return self;
-}
-
--(instancetype)initWithTitle:(NSString *)title sectionOptions:(XLFormSectionOptions)sectionOptions sectionInsertMode:(XLFormSectionInsertMode)sectionInsertMode{
-    self = [self init];
-    if (self){
-        _sectionInsertMode = sectionInsertMode;
-        _sectionOptions = sectionOptions;
-        _title = title;
-        if ([self canInsertUsingButton]){
-            _multivaluedAddButton = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeButton title:@"Add Item"];
-            [_multivaluedAddButton.cellConfig setObject:@(NSTextAlignmentNatural) forKey:@"textLabel.textAlignment"];
-            _multivaluedAddButton.action.formSelector = NSSelectorFromString(@"multivaluedInsertButtonTapped:");
-            [self insertObject:_multivaluedAddButton inFormRowsAtIndex:0];
-            [self insertObject:_multivaluedAddButton inAllRowsAtIndex:0];
-        }
-    }
-    return self;
-}
-
-+(instancetype)formSection
-{
-    return [[self class] formSectionWithTitle:nil];
-}
-
-+(instancetype)formSectionWithTitle:(NSString *)title
-{
-    return [[self class] formSectionWithTitle:title sectionOptions:XLFormSectionOptionNone];
-}
-
-+(instancetype)formSectionWithTitle:(NSString *)title multivaluedSection:(BOOL)multivaluedSection
-{
-    return [[self class] formSectionWithTitle:title sectionOptions:(multivaluedSection ? XLFormSectionOptionCanInsert | XLFormSectionOptionCanDelete : XLFormSectionOptionNone)];
-}
-
-+(instancetype)formSectionWithTitle:(NSString *)title sectionOptions:(XLFormSectionOptions)sectionOptions
-{
-    return [[self class] formSectionWithTitle:title sectionOptions:sectionOptions sectionInsertMode:XLFormSectionInsertModeLastRow];
-}
-
-+(instancetype)formSectionWithTitle:(NSString *)title sectionOptions:(XLFormSectionOptions)sectionOptions sectionInsertMode:(XLFormSectionInsertMode)sectionInsertMode
-{
-    return [[[self class] alloc] initWithTitle:title sectionOptions:sectionOptions sectionInsertMode:sectionInsertMode];
-}
-
--(BOOL)isMultivaluedSection
-{
-    return (self.sectionOptions != XLFormSectionOptionNone);
-}
-
--(void)addFormRow:(XLFormRowDescriptor *)formRow
-{
-    NSUInteger index;
-    
-    if ([self canInsertUsingButton]) {
-        index = ([self.formRows count] > 0) ? [self.formRows count] - 1 : 0;
-    } else {
-        index = [self.allRows count];
-    }
-
-    [self insertObject:formRow inAllRowsAtIndex:index];
-}
-
--(void)addFormRow:(XLFormRowDescriptor *)formRow afterRow:(XLFormRowDescriptor *)afterRow
-{
-    NSUInteger allRowIndex = [self.allRows indexOfObject:afterRow];
-    if (allRowIndex != NSNotFound) {
-        [self insertObject:formRow inAllRowsAtIndex:allRowIndex+1];
-    }
-    else { //case when afterRow does not exist. Just insert at the end.
-        [self addFormRow:formRow];
-        return;
-    }
-}
-
--(void)addFormRow:(XLFormRowDescriptor *)formRow beforeRow:(XLFormRowDescriptor *)beforeRow
-{
-    
-    NSUInteger allRowIndex = [self.allRows indexOfObject:beforeRow];
-    if (allRowIndex != NSNotFound) {
-        [self insertObject:formRow inAllRowsAtIndex:allRowIndex];
-    }
-    else { //case when afterRow does not exist. Just insert at the end.
-        [self addFormRow:formRow];
-        return;
-    }
-}
-
--(void)removeFormRowAtIndex:(NSUInteger)index
-{
-    if (self.formRows.count > index){
-        XLFormRowDescriptor *formRow = [self.formRows objectAtIndex:index];
-        NSUInteger allRowIndex = [self.allRows indexOfObject:formRow];
-        [self removeObjectFromFormRowsAtIndex:index];
-        [self removeObjectFromAllRowsAtIndex:allRowIndex];
-    }
-}
-
--(void)removeFormRow:(XLFormRowDescriptor *)formRow
-{
-    NSUInteger index = NSNotFound;
-    if ((index = [self.formRows indexOfObject:formRow]) != NSNotFound){
-        [self removeFormRowAtIndex:index];
-    }
-    else if ((index = [self.allRows indexOfObject:formRow]) != NSNotFound){
-        if (self.allRows.count > index){
-            [self removeObjectFromAllRowsAtIndex:index];
-        }
-    };
-}
-
-- (void)moveRowAtIndexPath:(NSIndexPath *)sourceIndex toIndexPath:(NSIndexPath *)destinationIndex
-{
-    if ((sourceIndex.row < self.formRows.count) && (destinationIndex.row < self.formRows.count) && (sourceIndex.row != destinationIndex.row)){
-        XLFormRowDescriptor * row = [self objectInFormRowsAtIndex:sourceIndex.row];
-        XLFormRowDescriptor * destRow = [self objectInFormRowsAtIndex:destinationIndex.row];
-        [self.formRows removeObjectAtIndex:sourceIndex.row];
-        [self.formRows insertObject:row atIndex:destinationIndex.row];
-        
-        [self.allRows removeObjectAtIndex:[self.allRows indexOfObject:row]];
-        [self.allRows insertObject:row atIndex:[self.allRows indexOfObject:destRow]];
-    }
-}
-
--(void)dealloc
-{
-    [self.formDescriptor removeObserversOfObject:self predicateType:XLPredicateTypeHidden];
-    @try {
-        [self removeObserver:self forKeyPath:@"formRows"];
-    }
-    @catch (NSException * __unused exception) {}
-}
-
-#pragma mark - Show/hide rows
-
--(void)showFormRow:(XLFormRowDescriptor*)formRow{
-    
-    NSUInteger formIndex = [self.formRows indexOfObject:formRow];
-    if (formIndex != NSNotFound) {
-        return;
-    }
-    NSUInteger index = [self.allRows indexOfObject:formRow];
-    if (index != NSNotFound){
-        while (formIndex == NSNotFound && index > 0) {
-            XLFormRowDescriptor* previous = [self.allRows objectAtIndex:--index];
-            formIndex = [self.formRows indexOfObject:previous];
-        }
-        if (formIndex == NSNotFound){ // index == 0 => insert at the beginning
-            [self insertObject:formRow inFormRowsAtIndex:0];
-        }
-        else {
-            [self insertObject:formRow inFormRowsAtIndex:formIndex+1];
-        }
-        
-    }
-}
-
--(void)hideFormRow:(XLFormRowDescriptor*)formRow{
-    NSUInteger index = [self.formRows indexOfObject:formRow];
-    if (index != NSNotFound){
-        [self removeObjectFromFormRowsAtIndex:index];
-    }
-}
-
-#pragma mark - KVO
-
--(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
-{
-    if (!self.formDescriptor.delegate) return;
-    if ([keyPath isEqualToString:@"formRows"]){
-        if ([self.formDescriptor.formSections containsObject:self]){
-            if ([[change objectForKey:NSKeyValueChangeKindKey] isEqualToNumber:@(NSKeyValueChangeInsertion)]){
-                NSIndexSet * indexSet = [change objectForKey:NSKeyValueChangeIndexesKey];
-                XLFormRowDescriptor * formRow = [((XLFormSectionDescriptor *)object).formRows objectAtIndex:indexSet.firstIndex];
-                NSUInteger sectionIndex = [self.formDescriptor.formSections indexOfObject:object];
-                [self.formDescriptor.delegate formRowHasBeenAdded:formRow atIndexPath:[NSIndexPath indexPathForRow:indexSet.firstIndex inSection:sectionIndex]];
-            }
-            else if ([[change objectForKey:NSKeyValueChangeKindKey] isEqualToNumber:@(NSKeyValueChangeRemoval)]){
-                NSIndexSet * indexSet = [change objectForKey:NSKeyValueChangeIndexesKey];
-                XLFormRowDescriptor * removedRow = [[change objectForKey:NSKeyValueChangeOldKey] objectAtIndex:0];
-                NSUInteger sectionIndex = [self.formDescriptor.formSections indexOfObject:object];
-                [self.formDescriptor.delegate formRowHasBeenRemoved:removedRow atIndexPath:[NSIndexPath indexPathForRow:indexSet.firstIndex inSection:sectionIndex]];
-            }
-        }
-    }
-}
-
-
-
-#pragma mark - KVC
-
--(NSUInteger)countOfFormRows
-{
-    return self.formRows.count;
-}
-
-- (id)objectInFormRowsAtIndex:(NSUInteger)index
-{
-    return [self.formRows objectAtIndex:index];
-}
-
-- (NSArray *)formRowsAtIndexes:(NSIndexSet *)indexes
-{
-    return [self.formRows objectsAtIndexes:indexes];
-}
-
-- (void)insertObject:(XLFormRowDescriptor *)formRow inFormRowsAtIndex:(NSUInteger)index
-{
-    formRow.sectionDescriptor = self;
-    [self.formRows insertObject:formRow atIndex:index];
-}
-
-- (void)removeObjectFromFormRowsAtIndex:(NSUInteger)index
-{
-    [self.formRows removeObjectAtIndex:index];
-}
-
-#pragma mark - KVC ALL
-
--(NSUInteger)countOfAllRows
-{
-    return self.allRows.count;
-}
-
-- (id)objectInAllRowsAtIndex:(NSUInteger)index
-{
-    return [self.allRows objectAtIndex:index];
-}
-
-- (NSArray *)allRowsAtIndexes:(NSIndexSet *)indexes
-{
-    return [self.allRows objectsAtIndexes:indexes];
-}
-
-- (void)insertObject:(XLFormRowDescriptor *)row inAllRowsAtIndex:(NSUInteger)index
-{
-    row.sectionDescriptor = self;
-    [self.formDescriptor addRowToTagCollection:row];
-    [self.allRows insertObject:row atIndex:index];
-    row.disabled = row.disabled;
-    row.hidden = row.hidden;
-}
-
-- (void)removeObjectFromAllRowsAtIndex:(NSUInteger)index
-{
-    XLFormRowDescriptor * row = [self.allRows objectAtIndex:index];
-    [self.formDescriptor removeRowFromTagCollection:row];
-    [self.formDescriptor removeObserversOfObject:row predicateType:XLPredicateTypeDisabled];
-    [self.formDescriptor removeObserversOfObject:row predicateType:XLPredicateTypeHidden];
-    [self.allRows removeObjectAtIndex:index];
-}
-
-#pragma mark - Helpers
-
--(BOOL)canInsertUsingButton
-{
-    return (self.sectionInsertMode == XLFormSectionInsertModeButton && self.sectionOptions & XLFormSectionOptionCanInsert);
-}
-
-#pragma mark - Predicates
-
-
--(NSNumber *)hidePredicateCache
-{
-    return _hidePredicateCache;
-}
-
--(void)setHidePredicateCache:(NSNumber *)hidePredicateCache
-{
-    NSParameterAssert(hidePredicateCache);
-    self.isDirtyHidePredicateCache = NO;
-    if (!_hidePredicateCache || ![_hidePredicateCache isEqualToNumber:hidePredicateCache]){
-        _hidePredicateCache = hidePredicateCache;
-    }
-}
-
--(BOOL)isHidden
-{
-    if (self.isDirtyHidePredicateCache) {
-        return [self evaluateIsHidden];
-    }
-    return [self.hidePredicateCache boolValue];
-}
-
--(BOOL)evaluateIsHidden
-{
-    if ([_hidden isKindOfClass:[NSPredicate class]]) {
-        if (!self.formDescriptor) {
-            self.isDirtyHidePredicateCache = YES;
-        } else {
-            @try {
-                self.hidePredicateCache = @([_hidden evaluateWithObject:self substitutionVariables:self.formDescriptor.allRowsByTag ?: @{}]);
-            }
-            @catch (NSException *exception) {
-                // predicate syntax error.
-                self.isDirtyHidePredicateCache = YES;
-            };
-        }
-    }
-    else{
-        self.hidePredicateCache = _hidden;
-    }
-    if ([self.hidePredicateCache boolValue]){
-        if ([self.formDescriptor.delegate isKindOfClass:[XLFormViewController class]]){
-            XLFormBaseCell* firtResponder = (XLFormBaseCell*) [((XLFormViewController*)self.formDescriptor.delegate).tableView findFirstResponder];
-            if ([firtResponder isKindOfClass:[XLFormBaseCell class]] && firtResponder.rowDescriptor.sectionDescriptor == self){
-                [firtResponder resignFirstResponder];
-            }
-        }
-        [self.formDescriptor hideFormSection:self];
-    }
-    else{
-        [self.formDescriptor showFormSection:self];
-    }
-    return [self.hidePredicateCache boolValue];
-}
-
-
--(id)hidden
-{
-    return _hidden;
-}
-
--(void)setHidden:(id)hidden
-{
-    if ([_hidden isKindOfClass:[NSPredicate class]]){
-        [self.formDescriptor removeObserversOfObject:self predicateType:XLPredicateTypeHidden];
-    }
-    _hidden = [hidden isKindOfClass:[NSString class]] ? [hidden formPredicate] : hidden;
-    if ([_hidden isKindOfClass:[NSPredicate class]]){
-        [self.formDescriptor addObserversOfObject:self predicateType:XLPredicateTypeHidden];
-    }
-    [self evaluateIsHidden]; // check and update if this row should be hidden.
-}
-
-@end

+ 0 - 32
iOSClient/Library/XLForm/XL/Helpers/NSArray+XLFormAdditions.h

@@ -1,32 +0,0 @@
-//
-//  NSArray+XLFormAdditions.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 NSArray (XLFormAdditions)
-
--(NSInteger)formIndexForItem:(id)item;
-
-@end

+ 0 - 41
iOSClient/Library/XLForm/XL/Helpers/NSArray+XLFormAdditions.m

@@ -1,41 +0,0 @@
-//
-//  NSArray+XLFormAdditions.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 "NSArray+XLFormAdditions.h"
-#import "NSObject+XLFormAdditions.h"
-
-@implementation NSArray (XLFormAdditions)
-
--(NSInteger)formIndexForItem:(id)item
-{
-    for (id selectedValueItem in self) {
-        if ([[selectedValueItem valueData] isEqual:[item valueData]]){
-            return [self indexOfObject:selectedValueItem];
-        }
-    }
-    return NSNotFound;
-}
-
-@end

+ 0 - 33
iOSClient/Library/XLForm/XL/Helpers/NSExpression+XLFormAdditions.h

@@ -1,33 +0,0 @@
-//
-//  NSExpression+XLFormAdditions.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 NSExpression (XLFormAdditions)
-
--(NSMutableArray*) getExpressionVars;
-
-@end

+ 0 - 50
iOSClient/Library/XLForm/XL/Helpers/NSExpression+XLFormAdditions.m

@@ -1,50 +0,0 @@
-//
-//  NSExpression+XLFormAdditions.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 "NSExpression+XLFormAdditions.h"
-
-@implementation NSExpression (XLFormAdditions)
-
-
--(NSMutableArray*) getExpressionVars{
-    switch (self.expressionType) {
-        case NSFunctionExpressionType:{
-            NSString* str = [NSString stringWithFormat:@"%@", self];
-            if ([str rangeOfString:@"."].location != NSNotFound)
-                str = [str substringWithRange:NSMakeRange(1, [str rangeOfString:@"."].location - 1)];
-            else
-                str = [str substringFromIndex:1];
-            return [[NSMutableArray alloc] initWithObjects: str, nil];
-            break;
-        }
-        default:
-            return nil;
-            break;
-    }
-}
-
-
-@end

+ 0 - 33
iOSClient/Library/XLForm/XL/Helpers/NSObject+XLFormAdditions.h

@@ -1,33 +0,0 @@
-//
-//  NSObject+XLFormAdditions.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 NSObject (XLFormAdditions)
-
--(NSString *)displayText;
--(id)valueData;
-
-@end

+ 0 - 61
iOSClient/Library/XLForm/XL/Helpers/NSObject+XLFormAdditions.m

@@ -1,61 +0,0 @@
-//
-//  NSObject+XLFormAdditions.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 "XLFormRowDescriptor.h"
-
-#import "NSObject+XLFormAdditions.h"
-
-@implementation NSObject (XLFormAdditions)
-
--(NSString *)displayText
-{
-    if ([self conformsToProtocol:@protocol(XLFormOptionObject)]){
-        return [(id<XLFormOptionObject>)self formDisplayText];
-    }
-    if ([self isKindOfClass:[NSString class]] || [self isKindOfClass:[NSNumber class]]){
-        return [self description];
-    }
-    return nil;
-}
-
--(id)valueData
-{
-    if ([self isKindOfClass:[NSString class]] || [self isKindOfClass:[NSNumber class]] || [self isKindOfClass:[NSDate class]]){
-        return self;
-    }
-    if ([self isKindOfClass:[NSArray class]]) {
-        NSMutableArray * result = [NSMutableArray array];
-        [(NSArray *)self enumerateObjectsUsingBlock:^(id obj, NSUInteger __unused idx, BOOL __unused *stop) {
-            [result addObject:[obj valueData]];
-        }];
-        return result;
-    }
-    if ([self conformsToProtocol:@protocol(XLFormOptionObject)]){
-        return [(id<XLFormOptionObject>)self formValue];
-    }
-    return nil;
-}
-
-@end

+ 0 - 31
iOSClient/Library/XLForm/XL/Helpers/NSPredicate+XLFormAdditions.h

@@ -1,31 +0,0 @@
-//
-//  NSPredicate+XLFormAdditions.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 NSPredicate (XLFormAdditions)
-
--(NSMutableArray*) getPredicateVars;
-@end

+ 0 - 45
iOSClient/Library/XLForm/XL/Helpers/NSPredicate+XLFormAdditions.m

@@ -1,45 +0,0 @@
-//
-//  NSPredicate+XLFormAdditions.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 "NSPredicate+XLFormAdditions.h"
-#import "NSExpression+XLFormAdditions.h"
-
-@implementation NSPredicate (XLFormAdditions)
-
-
--(NSMutableArray*) getPredicateVars{
-    NSMutableArray* ret = [[NSMutableArray alloc] init];
-    if ([self isKindOfClass:([NSCompoundPredicate class])]) {
-        for (id object in ((NSCompoundPredicate*) self).subpredicates ) {
-            [ret addObjectsFromArray:[object getPredicateVars]];
-        }
-    }
-    else if ([self isKindOfClass:([NSComparisonPredicate class])]){
-        [ret addObjectsFromArray:[((NSComparisonPredicate*) self).leftExpression getExpressionVars]];
-        [ret addObjectsFromArray:[((NSComparisonPredicate*) self).rightExpression getExpressionVars]];
-    }
-    return ret;
-}
-
-@end

+ 0 - 35
iOSClient/Library/XLForm/XL/Helpers/NSString+XLFormAdditions.h

@@ -1,35 +0,0 @@
-//
-//  NSString+XLFormAdditions.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>
-#import "XLFormDescriptor.h"
-
-@interface NSString (XLFormAdditions)
-
--(NSPredicate *)formPredicate;
-
--(NSString *)formKeyForPredicateType:(XLPredicateType)predicateType;
-
-@end

+ 0 - 65
iOSClient/Library/XLForm/XL/Helpers/NSString+XLFormAdditions.m

@@ -1,65 +0,0 @@
-//
-//  NSString+XLFormAdditions.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 "NSString+XLFormAdditions.h"
-
-@implementation NSString (XLFormAdditions)
-
--(NSPredicate *)formPredicate
-{
-    // returns an array of strings where the first one is the new string with the correct replacements
-    // and the rest are all the tags that appear in the string
-    NSString* separator = @"$";
-    
-    NSArray* tokens = [self componentsSeparatedByString:separator];
-    NSMutableString* new_string = [[NSMutableString alloc] initWithString:tokens[0]];
-    NSRange range;
-    for (int i = 1; i < tokens.count; i++) {
-        [new_string appendString:separator];
-        NSArray* subtokens = [[tokens[i] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@" <>!=+-&|()"]][0]
-                              componentsSeparatedByString:@"."];
-        NSString* tag = subtokens[0];
-        NSString* attribute;
-        if ([subtokens count] >= 2) {
-            attribute = subtokens[1];
-        }
-        [new_string appendString:tag];
-        range = [tokens[i] rangeOfString:[NSString stringWithFormat:@"%@", tag]];
-        if (!attribute || (![attribute isEqualToString:@"value"] && ![attribute isEqualToString:@"isHidden"] && ![attribute isEqualToString:@"isDisabled"])){
-            [new_string appendString:@".value"];
-        }
-        [new_string appendString:[tokens[i] substringFromIndex:range.location + range.length]];
-    }
-    return [NSPredicate predicateWithFormat:new_string];
-
-}
-
-
--(NSString *)formKeyForPredicateType:(XLPredicateType)predicateType
-{
-    return [NSString stringWithFormat:@"%@-%@", self, (predicateType == XLPredicateTypeHidden ? @"hidden" : @"disabled") ];
-}
-
-@end

+ 0 - 36
iOSClient/Library/XLForm/XL/Helpers/UIView+XLFormAdditions.h

@@ -1,36 +0,0 @@
-//
-//  UIView+XLFormAdditions.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 "XLFormDescriptorCell.h"
-#import <UIKit/UIKit.h>
-
-@interface UIView (XLFormAdditions)
-
-+(id)autolayoutView;
--(NSLayoutConstraint *)layoutConstraintSameHeightOf:(UIView *)view;
--(UIView *)findFirstResponder;
--(UITableViewCell<XLFormDescriptorCell> *)formDescriptorCell;
-
-@end

+ 0 - 73
iOSClient/Library/XLForm/XL/Helpers/UIView+XLFormAdditions.m

@@ -1,73 +0,0 @@
-//
-//  UIView+XLFormAdditions.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 "UIView+XLFormAdditions.h"
-
-@implementation UIView (XLFormAdditions)
-
-+ (id)autolayoutView
-{
-    UIView *view = [self new];
-    view.translatesAutoresizingMaskIntoConstraints = NO;
-    return view;
-}
-
--(NSLayoutConstraint *)layoutConstraintSameHeightOf:(UIView *)view
-{
-    return [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeHeight multiplier:1.0f constant:0.0f];
-}
-
-- (UIView *)findFirstResponder
-{
-    if (self.isFirstResponder) {
-        return self;
-    }
-    for (UIView *subView in self.subviews) {
-        UIView *firstResponder = [subView findFirstResponder];
-        if (firstResponder != nil) {
-            return firstResponder;
-        }
-    }
-    return nil;
-}
-
-- (UITableViewCell<XLFormDescriptorCell> *)formDescriptorCell
-{
-    if ([self isKindOfClass:[UITableViewCell class]]) {
-        if ([self conformsToProtocol:@protocol(XLFormDescriptorCell)]){
-            return (UITableViewCell<XLFormDescriptorCell> *)self;
-        }
-        return nil;
-    }
-    if (self.superview) {
-        UITableViewCell<XLFormDescriptorCell> * tableViewCell = [self.superview formDescriptorCell];
-        if (tableViewCell != nil) {
-            return tableViewCell;
-        }
-    }
-    return nil;
-}
-
-@end

+ 0 - 30
iOSClient/Library/XLForm/XL/Helpers/Views/XLFormRightDetailCell.h

@@ -1,30 +0,0 @@
-//
-//  XLFormRightDetailCell.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 <UIKit/UIKit.h>
-
-@interface XLFormRightDetailCell : UITableViewCell
-
-@end

+ 0 - 35
iOSClient/Library/XLForm/XL/Helpers/Views/XLFormRightDetailCell.m

@@ -1,35 +0,0 @@
-//
-//  XLFormRightDetailCell.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 "XLFormRightDetailCell.h"
-
-@implementation XLFormRightDetailCell
-
-- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
-{
-    return [super initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier];
-}
-
-@end

+ 0 - 30
iOSClient/Library/XLForm/XL/Helpers/Views/XLFormRightImageButton.h

@@ -1,30 +0,0 @@
-//
-//  XLFormRightImageButton.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 <UIKit/UIKit.h>
-
-@interface XLFormRightImageButton : UIButton
-
-@end

+ 0 - 40
iOSClient/Library/XLForm/XL/Helpers/Views/XLFormRightImageButton.m

@@ -1,40 +0,0 @@
-//
-//  XLFormRightImageButton.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 "XLFormRightImageButton.h"
-
-@implementation XLFormRightImageButton
-
-
-- (CGSize)intrinsicContentSize
-{
-    CGSize s = [super intrinsicContentSize];
-    return CGSizeMake(s.width + self.titleEdgeInsets.left + self.titleEdgeInsets.right,
-                      s.height + self.titleEdgeInsets.top + self.titleEdgeInsets.bottom);
-
-}
-
-
-@end

+ 0 - 34
iOSClient/Library/XLForm/XL/Helpers/Views/XLFormRowNavigationAccessoryView.h

@@ -1,34 +0,0 @@
-//
-//  XLFormRowNavigationAccessoryView.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 <UIKit/UIKit.h>
-
-@interface XLFormRowNavigationAccessoryView : UIToolbar
-
-@property (nonatomic) UIBarButtonItem *previousButton;
-@property (nonatomic) UIBarButtonItem *nextButton;
-@property (nonatomic) UIBarButtonItem *doneButton;
-
-@end

+ 0 - 102
iOSClient/Library/XLForm/XL/Helpers/Views/XLFormRowNavigationAccessoryView.m

@@ -1,102 +0,0 @@
-//  XLFormRowNavigationAccessoryView.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 "XLFormRowNavigationAccessoryView.h"
-
-
-@interface XLFormRowNavigationAccessoryView ()
-
-@property (nonatomic) UIBarButtonItem *fixedSpace;
-@property (nonatomic) UIBarButtonItem *flexibleSpace;
-
-@end
-
-@implementation XLFormRowNavigationAccessoryView
-
-@synthesize previousButton = _previousButton;
-@synthesize nextButton = _nextButton;
-@synthesize doneButton = _doneButton;
-
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-    self = [super initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 44.0)];
-    if (self) {
-        self.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth);
-        NSArray * items = [NSArray arrayWithObjects:self.previousButton,
-                           self.fixedSpace,
-                           self.nextButton,
-                           self.flexibleSpace,
-                           self.doneButton, nil];
-        [self setItems:items];
-    }
-    return self;
-}
-
-#pragma mark - Properties
-
--(UIBarButtonItem *)previousButton
-{
-    if (_previousButton) return _previousButton;
-    _previousButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:105 target:nil action:nil];
-    return _previousButton;
-}
-
--(UIBarButtonItem *)fixedSpace
-{
-    if (_fixedSpace) return _fixedSpace;
-    _fixedSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
-    _fixedSpace.width = 22.0;
-    return _fixedSpace;
-}
-
--(UIBarButtonItem *)nextButton
-{
-    if (_nextButton) return _nextButton;
-    _nextButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:106 target:nil action:nil];
-    return _nextButton;
-}
-
--(UIBarButtonItem *)flexibleSpace
-{
-    if (_flexibleSpace) return _flexibleSpace;
-    _flexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
-    return _flexibleSpace;
-}
-
--(UIBarButtonItem *)doneButton
-{
-    if (_doneButton) return _doneButton;
-    _doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:nil action:nil];
-    return _doneButton;
-}
-
-#pragma mark - Helpers
-
-- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent *)event
-{
-}
-
-@end

+ 0 - 37
iOSClient/Library/XLForm/XL/Helpers/Views/XLFormTextView.h

@@ -1,37 +0,0 @@
-//
-//  XLFormTextView.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 <UIKit/UIKit.h>
-
-@interface XLFormTextView : UITextView
-
-
-@property (nonatomic) NSString *placeholder;
-@property (nonatomic) UIColor *placeholderColor;
-
-@property (readonly) UILabel *placeHolderLabel;
-
-@end

+ 0 - 90
iOSClient/Library/XLForm/XL/Helpers/Views/XLFormTextView.m

@@ -1,90 +0,0 @@
-//
-//  XLFormTextView.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 "XLFormTextView.h"
-
-@implementation XLFormTextView
-
-- (void)dealloc
-{
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-}
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-    if((self = [super initWithFrame:frame])){
-        self.scrollsToTop = NO;
-        self.contentInset = UIEdgeInsetsMake(0, -4, 0, 0);
-        [self setPlaceholder:@""];
-        [self setPlaceholderColor:[UIColor colorWithRed:.78 green:.78 blue:.80 alpha:1.0]];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textChanged:) name:UITextViewTextDidChangeNotification object:nil];
-    }
-    return self;
-}
-
-- (void)textChanged:(NSNotification *)notification
-{
-    if([[self placeholder] length] == 0){
-        return;
-    }
-    if([[self text] length] == 0){
-        [[self viewWithTag:999] setAlpha:1];
-    }
-    else{
-        [[self viewWithTag:999] setAlpha:0];
-    }
-}
-
-- (void)setText:(NSString *)text {
-    [super setText:text];
-    [self textChanged:nil];
-}
-
-- (void)drawRect:(CGRect)rect
-{
-    if([[self placeholder] length] > 0){
-        if (_placeHolderLabel == nil ){
-            _placeHolderLabel = [[UILabel alloc] initWithFrame:CGRectMake(4,8,self.bounds.size.width - 16,0)];
-            _placeHolderLabel.lineBreakMode = NSLineBreakByWordWrapping;
-            _placeHolderLabel.numberOfLines = 0;
-            _placeHolderLabel.backgroundColor = [UIColor clearColor];
-            _placeHolderLabel.textColor = self.placeholderColor;
-            _placeHolderLabel.alpha = 0;
-            _placeHolderLabel.tag = 999;
-            [self addSubview:_placeHolderLabel];
-        }
-        _placeHolderLabel.text = self.placeholder;
-        _placeHolderLabel.font = self.font;
-        [_placeHolderLabel sizeToFit];
-        [self sendSubviewToBack:_placeHolderLabel];
-    }
-    if( [[self text] length] == 0 && [[self placeholder] length] > 0 ){
-        [[self viewWithTag:999] setAlpha:1];
-    }
-    [super drawRect:rect];
-}
-
-@end

+ 0 - 38
iOSClient/Library/XLForm/XL/Validation/XLFormRegexValidator.h

@@ -1,38 +0,0 @@
-//
-//  XLFormRegexValidator.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 "XLFormValidatorProtocol.h"
-#import "XLFormValidationStatus.h"
-#import "XLFormValidator.h"
-
-@interface XLFormRegexValidator : XLFormValidator
-
-@property NSString *msg;
-@property NSString *regex;
-
-- (instancetype)initWithMsg:(NSString*)msg andRegexString:(NSString*)regex;
-+ (XLFormRegexValidator *)formRegexValidatorWithMsg:(NSString *)msg regex:(NSString *)regex;
-
-@end

+ 0 - 61
iOSClient/Library/XLForm/XL/Validation/XLFormRegexValidator.m

@@ -1,61 +0,0 @@
-//
-//  XLFormRegexValidator.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 "XLFormRegexValidator.h"
-
-@implementation XLFormRegexValidator
-
--(instancetype)initWithMsg:(NSString*)msg andRegexString:(NSString*)regex {
-    self = [super init];
-    if (self) {
-        self.msg = msg;
-        self.regex = regex;
-    }
-    
-    return self;
-}
-
--(XLFormValidationStatus *)isValid: (XLFormRowDescriptor *)row {
-    if (row != nil && row.value != nil) {
-        // we only validate if there is a value
-        // assumption: required validation is already triggered
-        // if this field is optional, we only validate if there is a value
-        id value = row.value;
-        if ([value isKindOfClass:[NSNumber class]]){
-            value = [value stringValue];
-        }
-        if ([value isKindOfClass:[NSString class]] && [value length] > 0) {
-            BOOL isValid = [[NSPredicate predicateWithFormat:@"SELF MATCHES %@", self.regex] evaluateWithObject:[value stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]];
-            return [XLFormValidationStatus formValidationStatusWithMsg:self.msg status:isValid rowDescriptor:row];
-        }
-    }
-    return nil;
-};
-
-+(XLFormRegexValidator *)formRegexValidatorWithMsg:(NSString *)msg regex:(NSString *)regex {
-    return [[XLFormRegexValidator alloc] initWithMsg:msg andRegexString:regex];
-}
-
-@end

+ 0 - 42
iOSClient/Library/XLForm/XL/Validation/XLFormValidationStatus.h

@@ -1,42 +0,0 @@
-//
-//  XLFormValidationStatus.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>
-
-#import "XLFormRowDescriptor.h"
-
-@interface XLFormValidationStatus : NSObject
-
-@property NSString *msg;
-@property BOOL isValid;
-@property (nonatomic, weak) XLFormRowDescriptor *rowDescriptor;
-
-//-(instancetype)initWithMsg:(NSString*)msg andStatus:(BOOL)isValid;
--(instancetype)initWithMsg:(NSString*)msg status:(BOOL)isValid rowDescriptor:(XLFormRowDescriptor *)row;
-
-//+(XLFormValidationStatus *)formValidationStatusWithMsg:(NSString *)msg status:(BOOL)status;
-+(XLFormValidationStatus *)formValidationStatusWithMsg:(NSString *)msg status:(BOOL)status rowDescriptor:(XLFormRowDescriptor *)row;
-
-@end

+ 0 - 53
iOSClient/Library/XLForm/XL/Validation/XLFormValidationStatus.m

@@ -1,53 +0,0 @@
-//
-//  XLFormValidationStatus.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 "XLFormValidationStatus.h"
-
-@implementation XLFormValidationStatus
-
--(instancetype)initWithMsg:(NSString*)msg andStatus:(BOOL)isValid {
-    return [self initWithMsg:msg status:isValid rowDescriptor:nil];
-}
-
--(instancetype)initWithMsg:(NSString*)msg status:(BOOL)isValid rowDescriptor:(XLFormRowDescriptor *)row {
-    self = [super init];
-    if (self) {
-        self.msg = msg;
-        self.isValid = isValid;
-        self.rowDescriptor = row;
-    }
-    
-    return self;
-}
-
-+(XLFormValidationStatus *)formValidationStatusWithMsg:(NSString *)msg status:(BOOL)status {
-    return [self formValidationStatusWithMsg:msg status:status rowDescriptor:nil];
-}
-
-+(XLFormValidationStatus *)formValidationStatusWithMsg:(NSString *)msg status:(BOOL)status rowDescriptor:(XLFormRowDescriptor *)row {
-  return [[XLFormValidationStatus alloc] initWithMsg:msg status:status rowDescriptor:row];
-}
-
-@end

+ 0 - 33
iOSClient/Library/XLForm/XL/Validation/XLFormValidator.h

@@ -1,33 +0,0 @@
-//
-//  XLFormValidator.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 "XLFormValidatorProtocol.h"
-
-@interface XLFormValidator : NSObject<XLFormValidatorProtocol>
-
-+(XLFormValidator *)emailValidator;
-+(XLFormValidator *)emailValidatorLong;
-@end

+ 0 - 49
iOSClient/Library/XLForm/XL/Validation/XLFormValidator.m

@@ -1,49 +0,0 @@
-//
-//  XLFormValidator.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 "XLFormValidationStatus.h"
-#import "XLFormRegexValidator.h"
-
-#import "XLFormValidator.h"
-
-@implementation XLFormValidator
-
--(XLFormValidationStatus *)isValid:(XLFormRowDescriptor *)row
-{
-    return [XLFormValidationStatus formValidationStatusWithMsg:nil status:YES rowDescriptor:row];
-}
-
-#pragma mark - Validators
-
-
-+(XLFormValidator *)emailValidator
-{
-    return [XLFormRegexValidator formRegexValidatorWithMsg:NSLocalizedString(@"Invalid email address", nil) regex:@"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"];
-}
-+(XLFormValidator *)emailValidatorLong
-{
-    return [XLFormRegexValidator formRegexValidatorWithMsg:NSLocalizedString(@"Invalid email address", nil) regex:@"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,11}"];
-}
-@end

+ 0 - 36
iOSClient/Library/XLForm/XL/Validation/XLFormValidatorProtocol.h

@@ -1,36 +0,0 @@
-//
-//  XLFormValidatorProtocol.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 "XLFormRowDescriptor.h"
-
-@class XLFormValidationStatus;
-
-@protocol XLFormValidatorProtocol <NSObject>
-
-@required
-
--(XLFormValidationStatus *)isValid:(XLFormRowDescriptor *)row;
-
-@end

+ 0 - 125
iOSClient/Library/XLForm/XL/XLForm.h

@@ -1,125 +0,0 @@
-//
-//  XLForm.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>
-
-//Descriptors
-#import "XLFormDescriptor.h"
-#import "XLFormRowDescriptor.h"
-#import "XLFormSectionDescriptor.h"
-
-// Categories
-#import "NSArray+XLFormAdditions.h"
-#import "NSExpression+XLFormAdditions.h"
-#import "NSObject+XLFormAdditions.h"
-#import "NSPredicate+XLFormAdditions.h"
-#import "NSString+XLFormAdditions.h"
-#import "UIView+XLFormAdditions.h"
-
-//helpers
-#import "XLFormOptionsObject.h"
-
-//Controllers
-#import "XLFormOptionsViewController.h"
-#import "XLFormViewController.h"
-
-//Protocols
-#import "XLFormDescriptorCell.h"
-#import "XLFormInlineRowDescriptorCell.h"
-#import "XLFormRowDescriptorViewController.h"
-
-//Cells
-#import "XLFormBaseCell.h"
-#import "XLFormButtonCell.h"
-#import "XLFormCheckCell.h"
-#import "XLFormDateCell.h"
-#import "XLFormDatePickerCell.h"
-#import "XLFormInlineSelectorCell.h"
-#import "XLFormLeftRightSelectorCell.h"
-#import "XLFormPickerCell.h"
-#import "XLFormRightDetailCell.h"
-#import "XLFormRightImageButton.h"
-#import "XLFormSegmentedCell.h"
-#import "XLFormSelectorCell.h"
-#import "XLFormSliderCell.h"
-#import "XLFormStepCounterCell.h"
-#import "XLFormSwitchCell.h"
-#import "XLFormTextFieldCell.h"
-#import "XLFormTextViewCell.h"
-#import "XLFormImageCell.h"
-
-//Validation
-#import "XLFormRegexValidator.h"
-
-
-extern NSString *const XLFormRowDescriptorTypeAccount;
-extern NSString *const XLFormRowDescriptorTypeBooleanCheck;
-extern NSString *const XLFormRowDescriptorTypeBooleanSwitch;
-extern NSString *const XLFormRowDescriptorTypeButton;
-extern NSString *const XLFormRowDescriptorTypeCountDownTimer;
-extern NSString *const XLFormRowDescriptorTypeCountDownTimerInline;
-extern NSString *const XLFormRowDescriptorTypeDate;
-extern NSString *const XLFormRowDescriptorTypeDateInline;
-extern NSString *const XLFormRowDescriptorTypeDatePicker;
-extern NSString *const XLFormRowDescriptorTypeDateTime;
-extern NSString *const XLFormRowDescriptorTypeDateTimeInline;
-extern NSString *const XLFormRowDescriptorTypeDecimal;
-extern NSString *const XLFormRowDescriptorTypeEmail;
-extern NSString *const XLFormRowDescriptorTypeImage;
-extern NSString *const XLFormRowDescriptorTypeInfo;
-extern NSString *const XLFormRowDescriptorTypeInteger;
-extern NSString *const XLFormRowDescriptorTypeMultipleSelector;
-extern NSString *const XLFormRowDescriptorTypeMultipleSelectorPopover;
-extern NSString *const XLFormRowDescriptorTypeName;
-extern NSString *const XLFormRowDescriptorTypeNumber;
-extern NSString *const XLFormRowDescriptorTypePassword;
-extern NSString *const XLFormRowDescriptorTypePhone;
-extern NSString *const XLFormRowDescriptorTypePicker;
-extern NSString *const XLFormRowDescriptorTypeSelectorActionSheet;
-extern NSString *const XLFormRowDescriptorTypeSelectorAlertView;
-extern NSString *const XLFormRowDescriptorTypeSelectorLeftRight;
-extern NSString *const XLFormRowDescriptorTypeSelectorPickerView;
-extern NSString *const XLFormRowDescriptorTypeSelectorPickerViewInline;
-extern NSString *const XLFormRowDescriptorTypeSelectorPopover;
-extern NSString *const XLFormRowDescriptorTypeSelectorPush;
-extern NSString *const XLFormRowDescriptorTypeSelectorSegmentedControl;
-extern NSString *const XLFormRowDescriptorTypeSlider;
-extern NSString *const XLFormRowDescriptorTypeStepCounter;
-extern NSString *const XLFormRowDescriptorTypeText;
-extern NSString *const XLFormRowDescriptorTypeTextView;
-extern NSString *const XLFormRowDescriptorTypeTime;
-extern NSString *const XLFormRowDescriptorTypeTimeInline;
-extern NSString *const XLFormRowDescriptorTypeTwitter;
-extern NSString *const XLFormRowDescriptorTypeURL;
-extern NSString *const XLFormRowDescriptorTypeZipCode;
-
-
-#define SYSTEM_VERSION_EQUAL_TO(v)                  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
-#define SYSTEM_VERSION_GREATER_THAN(v)              ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
-#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
-#define SYSTEM_VERSION_LESS_THAN(v)                 ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
-#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v)     ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending
-
-

+ 0 - 69
iOSClient/Library/XLForm/XL/XLForm.m

@@ -1,69 +0,0 @@
-//
-//  XLForm.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 "XLForm.h"
-
-NSString *const XLFormRowDescriptorTypeText = @"text";
-NSString *const XLFormRowDescriptorTypeName = @"name";
-NSString *const XLFormRowDescriptorTypeURL = @"url";
-NSString *const XLFormRowDescriptorTypeEmail = @"email";
-NSString *const XLFormRowDescriptorTypePassword = @"password";
-NSString *const XLFormRowDescriptorTypeNumber = @"number";
-NSString *const XLFormRowDescriptorTypePhone = @"phone";
-NSString *const XLFormRowDescriptorTypeTwitter = @"twitter";
-NSString *const XLFormRowDescriptorTypeAccount = @"account";
-NSString *const XLFormRowDescriptorTypeInteger = @"integer";
-NSString *const XLFormRowDescriptorTypeImage = @"image";
-NSString *const XLFormRowDescriptorTypeDecimal = @"decimal";
-NSString *const XLFormRowDescriptorTypeTextView = @"textView";
-NSString *const XLFormRowDescriptorTypeZipCode = @"zipCode";
-NSString *const XLFormRowDescriptorTypeSelectorPush = @"selectorPush";
-NSString *const XLFormRowDescriptorTypeSelectorPopover = @"selectorPopover";
-NSString *const XLFormRowDescriptorTypeSelectorActionSheet = @"selectorActionSheet";
-NSString *const XLFormRowDescriptorTypeSelectorAlertView = @"selectorAlertView";
-NSString *const XLFormRowDescriptorTypeSelectorPickerView = @"selectorPickerView";
-NSString *const XLFormRowDescriptorTypeSelectorPickerViewInline = @"selectorPickerViewInline";
-NSString *const XLFormRowDescriptorTypeMultipleSelector = @"multipleSelector";
-NSString *const XLFormRowDescriptorTypeMultipleSelectorPopover = @"multipleSelectorPopover";
-NSString *const XLFormRowDescriptorTypeSelectorLeftRight = @"selectorLeftRight";
-NSString *const XLFormRowDescriptorTypeSelectorSegmentedControl = @"selectorSegmentedControl";
-NSString *const XLFormRowDescriptorTypeDateInline = @"dateInline";
-NSString *const XLFormRowDescriptorTypeDateTimeInline = @"datetimeInline";
-NSString *const XLFormRowDescriptorTypeTimeInline = @"timeInline";
-NSString *const XLFormRowDescriptorTypeCountDownTimerInline = @"countDownTimerInline";
-NSString *const XLFormRowDescriptorTypeDate = @"date";
-NSString *const XLFormRowDescriptorTypeDateTime = @"datetime";
-NSString *const XLFormRowDescriptorTypeTime = @"time";
-NSString *const XLFormRowDescriptorTypeCountDownTimer = @"countDownTimer";
-NSString *const XLFormRowDescriptorTypeDatePicker = @"datePicker";
-NSString *const XLFormRowDescriptorTypePicker = @"picker";
-NSString *const XLFormRowDescriptorTypeSlider = @"slider";
-NSString *const XLFormRowDescriptorTypeBooleanCheck = @"booleanCheck";
-NSString *const XLFormRowDescriptorTypeBooleanSwitch = @"booleanSwitch";
-NSString *const XLFormRowDescriptorTypeButton = @"button";
-NSString *const XLFormRowDescriptorTypeInfo = @"info";
-NSString *const XLFormRowDescriptorTypeStepCounter = @"stepCounter";
-

BIN
iOSClient/Library/XLForm/XLForm.bundle/forwardarrow@2x.png


+ 1 - 2
iOSClient/Settings/CCAdvanced.h

@@ -22,8 +22,7 @@
 //
 
 #import <MessageUI/MFMailComposeViewController.h>
-#import "XLFormViewController.h"
-#import "XLForm.h"
+#import <XLForm/XLForm.h>
 #import "CCHud.h"
 
 @interface CCAdvanced : XLFormViewController <MFMailComposeViewControllerDelegate>

+ 1 - 3
iOSClient/Settings/CCManageAccount.h

@@ -21,11 +21,9 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
-#import "XLFormViewController.h"
-#import "XLForm.h"
+#import <XLForm/XLForm.h>
 #import "CCLogin.h"
 
-
 @interface CCManageAccount : XLFormViewController
 
 - (void)deleteAccount:(NSString *)account;

+ 1 - 1
iOSClient/Settings/CCManageAutoUpload.h

@@ -21,7 +21,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
-#import "XLFormViewController.h"
+#import <XLForm/XLForm.h>
 #import "CCMain.h"
 #import "CCManageLocation.h"
 

+ 1 - 2
iOSClient/Settings/CCSettings.h

@@ -23,8 +23,7 @@
 
 #import <UIKit/UIKit.h>
 #import <MessageUI/MessageUI.h>
-#import "XLFormViewController.h"
-#import "XLForm.h"
+#import <XLForm/XLForm.h>
 #import "BKPasscodeViewController.h"
 #import "CCUtility.h"
 #import "CCHud.h"

+ 1 - 2
iOSClient/Settings/NCManageEndToEndEncryption.h

@@ -21,8 +21,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
-#import "XLFormViewController.h"
-#import "XLForm.h"
+#import <XLForm/XLForm.h>
 #import "BKPasscodeViewController.h"
 #import "OCNetworking.h"