-
Notifications
You must be signed in to change notification settings - Fork 1
/
CoreMotion+Convenience.h
51 lines (33 loc) · 1.24 KB
/
CoreMotion+Convenience.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// CoreMotion+Convenience.h
// Sleep Diary
//
// Created by Alexander Ivanov on 14.10.16.
// Copyright © 2016 Alexander Ivanov. All rights reserved.
//
#import <CoreMotion/CoreMotion.h>
#import "NSObject+Convenience.h"
@interface CMAltimeter (Convenience)
+ (CMAltimeter *)defaultAltimeter;
- (void)startRelativeAltitudeUpdatesWithHandler:(CMAltitudeHandler)handler;
- (void)getAltitude:(CMAltitudeHandler)handler;
@end
typedef enum : NSUInteger {
CMMotionActivityTypeNone = 0,
CMMotionActivityTypeUnknown,
CMMotionActivityTypeStationary,
CMMotionActivityTypeWalking,
CMMotionActivityTypeRunning,
CMMotionActivityTypeAutomotive,
CMMotionActivityTypeCycling,
} CMMotionActivityType;
@interface CMMotionActivity (Convenience)
@property (assign, nonatomic, readonly) CMMotionActivityType activityType;
@property (assign, nonatomic, readonly) NSString *activityTypeDescription;
@end
@interface CMMotionActivityManager (Convenience)
+ (instancetype)defaultManager;
- (void)startActivityUpdatesWithHandler:(CMMotionActivityHandler)handler;
- (void)getActivity:(CMMotionActivityHandler)handler;
- (void)queryActivityStartingFromDate:(NSDate *)start toDate:(NSDate *)end withHandler:(void(^)(NSArray<CMMotionActivity *> *activities))handler;
@end