Since SBrick are taking their sweet time releasing a Swift library/framework, I thought I'd just write one by myself.
It's an early version that supports just the basic commands - driving and stopping (with channel, power, direction), but I'll update it whenever I can.
You can download the framework and a working example from my GitHub: https://github.com/BarakRL/SBrick-iOS
Usage is pretty straight forward:
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))
}