Skip to content

Commit

Permalink
Merge pull request #523 from MuscleRumble/appextensions
Browse files Browse the repository at this point in the history
Fixed #357 by adding XL_APP_EXTENSIONS macro so that XLForm can be used in App Extensions
  • Loading branch information
mats-claassen committed May 31, 2016
2 parents 11f54ce + 756fdb9 commit d29275b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions XLForm/XL/Cell/XLFormLeftRightSelectorCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ -(void)leftButtonPressed:(UIButton *)leftButton

[self.formViewController presentViewController:alertController animated:YES completion:nil];
}
#ifndef XL_APP_EXTENSIONS
else{
UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:self.rowDescriptor.selectorTitle
delegate:self cancelButtonTitle:nil
Expand All @@ -244,6 +245,7 @@ -(void)leftButtonPressed:(UIButton *)leftButton

}
#endif
#endif
}

#if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000
Expand Down
4 changes: 4 additions & 0 deletions XLForm/XL/Cell/XLFormSelectorCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ -(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)c
}
[formViewController presentViewController:alertController animated:YES completion:nil];
}
#ifndef XL_APP_EXTENSIONS
else{
UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:self.rowDescriptor.selectorTitle
delegate:self
Expand All @@ -282,6 +283,7 @@ -(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)c
actionSheet.tag = [self.rowDescriptor hash];
[actionSheet showInView:controller.view];
}
#endif
#endif
[controller.tableView deselectRowAtIndexPath:[controller.form indexPathOfFormRow:self.rowDescriptor] animated:YES];
}
Expand Down Expand Up @@ -319,6 +321,7 @@ -(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)c
[controller presentViewController:alertController animated:YES completion:nil];

}
#ifndef XL_APP_EXTENSIONS
else{
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:self.rowDescriptor.selectorTitle
message:nil
Expand All @@ -332,6 +335,7 @@ -(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)c
alertView.tag = [self.rowDescriptor hash];
[alertView show];
}
#endif
#endif
[controller.tableView deselectRowAtIndexPath:[controller.form indexPathOfFormRow:self.rowDescriptor] animated:YES];
}
Expand Down
2 changes: 2 additions & 0 deletions XLForm/XL/Controllers/XLFormViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ -(void)showFormValidationError:(NSError *)error
handler:nil]];
[self presentViewController:alertController animated:YES completion:nil];
}
#ifndef XL_APP_EXTENSIONS
else{
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"XLFormViewController_ValidationErrorTitle", nil)
message:error.localizedDescription
Expand All @@ -488,6 +489,7 @@ -(void)showFormValidationError:(NSError *)error
[alertView show];
}
#endif
#endif
}

-(void)performFormSelector:(SEL)selector withObject:(id)sender
Expand Down

0 comments on commit d29275b

Please sign in to comment.