ekeventviewcontroller hide delete button

214 Views Asked by At

I am having tableview EKEvents, if a user taps on an event i will push EKEventViewController.

EKEventViewController comes default with delete button in toolbar how can I hide this.

I tried making a custom viewController subclass of EKEventViewController and in viewWillAppear i was hiding the navigationController's toolbar it was working but not properly.Another problem with this it will allows me to navigate to event details which is not required.

let eventViewControler = EKEventViewController()
eventViewController.event = self.events[indexPath.row]
eventViewController.allowsEditing = false
self.navigationController.pushViewController(eventViewControler)

How can I hide the only delete button.

1

There are 1 best solutions below

0
Rajeev Udayan On

You can customize rightBarButtonItem.

let rightButton : UIBarButtonItem = UIBarButtonItem(title: "", style: UIBarButtonItemStyle.Plain, target: self, action: "")
self.navigationItem.rightBarButtonItem = rightButton