title: Xamarin.iOS async ViewDidLoad
body: <p>I am using the Microsoft Authentication Library and Azure AD B2C to provide a login for my mobile app. With that I can provide a button with an async event handler that will start the login process:</p>
  
  <pre><code>// iOS example
  public override void ViewDidLoad()
  {
      base.ViewDidLoad();
  
      LoginButton.TouchUpInside += async (sender, e) =&gt;
      {
          try
          {
              await app.AcquireTokenAsync(...);
          }
          catch(Exception e)
          {
          }
      }
  }
  </code></pre>
  
  <p>When first opening the app, I need to be able to silently log them in using <code>AcquireTokenSilentAsync</code>. I have seen lots of documentation saying that you should never use async on a void returning method unless it is an event handler, but in this case I need to do it on <code>ViewDidLoad()</code>. If I swallow any exceptions is this acceptable?</p>
  
  <pre><code>// is async void okay in this scenario? if not, where else can I put it?
  public async override void ViewDidLoad()
  {
      base.ViewDidLoad();
  
  
      try
      {
          await app.AcquireTokenSilentAsync(...);
      }
      catch(Exception e)
      {
          // swallow
      }    
  }
  </code></pre>