forked from polarofficial/polar-ble-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iOS Example: Made iOS example more user friendly. API usage is demons…
…trated in PolarBleSdkManager.swift file.
- Loading branch information
1 parent
e0389ba
commit 9d4b7c7
Showing
10 changed files
with
835 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
# Example project demonstrating usage of PolarBle SDK | ||
|
||
# Dependencies | ||
* [PolarBleSdk.xcframework](https://github.com/polarofficial/polar-ble-sdk/releases) | ||
* [RxSwift 6.0](https://github.com/ReactiveX/RxSwift) or above | ||
|
||
# Setup the example project | ||
|
||
* Example project dependencies are already setup. Only setup your development team to build and test the capabilities of PolarBle SDK | ||
* Example project demos multiple features found from PolarBleSDK library. To get most out of the example project you shall read the source code. The file `PolarBleSdkManager.swift` contains the interaction between the PolarBleSdk library and the example app. Other files in the example project are not relevant for the PolarBleSDK, those are for building the UI etc. While running the project you shall follow the console output to see results caused by the UI buttons. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/Messages.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/// Copyright © 2019 Polar Electro Oy. All rights reserved. | ||
/// Copyright © 2021 Polar Electro Oy. All rights reserved. | ||
|
||
import Foundation | ||
|
||
struct ErrorMessage: Identifiable { | ||
struct Message: Identifiable { | ||
let id = UUID() | ||
let text: String | ||
} |
18 changes: 18 additions & 0 deletions
18
examples/example-ios/iosBleSdkTestApp/iosBleSdkTestApp/Models/StreamSettings.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/// Copyright © 2021 Polar Electro Oy. All rights reserved. | ||
|
||
import Foundation | ||
import PolarBleSdk | ||
|
||
struct StreamSettings: Identifiable, Hashable { | ||
let id = UUID() | ||
let feature: DeviceStreamingFeature | ||
var settings: [StreamSetting] = [] | ||
var sortedSettings: [StreamSetting] { return settings.sorted{ $0.type.rawValue < $1.type.rawValue }} | ||
} | ||
|
||
struct StreamSetting: Identifiable, Hashable { | ||
let id = UUID() | ||
let type: PolarSensorSetting.SettingType | ||
var values: [Int] = [] | ||
var sortedValues: [Int] { return values.sorted(by:<)} | ||
} |
Oops, something went wrong.