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

942v dev #44

wants to merge 2 commits into from

Conversation

942v
Copy link
Contributor

@942v 942v commented Jun 21, 2018

  • What kind of change does this pull request introduce? feature
    The ability to have the action that generated the dismiss of the alert in the delegate protocol

@vsanthanam
Copy link
Owner

vsanthanam commented Jun 21, 2018

I think there needs to be some discussion around this feature.

  1. does the delegate instance method -alertController:didSelectAction: not already provide this functionality?
  2. doesn't this kind of invalidate the point of the will & did appear & disappear delegate methods? There are other ways the view controller can disappear, without an action being selected. These delegate methods exist to forward additional functionality of the usual view controller lifecycle methods to the alert view controller, because the user doesn't have access to the inner workings of VSAlertController without subclassing. Basically, if you were creating this controller, you append additional functionality to -viewWillAppear:animated:. -viewDidAppear:animated:, etc.

Here is an example of an alert controller being dismissed without an action being tapped:

- (void)showAlert {

   self.alert = /* instantiate vsialertcontroller */

}

- (void)hideAlert {

    // alert controller dismissed without user ever interacting with an action
    [self.alert dismissViewControllerAnimated:YES completion:nil];

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants