Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion XLForm/XL/Cell/XLFormDateCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ -(BOOL)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];
BOOL result = [super resignFirstResponder];
if ([nextFormRow.rowType isEqualToString:XLFormRowDescriptorTypeDatePicker]){
[self.rowDescriptor.sectionDescriptor removeFormRow:nextFormRow];
}
BOOL result = [super resignFirstResponder];
return result;
}
return [super resignFirstResponder];
Expand Down
1 change: 1 addition & 0 deletions XLForm/XL/Helpers/UIView+XLFormAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
-(NSLayoutConstraint *)layoutConstraintSameHeightOf:(UIView *)view;
-(UIView *)findFirstResponder;
-(UITableViewCell<XLFormDescriptorCell> *)formDescriptorCell;
-(BOOL)isRTL;

@end
16 changes: 16 additions & 0 deletions XLForm/XL/Helpers/UIView+XLFormAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,20 @@ - (UIView *)findFirstResponder
return nil;
}

- (BOOL)isRTL{
BOOL isRTL = NO;
if([self respondsToSelector:@selector(effectiveUserInterfaceLayoutDirection)] &&
[self effectiveUserInterfaceLayoutDirection] == UIUserInterfaceLayoutDirectionRightToLeft) {
isRTL = YES;
}
else if ([[UIView class] respondsToSelector:@selector(userInterfaceLayoutDirectionForSemanticContentAttribute:)] &&
[UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft) {
isRTL = YES;
}
else if ([[UIApplication sharedApplication] userInterfaceLayoutDirection] == UIUserInterfaceLayoutDirectionRightToLeft){
isRTL = YES;
}
return isRTL;
}

@end
7 changes: 4 additions & 3 deletions XLForm/XL/Helpers/Views/XLFormRowNavigationAccessoryView.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


#import "XLFormRowNavigationAccessoryView.h"

#import "UIView+XLFormAdditions.h"

@interface XLFormRowNavigationAccessoryView ()

Expand All @@ -45,9 +45,10 @@ - (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,
BOOL isRTL = [self isRTL];
NSArray * items = [NSArray arrayWithObjects:isRTL ? self.nextButton : self.previousButton,
self.fixedSpace,
self.nextButton,
isRTL ? self.previousButton : self.nextButton,
self.flexibleSpace,
self.doneButton, nil];
[self setItems:items];
Expand Down