Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "ReactiveX/RxSwift" "3.3.1"
github "ReactiveX/RxSwift" "5.0.1"
18 changes: 18 additions & 0 deletions Pod/Classes/RxCoreMotion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ extension Reactive where Base: CMMotionManager {
}

extension Reactive where Base: CMPedometer {

public func pedometer(from: Date! = Date()) -> Observable<CMPedometerData> {
return memoize(key: &pedometerKey) {
Observable.create { observer in
Expand All @@ -174,6 +175,23 @@ extension Reactive where Base: CMPedometer {
}
}

public func query(from fromDate:Date, to toDate:Date)->Single<CMPedometerData>{
return Single.create { observer in
let pedometer = self.base
pedometer.queryPedometerData(from: fromDate, to: toDate, withHandler: { (data, error) in
if let _ = error
{
observer(.error(error!))
return
}
guard let data = data else {
return
}
observer(.success(data))
})
return Disposables.create {}
}
}

public var pedometer: Observable<CMPedometerData> {
return memoize(key: &pedometerKey) {
Expand Down
24 changes: 24 additions & 0 deletions RxCoreMotion copy-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
22 changes: 22 additions & 0 deletions RxCoreMotion-watch/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>
19 changes: 19 additions & 0 deletions RxCoreMotion-watch/RxCoreMotion_watch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// RxCoreMotion_watch.h
// RxCoreMotion-watch
//
// Created by Install Poeta on 8/22/19.
// Copyright © 2019 RxSwiftCommunity - https://github.com/RxSwiftCommunity. All rights reserved.
//

#import <WatchKit/WatchKit.h>

//! Project version number for RxCoreMotion_watch.
FOUNDATION_EXPORT double RxCoreMotion_watchVersionNumber;

//! Project version string for RxCoreMotion_watch.
FOUNDATION_EXPORT const unsigned char RxCoreMotion_watchVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <RxCoreMotion_watch/PublicHeader.h>


Loading