2 Commits

Author SHA1 Message Date
Mathias Claassen 870afc5660 Version bump 4.3.0 (#1080) 2021-03-24 10:27:47 -03:00
Nick Reffitt ded97b8328 Add datePicker style property to XLFormDateCell (#1078)
Co-authored-by: Nick <nick@nicks-air.mynet>
2020-11-18 10:00:10 -03:00
7 changed files with 42 additions and 3 deletions
+3
View File
@@ -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)
+1 -1
View File
@@ -1150,7 +1150,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.
+1 -1
View File
@@ -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
+4
View File
@@ -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
View File
@@ -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>
+8
View File
@@ -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;
+24
View File
@@ -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];
}
}
}