File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -248,22 +248,26 @@ -(void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)c
248
248
[actionSheet showInView: controller.view];
249
249
#else
250
250
if ([UIAlertController class ]) {
251
+ XLFormViewController * formViewController = self.formViewController ;
251
252
UIAlertController * alertController = [UIAlertController alertControllerWithTitle: self .rowDescriptor.selectorTitle
252
253
message: nil
253
254
preferredStyle: UIAlertControllerStyleActionSheet];
254
255
[alertController addAction: [UIAlertAction actionWithTitle: NSLocalizedString(@" Cancel" , nil )
255
256
style: UIAlertActionStyleCancel
256
257
handler: nil ]];
258
+ alertController.popoverPresentationController .sourceView = formViewController.tableView ;
259
+ UIView* v = (self.detailTextLabel ?: self.textLabel ) ?: self.contentView ;
260
+ alertController.popoverPresentationController .sourceRect = [formViewController.tableView convertRect: v.frame fromView: self ];
257
261
__weak __typeof (self)weakSelf = self;
258
262
for (id option in self.rowDescriptor .selectorOptions ) {
259
263
[alertController addAction: [UIAlertAction actionWithTitle: [option displayText ]
260
264
style: UIAlertActionStyleDefault
261
265
handler: ^(UIAlertAction *action) {
262
266
[weakSelf.rowDescriptor setValue: option];
263
- [weakSelf. formViewController.tableView reloadData ];
267
+ [formViewController.tableView reloadData ];
264
268
}]];
265
269
}
266
- [self . formViewController presentViewController: alertController animated: YES completion: nil ];
270
+ [formViewController presentViewController: alertController animated: YES completion: nil ];
267
271
}
268
272
else {
269
273
UIActionSheet * actionSheet = [[UIActionSheet alloc ] initWithTitle: self .rowDescriptor.selectorTitle
You can’t perform that action at this time.
0 commit comments