customizing Kal Calendar event

etab

I am using storyboard and kal calendar controller, I want to customize the event of choosing one day on the calendar. By default when you choose one day events on that day appears in the table view under the month calendar. What i am trying to do is when choosing one day another view controller is showing up and it is filtered on the day chosen.

Until now I founded where I should edit. But I can't call the other view to show up !!

I tried this but it dose not work !!

tableViewController *tbl = [[tableViewController alloc] initWithNibName:@"menuView" bundle:nil];

  [self dismissViewControllerAnimated:YES completion:nil];

I found this but I do not know how to use it and if it is helpful for me or not .. any help ?

UIStoryboard*  sb = [UIStoryboard storyboardWithName:@"menuView" bundle:nil];
tableViewController *vc = [sb instantiateViewControllerWithIdentifier:@"menuView"];
hgwhittle

The second batch of code in your question is headed in the right direction, but not exactly right.

First, you want to get an instance of your project's storyboard. That's what you're attempting to do in the first line of code. However, I believe you're referring to your storyboard by the wrong name. Usually Xcode defaults the name of storyboards to 'MainStoryboard.storyboard', while you're trying to refer to it as 'menuView'. So you'll want to change that first line of code to this:

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];

Next, you need a way to refer to the ViewController you want in the Storyboard. That's what you're attempting in the second line of code. You need to make sure you're getting a proper reference to it:

  1. In your storyboard, select the ViewController you're wanting to show up
  2. In the Identity inspector, enter "tableViewController" in the Class field
  3. Enter "menuView" in the Storyboard ID field

Finally, you'll need to add one line of code to actually present the ViewController.

So all in all your code should look something like this:

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
tableViewController *vc = [sb instantiateViewControllerWithIdentifier:@"menuView"];

[self presentViewController:vc animated:YES completion:nil];

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related