|
14 | 14 | <a title="ZorbDevice Class Reference"></a> |
15 | 15 | <header> |
16 | 16 | <div class="content-wrapper"> |
17 | | - <p><a href="../index.html">SwiftyZorb Docs</a> (100% documented)</p> |
| 17 | + <p><a href="../index.html">SwiftyZorb Docs</a> (64% documented)</p> |
18 | 18 | <p class="header-right"><a href="https://github.com/SomaticLabs/SwiftyZorb"><img src="../img/gh.png"/>View on GitHub</a></p> |
19 | 19 | </div> |
20 | 20 | </header> |
|
36 | 36 | </li> |
37 | 37 | </ul> |
38 | 38 | </li> |
| 39 | + <li class="nav-group-name"> |
| 40 | + <a href="../Enums.html">Enumerations</a> |
| 41 | + <ul class="nav-group-tasks"> |
| 42 | + <li class="nav-group-task"> |
| 43 | + <a href="../Enums/Trigger.html">Trigger</a> |
| 44 | + </li> |
| 45 | + </ul> |
| 46 | + </li> |
39 | 47 | <li class="nav-group-name"> |
40 | 48 | <a href="../Functions.html">Functions</a> |
41 | 49 | <ul class="nav-group-tasks"> |
|
60 | 68 | <li class="nav-group-task"> |
61 | 69 | <a href="../Functions.html#/s:10SwiftyZorb24retrieveAvailableDevicesyy0A9Bluetooth6ResultOySayAA0B6DeviceCGGc10completion_tF">retrieveAvailableDevices(completion:)</a> |
62 | 70 | </li> |
| 71 | + <li class="nav-group-task"> |
| 72 | + <a href="../Functions.html#/s:10SwiftyZorb14triggerPatternyAA7TriggerO_y0A9Bluetooth6ResultOyytGc10completiontF">triggerPattern(_:completion:)</a> |
| 73 | + </li> |
63 | 74 | <li class="nav-group-task"> |
64 | 75 | <a href="../Functions.html#/s:10SwiftyZorb14writeActuatorsys6UInt16V8duration_s5UInt8V7topLeftAG0H5RightAG06bottomI0AG0kJ0y0A9Bluetooth6ResultOyytGc10completiontF">writeActuators(duration:topLeft:topRight:bottomLeft:bottomRight:completion:)</a> |
65 | 76 | </li> |
@@ -611,12 +622,69 @@ <h4>Parameters</h4> |
611 | 622 | </section> |
612 | 623 | </div> |
613 | 624 | </li> |
| 625 | + <li class="item"> |
| 626 | + <div> |
| 627 | + <code> |
| 628 | + <a name="/s:10SwiftyZorb0B6DeviceC14triggerPatternyAA7TriggerO_y0A9Bluetooth6ResultOyytGc10completiontF"></a> |
| 629 | + <a name="//apple_ref/swift/Method/triggerPattern(_:completion:)" class="dashAnchor"></a> |
| 630 | + <a class="token" href="#/s:10SwiftyZorb0B6DeviceC14triggerPatternyAA7TriggerO_y0A9Bluetooth6ResultOyytGc10completiontF">triggerPattern(_:completion:)</a> |
| 631 | + </code> |
| 632 | + </div> |
| 633 | + <div class="height-container"> |
| 634 | + <div class="pointer-container"></div> |
| 635 | + <section class="section"> |
| 636 | + <div class="pointer"></div> |
| 637 | + <div class="abstract"> |
| 638 | + <p>Triggers a given pre-loaded pattern on the given device</p> |
| 639 | + |
| 640 | +<p>Usage Example:</p> |
| 641 | +<pre class="highlight swift"><code> <span class="n">device</span><span class="o">.</span><span class="nf">triggerPattern</span><span class="p">(</span><span class="o">.</span><span class="n">🎊</span><span class="p">)</span> <span class="p">{</span> <span class="n">result</span> <span class="k">in</span> |
| 642 | + <span class="k">switch</span> <span class="nf">result</span> <span class="p">{</span> |
| 643 | + <span class="k">case</span> <span class="o">.</span><span class="nv">success</span><span class="p">:</span> |
| 644 | + <span class="c1">// Pattern triggered successfully</span> |
| 645 | + <span class="k">case</span> <span class="o">.</span><span class="nf">failure</span><span class="p">(</span><span class="k">let</span> <span class="nv">error</span><span class="p">):</span> |
| 646 | + <span class="c1">// An error occurred in triggering pattern</span> |
| 647 | + <span class="p">}</span> |
| 648 | + <span class="p">}</span> |
| 649 | +</code></pre> |
| 650 | + |
| 651 | + </div> |
| 652 | + <div class="declaration"> |
| 653 | + <h4>Declaration</h4> |
| 654 | + <div class="language"> |
| 655 | + <p class="aside-title">Swift</p> |
| 656 | + <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">triggerPattern</span><span class="p">(</span><span class="n">_</span> <span class="nv">pattern</span><span class="p">:</span> <span class="kt"><a href="../Enums/Trigger.html">Trigger</a></span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt">WriteRequestCallback</span><span class="p">)</span></code></pre> |
| 657 | + |
| 658 | + </div> |
| 659 | + </div> |
| 660 | + <div> |
| 661 | + <h4>Parameters</h4> |
| 662 | + <table class="graybox"> |
| 663 | + <tbody> |
| 664 | + <tr> |
| 665 | + <td> |
| 666 | + <code> |
| 667 | + <em>pattern</em> |
| 668 | + </code> |
| 669 | + </td> |
| 670 | + <td> |
| 671 | + <div> |
| 672 | + <p>The <code><a href="../Enums/Trigger.html">Trigger</a></code> enumeration option of the given preloaded pattern to trigger</p> |
| 673 | + </div> |
| 674 | + </td> |
| 675 | + </tr> |
| 676 | + </tbody> |
| 677 | + </table> |
| 678 | + </div> |
| 679 | + </section> |
| 680 | + </div> |
| 681 | + </li> |
614 | 682 | </ul> |
615 | 683 | </div> |
616 | 684 | </section> |
617 | 685 | </section> |
618 | 686 | <section id="footer"> |
619 | | - <p>© 2018 <a class="link" href="https://somaticlabs.io" target="_blank" rel="external">Somatic Labs</a>. All rights reserved. (Last updated: 2018-01-22)</p> |
| 687 | + <p>© 2018 <a class="link" href="https://somaticlabs.io" target="_blank" rel="external">Somatic Labs</a>. All rights reserved. (Last updated: 2018-04-12)</p> |
620 | 688 | <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p> |
621 | 689 | </section> |
622 | 690 | </article> |
|
0 commit comments