2

I am using the EKEventEditViewController to add events to the calendar, however I need to customise the table view, such as background colour and cell properties.

I have tried looping through its subviews like so with no luck.

Failed code:

EKEventEditViewController *eventVc = [[EKEventEditViewController alloc] init];
    eventVc.event = event;
    eventVc.delegate = self;
    eventVc.eventStore = eventStore;
    eventVc.editViewDelegate = self;

    for (UITableView *view in [eventVc.view subviews]) {
        [view setBackgroundColor:[UIColor redColor]];
    }

    [self presentModalViewController:eventVc animated:YES];
halfer
  • 19,824
  • 17
  • 99
  • 186
Josh Kahane
  • 16,765
  • 45
  • 140
  • 253

2 Answers2

2

you can use UINavigationController delegate method to customize EKEventEditViewController.

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
    if ([viewController isKindOfClass:[UITableViewController class]]) {

        UITableView *tblView=((UITableViewController*)viewController).tableView;

        [tblView setBackgroundColor:[UIColor redColor]];
        [tblView setBackgroundView:nil];
    }
}

Have a look at this https://stackoverflow.com/a/17469491/1305001

Community
  • 1
  • 1
Prince Kumar Sharma
  • 12,591
  • 4
  • 59
  • 90
0

There hasn't been a simple solution to this, but I ended up creating a custom view controller from which I handled all the event data manually.

halfer
  • 19,824
  • 17
  • 99
  • 186
Josh Kahane
  • 16,765
  • 45
  • 140
  • 253
  • Hii Josh, will yo please elaborate how to handle the event data manually, i also want to customize the EKEventEditViewController, i want to add two more fields and want to remove one URL field, How should i do that.. please help me. – iShwar May 25 '13 at 11:41