https://github.com/mbientlab/streamy
MetaWear Combine Swift SDK - Demo App Source Code
https://github.com/mbientlab/streamy
combine corebluetooth metawear-sdk swift swiftui-example
Last synced: 2 months ago
JSON representation
MetaWear Combine Swift SDK - Demo App Source Code
- Host: GitHub
- URL: https://github.com/mbientlab/streamy
- Owner: mbientlab
- Created: 2022-01-18T07:15:19.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-28T00:46:18.000Z (almost 4 years ago)
- Last Synced: 2025-02-15T10:32:35.123Z (11 months ago)
- Topics: combine, corebluetooth, metawear-sdk, swift, swiftui-example
- Language: Swift
- Homepage:
- Size: 14.1 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# MetaWear Swift Combine SDK Demo Project
For an interactive code walkthrough of this barebones project, view the SDK's documentation in Xcode. Remember that the iOS simulator cannot use Bluetooth, so run this on macOS or actual iOS devices.
### Quick Guide
#### UseCases
- The basics of using the Combine SDK to discover, connect, and manage devices are in `StreamyLogic/Sources/Discovery`.
- The basics of logging specific sensors and downloading data are in `StreamyLogic/Sources/SensorRecording.
- Any SDK commands more than one line are in `StreamyLogic/Sources/SDKActions.swift`.
#### UI
This demo app uses SwiftUI for iOS 15 and macOS 12.
Views and logic are decoupled to make is easy for you to expand or reuse this app while toying with the SDK.
- **Views observe generic ObservableObjects using `KeyPaths`.** A ViewModel object defines these KeyPaths and closures. A separate mapping object configures a ViewModel for a concrete UseCase from the `StreamyLogic` package.
- **Views point to opaque other views, not actual implementations.** "Router views" in `Shared/Views.swift` determine which specific implementations to configure and show for a given component (e.g., show the two or three pane implementation).
- **A factory object vends any dependencies** while the "router view" decides or prepares which view to show.