title: Error Getting Default Calendar For New Events - Swift
body: <p>I encountered an issue trying to create a new event on iOS's Calendar application while using Swift.</p>
  <p>This is what I have so far:</p>
  <pre><code>func addToCal(){
      let eventStore = EKEventStore()
      
      eventStore.requestAccessToEntityType(EKEntityTypeReminder) {
          (granted: Bool, err: NSError!) in
          if granted &amp;&amp; !err {
              var event:EKEvent = EKEvent(eventStore: eventStore)
              event.title = self.eventTitle!.text
              event.startDate = self.eventData.startDateObj
              event.endDate = self.eventData.endDateObj
              event.calendar = eventStore.defaultCalendarForNewEvents
              eventStore.saveEvent(event, span: EKSpanThisEvent, error: nil)
              println(&quot;Saved Event&quot;)
          }
      }
  </code></pre>
  <p>This is the error that I'm getting:</p>
  <pre><code>Error getting default calendar for new events: Error Domain=EKCADErrorDomain Code=1013 &quot;The operation couldn’t be completed. (EKCADErrorDomain error 1013.)&quot;
  </code></pre>
  <p>I checked my syntax and I'm pretty sure I got it right, so can anyone help me figure out where I'm going wrong?</p>
  <h2>Additional Information</h2>
  <ul>
  <li>iOS 8 Beta 5</li>
  <li>Xcode 6 Beta 5</li>
  <li>Issue occurs on iPad Mini w/ Retina Display (real device)</li>
  </ul>
  <h2>Update</h2>
  <p>Changing <code>EKEntityTypeReminder</code> to <code>EKEntityTypeEvent</code> (Sorry, my mistake) actually doesn't produce an error, but now the event doesn't even show up in Calendar. I checked the outputs of <code>granted</code> and <code>err</code> and I see <code>false</code> and <code>nil</code>, respectively.</p>