SBrick-iOS 1.0.3

SBrick-iOS 1.0.3

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Mar 2018
SPMSupports SPM

Maintained by Barak Harel.



  • By
  • Barak Harel

SBrick-iOS

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Swift 3.0, Probably iOS 10+

Installation

SBrick-iOS is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "SBrick-iOS"

Usage

var manager = SBrickManager(delegate: self)
manager.startDiscovery()

func sbrickManager(_ sbrickManager: SBrickManager, didDiscover sbrick: SBrick) {
    //connect
    sbrick.delegate = self
    sbrickManager.connect(to: sbrick)
}

func sbrickReady(_ sbrick: SBrick) {
    //send a command
    sbrick.send(command: .drive(channelId: 0, cw: true, power: 0xFF))
}

Author

Barak Harel

License

SBrick-iOS is available under the MIT license. See the LICENSE file for more info.