Skip to content
This repository was archived by the owner on Apr 26, 2025. It is now read-only.

942v dev#44

Open
942v wants to merge 2 commits intovsanthanam:masterfrom
942v:942v_dev
Open

942v dev#44
942v wants to merge 2 commits intovsanthanam:masterfrom
942v:942v_dev

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants