Latest0.2.5
Homepagehttps://github.com/kerryknight/ReactiveHealthKit
LicenseMIT
Platformsios 8.0, requires ARC
DependenciesReactiveCocoa
Authors

ReactiveHealthKit adds simple ReactiveCocoa extensions to Apple’s HealthKit framework to lift HealthKit’s block-based APIs into the functional reactive programming world. Check out the included ReactiveFit project for usage examples. Pull requests welcome.

Developer Notes

You should probably read all of Apple’s HealthKit reference prior to using ReactiveHealthKit. ReactiveHealthKit strives to mimic the native behavior of HealthKit so it’s imperative you understand the caveats that go along with a user allowing or denying access to certain HealthKit data points. For instance, HealthKit will not return an error if a user has denied access to a certain data point you’re querying for (e.g. weight) and thus, it’ll be up to you to ensure you check that the response’s data point exists prior to use.

Installation

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

pod "ReactiveHealthKit"

Testing

ReactiveHealthKit is fully unit tested. To run tests, clone the project or download the project zip file and extract. From the root project folder:

cd ReactiveHealthKitTests
pod install

Once all CocoaPods have been successfully installed, you can open the ReactiveHealthKit.xcworkspace file and Cmd + U to run the tests or, if you have xctool installed, run:

xctool test -workspace ReactiveHealthKit.xcworkspace -scheme ReactiveHealthKit -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO

Example Project

The included example project is a direct port of Apple’s Fit sample project. I’ve tried to modify the app and its workflow as little as possible from Apple’s original design, beyond that which enables using ReactiveHealthKit in a 1-to-1 swap of Apple’s block-based code. However, this does not mean there aren’t underlying issues with Apple’s code or issues I’ve inadvertently introduced myself. Pull requests are welcome if you come across something in need of fixing.

To run the example project, clone the repo, and run pod install from the Example directory first. As noted in the Apple sample code, HealthKit-enabled projects will only run on an actual device so you must be sure to change you active build scheme to using your connected HealthKit-enabled device.

Note: If you get a warning about security when you try to run the example app on your device, see this StackOverflow answer: http://stackoverflow.com/a/25837245/1700790

Requirements

iOS 8.0+ running on a HealthKit-compatible iPhone; HealthKit is not compatible with iPads or Macs

Author

Kerry Knight, [email protected]

License

ReactiveHealthKit is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ReactiveHealthKit",
    "version": "0.2.5",
    "summary": "ReactiveCocoa extensions for HealthKit",
    "homepage": "https://github.com/kerryknight/ReactiveHealthKit",
    "license": "MIT",
    "authors": {
        "Kerry Knight": "[email protected]"
    },
    "source": {
        "git": "https://github.com/kerryknight/ReactiveHealthKit.git",
        "tag": "0.2.5"
    },
    "social_media_url": "https://twitter.com/KerryAKnight",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "ReactiveHealthKit",
    "dependencies": {
        "ReactiveCocoa": [
            "~> 2.1"
        ]
    }
}

Pin It on Pinterest

Share This