Views 315 Votes 0 Comment 0
Atachment
Attachment '2'
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

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)

SOMotionDetector.png

USAGE

Copy SOMotionDetector folder to your project.

Link CoreMotion.frameworkCoreLocation.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/
?

List of Articles
No. Category Subject Author Date Views
164 iOS 코드를 보기좋게 재정렬 해주는 Xcode 플러그인 - XAlign file hooni 2014.03.19 222
163 iOS 맥의 Dock을 iOS에서 구현하기 - MCSFishEye file hooni 2014.03.19 263
162 iOS 애니메이션기능이 추가된 막대, 라인 차트 - PNChart file hooni 2014.03.19 237
161 iOS 오픈소스 폰트 프레임워크 - ionicons file hooni 2014.03.19 228
160 iOS 커스텀 상태바 알림 - JDStatusBarNotification file hooni 2014.03.19 204
159 iOS iOS 7 API를 활용한 샘플 소스 코드 - iOS7-Sampler file hooni 2014.03.19 209
158 iOS 스와이프 제스처 기반 커스텀 테이블뷰셀 II- slideActionCell file hooni 2014.03.19 232
157 iOS Placeholder값을 텍스트필드의 타이틀로 바꿔주는 커스텀 컨트롤 - JVFloatLabeledTextField file hooni 2014.03.19 238
156 iOS 스와이프 제스처 기반 커스텀 테이블뷰셀 - SWTableViewCell file hooni 2014.03.19 260
155 iOS iOS 7 스타일 배경흐림 뷰 컨트롤러 - REFrostedViewController file hooni 2014.03.19 265
154 iOS Pulse UI 만들기 - PPImageScrollingTableViewCell file hooni 2014.03.19 239
153 iOS 사진첩 컨트롤 - PhotoStack file hooni 2014.03.19 230
152 iOS 상하좌우 미러 카메라, flipped-cam file hooni 2014.03.19 304
151 iOS 업데이트 내용을 출력하자, 릴리즈노트뷰 - TWSReleaseNotesView file hooni 2014.03.19 233
150 iOS 풀스크린모달뷰 - MZFormSheetController file hooni 2014.03.19 271
149 iOS 커스텀 뷰 컨트롤러 트랜지션 - TB_CustomTransition file hooni 2014.03.19 242
Board Pagination Prev 1 3 4 5 6 7 ... 15 Next
/ 15