Skip to content

Commit c2b96e5

Browse files
authored
Merge pull request #584 from ddaddy/develop
Fixed iPad issues
2 parents 0902a60 + 7022cba commit c2b96e5

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

ActionSheetPicker-3.0.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'ActionSheetPicker-3.0'
3-
spec.version = '2.7.4'
3+
spec.version = '2.7.5'
44
spec.summary = 'Easily present an ActionSheet with a PickerView, allowing the user to select from a number of immutable options.'
55
spec.description = <<-DESC
66
Better version of ActionSheetPicker with support iOS9 and other improvements:

CoreActionSheetPicker/CoreActionSheetPicker/Pickers/AbstractActionSheetPicker.m

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,10 @@ - (void)showActionSheetPicker {
288288
} else {
289289
[self presentPickerForView:masterView];
290290
}
291-
292-
[self addTapDismissAction];
291+
292+
if (![MyPopoverController canShowPopover]) {
293+
[self addTapDismissAction];
294+
}
293295
}
294296

295297
- (void)addTapDismissAction {
@@ -759,6 +761,7 @@ - (void)presentPopover:(UIViewController *)viewController {
759761
NSParameterAssert(viewController != NULL);
760762

761763
viewController.modalPresentationStyle = UIModalPresentationPopover;
764+
viewController.presentationController.delegate = self;
762765

763766
if (self.barButtonItem) {
764767
if (_containerView != nil) {
@@ -811,6 +814,21 @@ - (void)presentPopover:(UIViewController *)viewController {
811814
}
812815
}
813816

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+
814832
#pragma mark UIGestureRecognizerDelegate
815833

816834
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {

CoreActionSheetPicker/CoreActionSheetPicker/Pickers/include/AbstractActionSheetPicker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static NSString *const kActionType = @"buttonAction";
6060

6161
static NSString *const kActionTarget = @"buttonActionTarget";
6262

63-
@interface AbstractActionSheetPicker : NSObject <UIPopoverControllerDelegate>
63+
@interface AbstractActionSheetPicker : NSObject <UIPopoverControllerDelegate, UIAdaptivePresentationControllerDelegate>
6464
@property(nonatomic, strong) SWActionSheet *actionSheet;
6565
@property (nonatomic) UIWindowLevel windowLevel;
6666
@property(nonatomic, assign) NSInteger tag;

0 commit comments

Comments
 (0)