モーダルビューがフレームワーク(私の場合はイベントキット)から提示される場合、キャンセルまたは完了ボタンが押されたかどうかを検出する正しい方法は何でしょうか。私のモーダルビューの例ではdidCompleteWithaction
、モーダルビューが閉じられ、アラートビューが起動されます。Done
キャンセルボタンではなく、ボタンが押された場合にのみアラートビューを表示したい。
私の最初の考えはif
、完了ボタンが押されたときのステートメントでしたが、完了ボタンのプロパティを取得する方法がわかりません。
- (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];
}