func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let eventVC = EKEventViewController()
eventVC.event = eventItems[indexPath.row]
eventVC.allowsEditing = true
eventVC.allowsCalendarPreview = true
eventVC.delegate = self
self.presentViewController(eventVC, animated: true, completion: nil)
}
위와 같이 했는데 Done 버튼이 나타나지 않음
아래와 같이 네이게이션 컨트롤러를 추가하고 모달 스타일을 페이지 시트로 변경하니 잘 나옴
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let eventVC = EKEventViewController()
eventVC.event = eventItems[indexPath.row]
eventVC.allowsEditing = true
eventVC.allowsCalendarPreview = true
eventVC.delegate = self
let nav = UINavigationController(rootViewController: eventVC)
nav.modalPresentationStyle = .PageSheet
self.presentViewController(nav, animated: true, completion: nil)
}
댓글
댓글 쓰기