两个“编辑”按钮的行为均相同。所以我想删除一个编辑按钮。我该如何实现?

//*****my code is here:
    var eventDetail = EKEventViewController()
    eventDetail.event = selectedEvent
    eventDetail.allowsEditing = true
    eventDetail.allowsCalendarPreview = true
    eventDetail.delegate = self
    var navController = UINavigationController(rootViewController:eventDetail)  presentViewController(navController, animated: true, completion: nil)

最佳答案

可以通过将其删除两次来完成:

presentViewController(navController, animated: true) {
    eventDetail.navigationItem.leftBarButtonItem = nil
}

/////////////////
class EventViewController: EKEventViewController {

    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
        navigationItem.leftBarButtonItem = nil
    }
}

10-08 06:08