iOS
2014.03.19 13:50
모션디텍터 라이브러리 - SOMotionDetector
조회 수 315 추천 수 0 댓글 0
첨부 '2' |
---|
SOMotionDetector
Simple library to detect motion for iOS by arturdev .
Based on location updates and acceleration.
Requierments
iOS > 6.0
Compatible with iOS 7
Works on all iOS devices (i.e. not need M7 chip)
USAGE
Copy SOMotionDetector folder to your project.
Link CoreMotion.framework, CoreLocation.framework.
Import "SOMotionDetector.h" file and implement
protocol.
#import "SOMotionDetector.h
@interface ViewController ()<SOMotionDetectorDelegate>
@end
Set SOMotionDetector's delegate to self
[SOMotionDetector sharedInstance].delegate = self;
Implement delegate methods
- (void)motionDetector:(SOMotionDetector *)motionDetector motionTypeChanged:(SOMotionType)motionType
{
}
- (void)motionDetector:(SOMotionDetector *)motionDetector locationChanged:(CLLocation *)location
{
}
- (void)motionDetector:(SOMotionDetector *)motionDetector accelerationChanged:(CMAcceleration)acceleration
{
}
You are done!
Now to start detection motion just call
[[SOMotionDetector sharedInstance] startDetection];
To stop detection call
[[SOMotionDetector sharedInstance] stopDetection];
Detecting motion types
typedef enum
{
MotionTypeNotMoving = 1,
MotionTypeWalking,
MotionTypeRunning,
MotionTypeAutomotive
} SOMotionType;
CUSTOMIZATION
/**
* Set this parameter to YES if you want to use M7 chip to detect more exact motion type. By default is No.
* Set this parameter before calling startDetection method.
* Available only on devices that have M7 chip. At this time only the iPhone 5S, the iPad Air and iPad mini with retina display have the M7 coprocessor.
*/
@property (nonatomic) BOOL useM7IfAvailable;
/**
*@param speed The minimum speed value less than which will be considered as not moving state
*/
- (void)setMinimumSpeed:(CGFloat)speed;
/**
*@param speed The maximum speed value more than which will be considered as running state
*/
- (void)setMaximumWalkingSpeed:(CGFloat)speed;
/**
*@param speed The maximum speed value more than which will be considered as automotive state
*/
- (void)setMaximumRunningSpeed:(CGFloat)speed;
/**
*@param acceleration The minimum acceleration value less than which will be considered as non shaking state
*/
- (void)setMinimumRunningAcceleration:(CGFloat)acceleration;
Installation with CocoaPods
CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries installation in your projects.
Podfile
pod "SOMotionDetector", "~> 1.0.1"
LICENSE
SOMotionDetector is under MIT License (see LICENSE file)
M7칩을 사용하지않는 iOS기기에서도 사용가능한 모션디텍터 라이브러리 오픈소스 SOMotionDetector 입니다.
다운로드는 첨부파일 또는 아래링크를 확인하세요>
https://github.com/SocialObjects-Software/SOMotionDetector/
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
167 | iOS | UIWebView에서 한글 txt 파일 정상적으로 표시 | hooni | 2014.03.18 | 277 |
166 | iOS | Xcode 플러그인 ColorSense | hooni | 2014.03.18 | 277 |
165 | iOS | Xcode플러그인관리 플러그인 - JDListInstalledPlugins | hooni | 2014.03.18 | 202 |
164 | iOS | XML 파싱을 쉽게 해주는 TBXML | hooni | 2014.03.18 | 211 |
163 | iOS | [ios] iOS Custom Pull-to-Refresh Control Tutorial (Updated for Swift) | hooni | 2015.10.29 | 1295 |
162 | iOS | [ios] UIView+Frame | hooni | 2015.10.06 | 569 |
161 | iOS | [ios] 애니메이션 초간단 예제 | hooni | 2015.01.16 | 339 |
160 | iOS | 간단 프로모션 뷰 생성 오픈소스, TAPromotee | hooni | 2015.07.20 | 624 |
159 | iOS | 간단하게 More Apps 뷰 만들기 - DAAppsViewController | hooni | 2014.03.18 | 296 |
158 | iOS | 간단한 테이블뷰 검색예제 | hooni | 2014.03.18 | 239 |
157 | iOS | 간단히 앱내 셋팅화면 구현이 가능한 FxForms 오픈소스 | hooni | 2014.03.19 | 201 |
156 | iOS | 공유버튼 UI 컨트롤 - CFShareCircle | hooni | 2014.03.18 | 221 |