Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

942v dev #44

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VSAlert.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'VSAlert'
s.version = '1.3.4'
s.version = '1.3.5'
s.summary = "An drop-in replacement for UIAlertController with more power and better looks."
s.description = "An drop-in replacement for UIAlertController that looks a hell of a lot better, built in Objective-C. Based on Codedio's aweomse Swift library, PMAlertController."
s.homepage = 'https://vsalert.vsanthanam.com'
Expand Down
10 changes: 6 additions & 4 deletions VSAlert/VSAlertController.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,19 @@ typedef NS_ENUM(NSInteger, VSAlertControllerAnimationStyle) {

/**
Sent to the delegate just before the view controller disappears.

@param alertController The alert controller
@param action The selected action
*/
- (void)alertControllerWillDisappear:(nonnull VSAlertController *)alertController;
- (void)alertControllerWillDisappear:(nonnull VSAlertController *)alertController action:(nonnull VSAlertAction *)action;

/**
Sent to teh delegate just after the view controller disappears.

@param alertController The alert controller
@param action The selected action
*/
- (void)alertControllerDidDisappear:(nonnull VSAlertController *)alertController;
- (void)alertControllerDidDisappear:(nonnull VSAlertController *)alertController action:(nonnull VSAlertAction *)action;

/**
Sent to the delegate when the user taps on an action. Message is sent *before* the action block is executed.
Expand Down
12 changes: 7 additions & 5 deletions VSAlert/VSAlertController.m
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ @interface VSAlertController ()<UIViewControllerTransitioningDelegate>
@property (NS_NONATOMIC_IOSONLY, strong) UIStackView *alertActionStackView;
@property (NS_NONATOMIC_IOSONLY, strong) NSLayoutConstraint *alertStackViewHeightConstraint;
@property (NS_NONATOMIC_IOSONLY, strong) UITapGestureRecognizer *tapRecognizer;
@property (NS_NONATOMIC_IOSONLY, strong) VSAlertAction *selectedAction;

@property (NS_NONATOMIC_IOSONLY, readonly) CGFloat alertStackViewHeight;
@property (NS_NONATOMIC_IOSONLY, readonly) BOOL hasTextFieldAdded;
Expand Down Expand Up @@ -748,11 +749,11 @@ - (void)viewWillDisappear:(BOOL)animated {

[super viewWillDisappear:animated];

if ([self.delegate respondsToSelector:@selector(alertControllerWillDisappear:)]) {
if ([self.delegate respondsToSelector:@selector(alertControllerWillDisappear:action:)]) {

dispatch_async(dispatch_get_main_queue(), ^{

[self.delegate alertControllerWillDisappear:self];
[self.delegate alertControllerWillDisappear:self action:self.selectedAction];

});

Expand All @@ -772,11 +773,11 @@ - (void)viewDidDisappear:(BOOL)animated {
name:UIKeyboardWillShowNotification
object:nil];

if ([self.delegate respondsToSelector:@selector(alertControllerDidDisappear:)]) {
if ([self.delegate respondsToSelector:@selector(alertControllerDidDisappear:action:)]) {

dispatch_async(dispatch_get_main_queue(), ^{

[self.delegate alertControllerDidDisappear:self];
[self.delegate alertControllerDidDisappear:self action:self.selectedAction];

});

Expand Down Expand Up @@ -1441,6 +1442,7 @@ - (void)_setUpPopoverController {
- (void)_dismissAlertControllerFromAction:(VSAlertAction *)sender {

// Pass action style to animator
_selectedAction = sender;
_dismissAnimator = [[VSAlertControllerTransitionAnimator alloc] initWithActionStyle:sender.style];
[self dismissViewControllerAnimated:YES completion:nil];

Expand Down