File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed
CoreActionSheetPicker/CoreActionSheetPicker/Pickers Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 1
1
Pod ::Spec . new do |spec |
2
2
spec . name = 'ActionSheetPicker-3.0'
3
- spec . version = '2.7.4 '
3
+ spec . version = '2.7.5 '
4
4
spec . summary = 'Easily present an ActionSheet with a PickerView, allowing the user to select from a number of immutable options.'
5
5
spec . description = <<-DESC
6
6
Better version of ActionSheetPicker with support iOS9 and other improvements:
Original file line number Diff line number Diff line change @@ -288,8 +288,10 @@ - (void)showActionSheetPicker {
288
288
} else {
289
289
[self presentPickerForView: masterView];
290
290
}
291
-
292
- [self addTapDismissAction ];
291
+
292
+ if (![MyPopoverController canShowPopover ]) {
293
+ [self addTapDismissAction ];
294
+ }
293
295
}
294
296
295
297
- (void )addTapDismissAction {
@@ -759,6 +761,7 @@ - (void)presentPopover:(UIViewController *)viewController {
759
761
NSParameterAssert (viewController != NULL );
760
762
761
763
viewController.modalPresentationStyle = UIModalPresentationPopover;
764
+ viewController.presentationController .delegate = self;
762
765
763
766
if (self.barButtonItem ) {
764
767
if (_containerView != nil ) {
@@ -811,6 +814,21 @@ - (void)presentPopover:(UIViewController *)viewController {
811
814
}
812
815
}
813
816
817
+ #pragma mark UIAdaptivePresentationControllerDelegate
818
+ - (void )presentationControllerDidDismiss : (UIPresentationController *)presentationController {
819
+ switch (self.tapDismissAction ) {
820
+ case TapActionDismiss:
821
+ [self dismissPicker ];
822
+ break ;
823
+ case TapActionSuccess:
824
+ [self actionPickerDone: nil ];
825
+ break ;
826
+ case TapActionCancel:
827
+ [self actionPickerCancel: nil ];
828
+ break ;
829
+ };
830
+ }
831
+
814
832
#pragma mark UIGestureRecognizerDelegate
815
833
816
834
- (BOOL )gestureRecognizer : (UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer : (UIGestureRecognizer *)otherGestureRecognizer {
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ static NSString *const kActionType = @"buttonAction";
60
60
61
61
static NSString *const kActionTarget = @" buttonActionTarget" ;
62
62
63
- @interface AbstractActionSheetPicker : NSObject <UIPopoverControllerDelegate>
63
+ @interface AbstractActionSheetPicker : NSObject <UIPopoverControllerDelegate, UIAdaptivePresentationControllerDelegate >
64
64
@property (nonatomic , strong ) SWActionSheet *actionSheet;
65
65
@property (nonatomic ) UIWindowLevel windowLevel;
66
66
@property (nonatomic , assign ) NSInteger tag;
You can’t perform that action at this time.
0 commit comments