title: Swift: Error getting all calendars: Error Domain=EKCADErrorDomain Code=1013 "The operation couldn’t be completed. even answered 'Allow'
body: <p>I have following example where I get:</p>
  
  <pre><code>Error getting all calendars: Error Domain=EKCADErrorDomain Code=1013 "The operation couldn’t be completed. (EKCADErrorDomain error 1013.)"
  </code></pre>
  
  <p>This is a place:</p>
  
  <pre><code>  _estore = EKEventStore()
    _estore.reset()
  
  _estore.requestAccessToEntityType(EKEntityTypeEvent, completion: {(granted:Bool!, error:NSError!) in
  
     if  granted == true {
  
        println("#########   allowed calendar accounts   #########")
  
        var calendars = self._estore.calendarsForEntityType(EKEntityTypeEvent) // &lt;-- Exception
     }
  
  })//block
  </code></pre>
  
  <p>I get proper popup <code>Allow/No</code> - I click on Allow and with debug I enter under <code>granted</code></p>
  
  <p>But get Exception.</p>
  
  <p>from <a href="https://stackoverflow.com/questions/12454324/defaultcalendarfornewevents-failed">THIS</a> answer by <code>@yunas</code> I tried to wrap my code with:</p>
  
  <pre><code>if _estore.respondsToSelector(Selector("completion:")){ /* ... */ }
  </code></pre>
  
  <p>But in this case I never enter to that <code>if</code></p>
  
  <p>Whats is wrong with code?</p>
  
  <p>Please help,</p>