Updated docs for next

This commit is contained in:
Website Deployment Script
2016-10-20 02:41:10 +00:00
parent bc67b18b28
commit faf84dec4f
+1 -1
View File
@@ -84,7 +84,7 @@ CalendarManager<span class="token punctuation">.</span><span class="token functi
<span class="token comment" spellcheck="true"> // You can invoke callback from any thread/queue
</span> <span class="token function">callback<span class="token punctuation">(</span></span>@<span class="token punctuation">[</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span></div><blockquote><p><strong>NOTE</strong>: Sharing dispatch queues between modules</p><p>The <code>methodQueue</code> method will be called once when the module is initialized, and then retained by the bridge, so there is no need to retain the queue yourself, unless you wish to make use of it within your module. However, if you wish to share the same queue between multiple modules then you will need to ensure that you retain and return the same queue instance for each of them; merely returning a queue of the same name for each won&#x27;t work.</p></blockquote><h2><a class="anchor" name="depedency-injection"></a>Depedency Injection <a class="hash-link" href="docs/native-modules-ios.html#depedency-injection">#</a></h2><p>The bridge initializes any registered RCTBridgeModules automatically, however you may wish to instantiate your own module instances (so you may inject dependencies, for example).</p><p>You can do this by creating a class that implements the RTCBridgeDelegate Protocol, initializing an RTCBridge with the delegate as an argument and initialising a RTCRootView with the initialized bridge.</p><div class="prism language-javascript">id&lt;RCTBridgeDelegate<span class="token operator">&gt;</span> moduleInitialiser <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">[</span>classThatImplementsRTCBridgeDelegate alloc<span class="token punctuation">]</span> init<span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span></div><blockquote><p><strong>NOTE</strong>: Sharing dispatch queues between modules</p><p>The <code>methodQueue</code> method will be called once when the module is initialized, and then retained by the bridge, so there is no need to retain the queue yourself, unless you wish to make use of it within your module. However, if you wish to share the same queue between multiple modules then you will need to ensure that you retain and return the same queue instance for each of them; merely returning a queue of the same name for each won&#x27;t work.</p></blockquote><h2><a class="anchor" name="dependency-injection"></a>Dependency Injection <a class="hash-link" href="docs/native-modules-ios.html#dependency-injection">#</a></h2><p>The bridge initializes any registered RCTBridgeModules automatically, however you may wish to instantiate your own module instances (so you may inject dependencies, for example).</p><p>You can do this by creating a class that implements the RTCBridgeDelegate Protocol, initializing an RTCBridge with the delegate as an argument and initialising a RTCRootView with the initialized bridge.</p><div class="prism language-javascript">id&lt;RCTBridgeDelegate<span class="token operator">&gt;</span> moduleInitialiser <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">[</span>classThatImplementsRTCBridgeDelegate alloc<span class="token punctuation">]</span> init<span class="token punctuation">]</span><span class="token punctuation">;</span>
RCTBridge <span class="token operator">*</span>bridge <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">[</span>RCTBridge alloc<span class="token punctuation">]</span> initWithDelegate<span class="token punctuation">:</span>moduleInitialiser launchOptions<span class="token punctuation">:</span>nil<span class="token punctuation">]</span><span class="token punctuation">;</span>