Login to Twitter sometimes fails
<p>I use the simple code for login to Twitter</p>

<pre><code>[[Twitter sharedInstance] logInWithCompletion:^(TWTRSession *session, NSError *error) {
        if (session != nil) {
            NSLog(@"successful %@",session);
        } else {
            NSLog(@"error: %@", error);
        }
    }];
</code></pre>

<p>and sometimes I get the error:</p>

<blockquote>
  <p>2016-08-04 15:39:14.472 MyProject[11143:132894] [TwitterKit] did
  encounter error with message "Error attempting to obtain temporary
  auth token.": Error Domain=NSURLErrorDomain Code=-1004 "Could not
  connect to the server." UserInfo={NSUnderlyingError=0x7fe043a49830
  {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)"
  UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}},
  NSErrorFailingURLStringKey=<a href="https://api.twitter.com/oauth/request_token" rel="nofollow noreferrer">https://api.twitter.com/oauth/request_token</a>,
  NSErrorFailingURLKey=<a href="https://api.twitter.com/oauth/request_token" rel="nofollow noreferrer">https://api.twitter.com/oauth/request_token</a>,
  _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61, NSLocalizedDescription=Could not connect to the server.} 2016-08-04
  15:39:14.473 EarCrush[11143:132894] [TwitterKit] did encounter error
  with message "Unable to authenticate using the system account.": Error
  Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server."
  UserInfo={NSUnderlyingError=0x7fe043a49830 {Error
  Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)"
  UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}},
  NSErrorFailingURLStringKey=<a href="https://api.twitter.com/oauth/request_token" rel="nofollow noreferrer">https://api.twitter.com/oauth/request_token</a>,
  NSErrorFailingURLKey=<a href="https://api.twitter.com/oauth/request_token" rel="nofollow noreferrer">https://api.twitter.com/oauth/request_token</a>,
  _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61, NSLocalizedDescription=Could not connect to the server.}</p>
  
  <p>2016-08-04 15:39:14.473 MyProject[11143:132894] error: Error
  Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server."
  UserInfo={NSUnderlyingError=0x7fe043a49830 {Error
  Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)"
  UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}},
  NSErrorFailingURLStringKey=<a href="https://api.twitter.com/oauth/request_token" rel="nofollow noreferrer">https://api.twitter.com/oauth/request_token</a>,
  NSErrorFailingURLKey=<a href="https://api.twitter.com/oauth/request_token" rel="nofollow noreferrer">https://api.twitter.com/oauth/request_token</a>,
  _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61, NSLocalizedDescription=Could not connect to the server.}</p>
</blockquote>

<p>I mean sometimes because:</p>

<ul>
<li>2 days ago I can login to Twitter normally  </li>
<li>Yesterday I can not login,  </li>
<li>This morning I can login but now (afternoon) I can not login even I don't   change any code</li>
</ul>

<p>I have update my Twitter via Fabric to latest version now (2.3) and I'm sure I have internet connection</p>

<p>I know my problem is very strangely but hope someone have a same problem like me can give me some suggestion for fix it</p>