Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9064029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:08:45+00:00 2026-06-16T16:08:45+00:00

If a modal view is presented from a framework (in my case eventkit), What

  • 0

If a modal view is presented from a framework (in my case eventkit), What would be the correct way to detect if the cancel or if the done button is pressed. In my example on the didCompleteWithaction my modal view is dismissed, an alert view is fired. I want the alert view only fired if the Done button is pressed rather than the cancel button.

My initial thoughts were an if statement when the the done button is pressed, however im not sure how I get the property of the done button.

- (void)eventEditViewController:(EKEventEditViewController *)controller
      didCompleteWithAction:(EKEventEditViewAction)action {

// Dismiss the modal view controller
[controller dismissModalViewControllerAnimated:YES];

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"message" message:@"Added to calender" delegate:nil cancelButtonTitle: @"Ok" otherButtonTitles: nil];

[alert show];


}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:08:46+00:00Added an answer on June 16, 2026 at 4:08 pm

    Look at the delegate’s protocol reference: apple documentation

    You will have to check the action parameter of the delegate method, as it represents what action the user chose.

    Eg

    - (void)eventEditViewController:(EKEventEditViewController *)controller
          didCompleteWithAction:(EKEventEditViewAction)action {
    
    // Dismiss the modal view controller
    [controller dismissModalViewControllerAnimated:YES];
    
    //this checks what action the user chose:
    if (action == EKEventEditViewActionSaved) {
         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"message" message:@"Added to calender" delegate:nil cancelButtonTitle: @"Ok" otherButtonTitles: nil];
    
         [alert show];
         }
    
    
    }
    

    I don’t know what action will be triggered by the “done” button, possibly …ActionSaved – but check it out yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a problem while calling a navigation method from a presented modal view.
I have a modal view controller that is presented from my main view, I
I presented a modal view where the presented view contains a tabbar controller.The view
Is it possible to present a modal view controller in such a way that
In my app, I presented a modal view. In modal view, I taken a
I have a UIViewController (call it NumberTwo) which I presented as a modal view
I have a view controller that I would like to present in a modal
I have a modal view controller whose view comes from a XIB. I want
I'm programmatically switching TabBarController views from a modal view controller (see this question ).
I have a view that is presented when a user clicks on a button

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.