title: Nativescript addSubview
body: <p>I'm trying to implement the OpenTok SDK into Nativescript and I've run into an issue that I can't seem to wrap my head around. </p>
  
  <p>Per their documentation (<a href="https://tokbox.com/developer/guides/publish-stream/ios/#create_publisher" rel="nofollow noreferrer">https://tokbox.com/developer/guides/publish-stream/ios/#create_publisher</a>) once you create a publisher object you call:</p>
  
  <pre><code>[self.view addSubview:publisher.view];
  </code></pre>
  
  <p>I can't figure out how I would tie this into Nativescript, if it's even possible. </p>
  
  <p>My first thought is that I would want a UIView or View element on my page in the XML, then I would call <code>.addView(publisher.view);</code> on that element. </p>
  
  <p>There is a similar question here (<a href="https://stackoverflow.com/questions/36007079/inject-pure-java-obj-c-code-in-nativescript-app">Inject pure Java / Obj-C code in NativeScript App</a>) but nothing came of it, the one answer does't provide much help.</p>
  
  <p>I cloned one of OpenTok's sample projects and added their implementation of this call into a gist here: <a href="https://gist.github.com/bondydaa/2db355ed45b7e50e4071" rel="nofollow noreferrer">https://gist.github.com/bondydaa/2db355ed45b7e50e4071</a></p>
  
  <p>You can see at <a href="https://gist.github.com/bondydaa/2db355ed45b7e50e4071#file-viewcontroller-m-L117" rel="nofollow noreferrer">line 117</a> how they implemented this call. This code raises another question for me in that I'm not sure where <code>_publisherView</code> comes from.</p>
  
  <p>Any help would be greatly appreciated!</p>