Introduction
SwiftySensors is a robust and effective framework for Swift-based projects. It is designed to make iOS and OS X Bluetooth LE connections simple and straightforward, taking abstractions and representations of Bluetooth LE hardware to the next level.
Installation
The SwiftySensors library can be integrated into your project in a few ways such as using CocoaPods and Carthage.
Using CocoaPods:
- To use CocoaPods, you need to have it installed on your machine. If not installed, use the command:
gem install cocoapods
- Enter the command:
pod init
in your project directory. - Add the line
'pod SwiftySensors'
under # Pods for your_project_name inside your Podfile. - Run the command:
pod install
Using Carthage:
- To use Carthage, you need to have it installed on your device. Use the command:
brew install carthage
- Add
github "SwiftySensors/SwiftySensors"
to your Cartfile. - Run the command:
carthage update
Getting Started
SwiftySensors service and characteristics deal with all vital elements, this framework also provides asynchronous read and write characteristics handling.
How to use
let sensor = SensorManager.sharedInstance sensor.startScan(withServices: [HeartRateService.self]) for sensor in sensor.sensors { let heartRateService: HeartRateService? = sensor.findService() let measurement: HeartRateMeasurementCharacteristic? = heartRateService?.findCharacteristic() }
License
SwiftySensors is licensed under the MIT License allowing for reuse of the code within proprietary software provided all copies of the licensed software include a copy of the MIT License terms and the disclaimer. The Software is provided “as is”, without warranty of any kind.
Contributions
Contributions are welcomed and highly appreciated. For contributions, please submit a pull request on our GitHub repository.