Skip to content

Commit

Permalink
Merge pull request #584 from ddaddy/develop
Browse files Browse the repository at this point in the history
Fixed iPad issues
  • Loading branch information
Wei18 authored Nov 7, 2024
2 parents 0902a60 + 7022cba commit c2b96e5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ActionSheetPicker-3.0.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'ActionSheetPicker-3.0'
spec.version = '2.7.4'
spec.version = '2.7.5'
spec.summary = 'Easily present an ActionSheet with a PickerView, allowing the user to select from a number of immutable options.'
spec.description = <<-DESC
Better version of ActionSheetPicker with support iOS9 and other improvements:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,10 @@ - (void)showActionSheetPicker {
} else {
[self presentPickerForView:masterView];
}

[self addTapDismissAction];

if (![MyPopoverController canShowPopover]) {
[self addTapDismissAction];
}
}

- (void)addTapDismissAction {
Expand Down Expand Up @@ -759,6 +761,7 @@ - (void)presentPopover:(UIViewController *)viewController {
NSParameterAssert(viewController != NULL);

viewController.modalPresentationStyle = UIModalPresentationPopover;
viewController.presentationController.delegate = self;

if (self.barButtonItem) {
if (_containerView != nil) {
Expand Down Expand Up @@ -811,6 +814,21 @@ - (void)presentPopover:(UIViewController *)viewController {
}
}

#pragma mark UIAdaptivePresentationControllerDelegate
- (void)presentationControllerDidDismiss:(UIPresentationController *)presentationController {
switch (self.tapDismissAction) {
case TapActionDismiss:
[self dismissPicker];
break;
case TapActionSuccess:
[self actionPickerDone:nil];
break;
case TapActionCancel:
[self actionPickerCancel:nil];
break;
};
}

#pragma mark UIGestureRecognizerDelegate

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static NSString *const kActionType = @"buttonAction";

static NSString *const kActionTarget = @"buttonActionTarget";

@interface AbstractActionSheetPicker : NSObject <UIPopoverControllerDelegate>
@interface AbstractActionSheetPicker : NSObject <UIPopoverControllerDelegate, UIAdaptivePresentationControllerDelegate>
@property(nonatomic, strong) SWActionSheet *actionSheet;
@property (nonatomic) UIWindowLevel windowLevel;
@property(nonatomic, assign) NSInteger tag;
Expand Down

0 comments on commit c2b96e5

Please sign in to comment.