Skip to content

Commit

Permalink
Added functionality of usage M7 chip if available
Browse files Browse the repository at this point in the history
  • Loading branch information
arturdev committed Mar 20, 2014
1 parent 4e0069e commit 1687b5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions MotionDetection/MotionDetection-Prefix.pch
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)


#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
Expand Down
5 changes: 4 additions & 1 deletion MotionDetection/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ - (void)viewDidLoad
// Do any additional setup after loading the view, typically from a nib.

[SOMotionDetector sharedInstance].delegate = self;
[SOMotionDetector sharedInstance].useM7IfAvailable = YES; //Use M7 chip if available, otherwise use lib's algorithm
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0"))
{
[SOMotionDetector sharedInstance].useM7IfAvailable = YES; //Use M7 chip if available, otherwise use lib's algorithm
}
[[SOMotionDetector sharedInstance] startDetection];

}
Expand Down

0 comments on commit 1687b5a

Please sign in to comment.