Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ceca40bb06 | |||
| 8335af6d83 | |||
| 6cf22d3cf2 | |||
| cd5d983b1a | |||
| 870afc5660 | |||
| ded97b8328 |
@@ -0,0 +1,13 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: xmartlabs # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
@@ -1,6 +1,9 @@
|
||||
# Change Log
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
### Version 4.3.0:
|
||||
* Add datePicker style property to XLFormDateCell (#1078)
|
||||
|
||||
### Version 4.2.0:
|
||||
* Support for Swift Package Manager (#1073)
|
||||
* Fix Carthage build (#1075)
|
||||
|
||||
@@ -43,7 +43,7 @@ PODS:
|
||||
- XLData/RemoteDataStore (2.0.0):
|
||||
- XLData/CoreRemote
|
||||
- XLData/DataStore
|
||||
- XLForm (4.2.0)
|
||||
- XLForm (4.3.0)
|
||||
|
||||
DEPENDENCIES:
|
||||
- AFNetworking (~> 2.0)
|
||||
@@ -78,8 +78,8 @@ SPEC CHECKSUMS:
|
||||
JVFloatLabeledTextField: 58a3a32cfb800e5b224f676987e7c13abf50a14d
|
||||
SHSPhoneComponent: 4cec0653a150ad63cbc52b0c8b29ce2d3c9c26f0
|
||||
XLData: df725c6179e2e0c80bf56a1ecad9afd169707a6d
|
||||
XLForm: eb04ea4104f26250b70a72a7fa2eed3748dca5cd
|
||||
XLForm: a439f9512078ed538e8335c8b06d3f3286bbfd37
|
||||
|
||||
PODFILE CHECKSUM: 64fbcd03a2c13762b2c18e3938cc8008807937c9
|
||||
|
||||
COCOAPODS: 1.9.3
|
||||
COCOAPODS: 1.11.3
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ class InlineSegmentedControl : XLFormBaseCell, XLFormInlineRowDescriptorCell {
|
||||
|
||||
var inlineRowDescriptor : XLFormRowDescriptor?
|
||||
lazy var segmentedControl : UISegmentedControl = {
|
||||
return UISegmentedControl.autolayout()!
|
||||
return UISegmentedControl.autolayout()
|
||||
}()
|
||||
|
||||
override func configure() {
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
XLForm
|
||||
---------------
|
||||
|
||||
By [XMARTLABS](http://xmartlabs.com).
|
||||

|
||||
|
||||
[](https://travis-ci.org/xmartlabs/XLForm)
|
||||
<a href="https://cocoapods.org/pods/XLForm"><img src="https://img.shields.io/cocoapods/v/XLForm.svg" alt="CocoaPods compatible" /></a>
|
||||
@@ -1150,7 +1147,7 @@ import XLForm // Swift
|
||||
## CocoaPods
|
||||
|
||||
1. Add the following line in the project's Podfile file:
|
||||
`pod 'XLForm', '~> 4.2'`.
|
||||
`pod 'XLForm', '~> 4.3'`.
|
||||
2. Run the command `pod install` from the Podfile folder directory.
|
||||
|
||||
XLForm **has no** dependencies over other pods.
|
||||
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
+1
-1
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'XLForm'
|
||||
s.version = '4.2.0'
|
||||
s.version = '4.3.0'
|
||||
s.license = { :type => 'MIT' }
|
||||
s.summary = 'XLForm is the most flexible and powerful iOS library to create dynamic table-view forms.'
|
||||
s.description = <<-DESC
|
||||
|
||||
@@ -609,6 +609,7 @@
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
@@ -616,6 +617,7 @@
|
||||
INFOPLIST_FILE = XLForm/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MARKETING_VERSION = 4.3.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.XLForm;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
@@ -629,6 +631,7 @@
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
@@ -636,6 +639,7 @@
|
||||
INFOPLIST_FILE = XLForm/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MARKETING_VERSION = 4.3.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.XLForm;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
@@ -27,6 +27,6 @@
|
||||
|
||||
@interface NSArray (XLFormAdditions)
|
||||
|
||||
-(NSInteger)formIndexForItem:(id)item;
|
||||
-(NSInteger)formIndexForItem:(nonnull id)item;
|
||||
|
||||
@end
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
@implementation NSArray (XLFormAdditions)
|
||||
|
||||
-(NSInteger)formIndexForItem:(id)item
|
||||
-(NSInteger)formIndexForItem:(nonnull id)item
|
||||
{
|
||||
for (id selectedValueItem in self) {
|
||||
if ([[selectedValueItem valueData] isEqual:[item valueData]]){
|
||||
|
||||
@@ -28,6 +28,6 @@
|
||||
|
||||
@interface NSExpression (XLFormAdditions)
|
||||
|
||||
-(NSMutableArray*) getExpressionVars;
|
||||
-(nullable NSMutableArray*) getExpressionVars;
|
||||
|
||||
@end
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
@implementation NSExpression (XLFormAdditions)
|
||||
|
||||
|
||||
-(NSMutableArray*) getExpressionVars{
|
||||
-(nullable NSMutableArray*) getExpressionVars{
|
||||
switch (self.expressionType) {
|
||||
case NSFunctionExpressionType:{
|
||||
NSString* str = [NSString stringWithFormat:@"%@", self];
|
||||
@@ -38,11 +38,9 @@
|
||||
else
|
||||
str = [str substringFromIndex:1];
|
||||
return [[NSMutableArray alloc] initWithObjects: str, nil];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return nil;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
@interface NSObject (XLFormAdditions)
|
||||
|
||||
-(NSString *)displayText;
|
||||
-(id)valueData;
|
||||
-(nullable NSString *)displayText;
|
||||
-(nullable id)valueData;
|
||||
|
||||
@end
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
@implementation NSObject (XLFormAdditions)
|
||||
|
||||
-(NSString *)displayText
|
||||
-(nullable NSString *)displayText
|
||||
{
|
||||
if ([self conformsToProtocol:@protocol(XLFormOptionObject)]){
|
||||
return [(id<XLFormOptionObject>)self formDisplayText];
|
||||
@@ -40,7 +40,7 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
-(id)valueData
|
||||
-(nullable id)valueData
|
||||
{
|
||||
if ([self isKindOfClass:[NSString class]] || [self isKindOfClass:[NSNumber class]] || [self isKindOfClass:[NSDate class]]){
|
||||
return self;
|
||||
|
||||
@@ -27,5 +27,5 @@
|
||||
|
||||
@interface NSPredicate (XLFormAdditions)
|
||||
|
||||
-(NSMutableArray*) getPredicateVars;
|
||||
-(nonnull NSMutableArray*) getPredicateVars;
|
||||
@end
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
@implementation NSPredicate (XLFormAdditions)
|
||||
|
||||
|
||||
-(NSMutableArray*) getPredicateVars{
|
||||
-(nonnull NSMutableArray*) getPredicateVars{
|
||||
NSMutableArray* ret = [[NSMutableArray alloc] init];
|
||||
if ([self isKindOfClass:([NSCompoundPredicate class])]) {
|
||||
for (id object in ((NSCompoundPredicate*) self).subpredicates ) {
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
|
||||
@interface NSString (XLFormAdditions)
|
||||
|
||||
-(NSPredicate *)formPredicate;
|
||||
-(nonnull NSPredicate *)formPredicate;
|
||||
|
||||
-(NSString *)formKeyForPredicateType:(XLPredicateType)predicateType;
|
||||
-(nonnull NSString *)formKeyForPredicateType:(XLPredicateType)predicateType;
|
||||
|
||||
@end
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
@implementation NSString (XLFormAdditions)
|
||||
|
||||
-(NSPredicate *)formPredicate
|
||||
-(nonnull 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
|
||||
@@ -57,7 +57,7 @@
|
||||
}
|
||||
|
||||
|
||||
-(NSString *)formKeyForPredicateType:(XLPredicateType)predicateType
|
||||
-(nonnull NSString *)formKeyForPredicateType:(XLPredicateType)predicateType
|
||||
{
|
||||
return [NSString stringWithFormat:@"%@-%@", self, (predicateType == XLPredicateTypeHidden ? @"hidden" : @"disabled") ];
|
||||
}
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
|
||||
@interface UIView (XLFormAdditions)
|
||||
|
||||
+(instancetype)autolayoutView;
|
||||
-(NSLayoutConstraint *)layoutConstraintSameHeightOf:(UIView *)view;
|
||||
-(UIView *)findFirstResponder;
|
||||
-(UITableViewCell<XLFormDescriptorCell> *)formDescriptorCell;
|
||||
+(nonnull instancetype)autolayoutView;
|
||||
-(nonnull NSLayoutConstraint *)layoutConstraintSameHeightOf:(nonnull UIView *)view;
|
||||
-(nullable UIView *)findFirstResponder;
|
||||
-(nullable UITableViewCell<XLFormDescriptorCell> *)formDescriptorCell;
|
||||
|
||||
@end
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
@implementation UIView (XLFormAdditions)
|
||||
|
||||
+ (instancetype)autolayoutView
|
||||
+ (nonnull instancetype)autolayoutView
|
||||
{
|
||||
__kindof UIView *view = [self new];
|
||||
view.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
@@ -35,7 +35,7 @@
|
||||
return view;
|
||||
}
|
||||
|
||||
- (NSLayoutConstraint *)layoutConstraintSameHeightOf:(UIView *)view
|
||||
- (nonnull NSLayoutConstraint *)layoutConstraintSameHeightOf:(nonnull UIView *)view
|
||||
{
|
||||
return [NSLayoutConstraint constraintWithItem:self
|
||||
attribute:NSLayoutAttributeHeight
|
||||
@@ -46,7 +46,7 @@
|
||||
constant:0.0];
|
||||
}
|
||||
|
||||
- (UIView *)findFirstResponder
|
||||
- (nullable UIView *)findFirstResponder
|
||||
{
|
||||
UIView *firstResponder = nil;
|
||||
if (self.isFirstResponder) {
|
||||
@@ -66,7 +66,7 @@
|
||||
return firstResponder;
|
||||
}
|
||||
|
||||
- (UITableViewCell<XLFormDescriptorCell> *)formDescriptorCell
|
||||
- (nullable UITableViewCell<XLFormDescriptorCell> *)formDescriptorCell
|
||||
{
|
||||
UITableViewCell<XLFormDescriptorCell> * tableViewCell = nil;
|
||||
|
||||
|
||||
@@ -32,9 +32,17 @@ typedef NS_ENUM(NSUInteger, XLFormDateDatePickerMode) {
|
||||
XLFormDateDatePickerModeTime
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSUInteger, XLFormDateDatePickerStyle) {
|
||||
XLFormDateDatePickerStyleAutomatic,
|
||||
XLFormDateDatePickerStyleCompact,
|
||||
XLFormDateDatePickerStyleInline,
|
||||
XLFormDateDatePickerStyleWheels
|
||||
};
|
||||
|
||||
@interface XLFormDateCell : XLFormBaseCell
|
||||
|
||||
@property (nonatomic, assign) XLFormDateDatePickerMode formDatePickerMode;
|
||||
@property (nonatomic, assign) XLFormDateDatePickerStyle formDatePickerStyle;
|
||||
@property (nonatomic, copy ) NSDate *minimumDate;
|
||||
@property (nonatomic, copy ) NSDate *maximumDate;
|
||||
@property (nonatomic, assign) NSInteger minuteInterval;
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
[self.datePicker setDate:self.rowDescriptor.value animated:[self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeCountDownTimer]];
|
||||
}
|
||||
[self setModeToDatePicker:self.datePicker];
|
||||
[self setStyleToDatePicker:self.datePicker];
|
||||
return self.datePicker;
|
||||
}
|
||||
return [super inputView];
|
||||
@@ -74,6 +75,7 @@
|
||||
XLFormRowDescriptor * datePickerRowDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:nil rowType:XLFormRowDescriptorTypeDatePicker];
|
||||
XLFormDatePickerCell * datePickerCell = (XLFormDatePickerCell *)[datePickerRowDescriptor cellForFormController:self.formViewController];
|
||||
[self setModeToDatePicker:datePickerCell.datePicker];
|
||||
[self setStyleToDatePicker:datePickerCell.datePicker];
|
||||
if (self.rowDescriptor.value){
|
||||
[datePickerCell.datePicker setDate:self.rowDescriptor.value animated:[self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeCountDownTimerInline]];
|
||||
}
|
||||
@@ -225,6 +227,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setStyleToDatePicker:(UIDatePicker *)datePicker
|
||||
{
|
||||
if (@available(iOS 14.0, *)) {
|
||||
switch (self.formDatePickerStyle) {
|
||||
case XLFormDateDatePickerStyleInline:
|
||||
datePicker.preferredDatePickerStyle = UIDatePickerStyleInline;
|
||||
break;
|
||||
case XLFormDateDatePickerStyleCompact:
|
||||
datePicker.preferredDatePickerStyle = UIDatePickerStyleCompact;
|
||||
break;
|
||||
case XLFormDateDatePickerStyleWheels:
|
||||
datePicker.preferredDatePickerStyle = UIDatePickerStyleWheels;
|
||||
break;
|
||||
default:
|
||||
datePicker.preferredDatePickerStyle = UIDatePickerStyleAutomatic;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Properties
|
||||
|
||||
-(UIDatePicker *)datePicker
|
||||
@@ -232,6 +254,7 @@
|
||||
if (_datePicker) return _datePicker;
|
||||
_datePicker = [[UIDatePicker alloc] init];
|
||||
[self setModeToDatePicker:_datePicker];
|
||||
[self setStyleToDatePicker:_datePicker];
|
||||
[_datePicker addTarget:self action:@selector(datePickerValueChanged:) forControlEvents:UIControlEventValueChanged];
|
||||
return _datePicker;
|
||||
}
|
||||
@@ -262,6 +285,7 @@
|
||||
if ([nextFormRow.rowType isEqualToString:XLFormRowDescriptorTypeDatePicker]){
|
||||
XLFormDatePickerCell * datePickerCell = (XLFormDatePickerCell *)[nextFormRow cellForFormController:self.formViewController];
|
||||
[self setModeToDatePicker:datePickerCell.datePicker];
|
||||
[self setStyleToDatePicker:datePickerCell.datePicker];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user