title: iOS Share Extension flow
body: <p>I have problems with creating share extension like share extension of the Pinterest app. When user is not logged to the containing app the share extension only presents alert with an option to <code>log in</code> and <code>cancel</code>.</p>
  
  <p>Where in code decide which view controller to show in my shared extension. I see this like I need to check authorization status from shared container and if this status is <code>not logged</code> I need to present alert controller. If status is <code>logged</code> I need to show my main view controller <code>ShareViewController</code> which is a subclass of <code>SLComposeServiceViewController</code></p>
  
  <p>My question is not UI related but where to put this check code. I didn't find any method where app extension starts so I can select some initial view controller for extension based on some state.</p>
  
  <p>In Pinterest extension I don't see their main view controller when user is logged out from their containing app. I see only alert with options.</p>
  
  <p>Second question: How to programatically switch from share extension to containing app. How this Pinterest share extension is doing this when user need to authenticate?</p>
  
  <p>I'm working on latest iOS SDK 10.2</p>