两个“编辑”按钮的行为方式相同。所以我想删除一个编辑按钮。我怎样才能实现它?
//*****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)
答案 0 :(得分:0)
可以通过将其删除两次来完成:
presentViewController(navController, animated: true) {
eventDetail.navigationItem.leftBarButtonItem = nil
}
/////////////////
class EventViewController: EKEventViewController {
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
navigationItem.leftBarButtonItem = nil
}
}