title: Embed Unity inside iOS in own ViewController
body: <p>Using Unity 2019.3.0f3 and its <code>Unity as a library</code> feature I'm trying to embed a Unity project inside my iOS application.</p>
  
  <p>Unity officially only supports full screen rendering. Nevertheless I'm looking for a way around that restriction.<br>
  In previous versions of Unity i successfully used <a href="https://github.com/jiulongw/swift-unity" rel="noreferrer">swift-unity</a> to do the integration. Within this approach it is easy to just get the View where Unity is rendering to (using <code>UnityGetGLView()</code>). I had no problems regarding stability or resources.</p>
  
  <p>Using the new library approach, every time I try to access the <code>UnityView</code>, unity forces it's complete <code>Window</code> as <code>keyWindow</code>. </p>
  
  <p>I tried accessing the UnityView in my own ViewController using </p>
  
  <pre><code>if let unityView = UnityFramework.getInstance()?.appController()?.rootViewController.view {
      // insert subview at index 0 ensures unity view is behind current UI view
      view?.insertSubview(unityView, at: 0)
  }
  </code></pre>
  
  <p>But that immediately activates the complete unity-window and hides my parenting <code>UITabBarController</code>.</p>
  
  <p>Trying to make the <code>UnityFramework.getInstance()?.appController()?.rootViewController</code> a child of my <code>UITabBarController</code> failed with the same result.</p>
  
  <p>Furthermore it is not possible to add a child <code>ViewController</code>. Only adding subviews seems possible.</p>
  
  <p>Does anybody know where that window-behaviour is located or how i can access the <code>UnityView</code> (or the RootViewController) and use it freely?</p>