// 許可状況を確認して、許可されていなかったら許可を得る func allowAuthorization() { if getAuthorization_status() { // 許可されている return } else { // 許可されていない eventStore.requestAccessToEntityType(.Event, completion: { (granted, error) in if granted { return } else { print("Not allowed") } }) } } // 認証ステータスを確認する func getAuthorization_status() -> Bool { // 認証ステータスを取得 let status = EKEventStore.authorizationStatusForEntityType(.Eve