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/
?

  1. 코드를 보기좋게 재정렬 해주는 Xcode 플러그인 - XAlign

    Date2014.03.19 CategoryiOS Byhooni Views222
    Read More
  2. 맥의 Dock을 iOS에서 구현하기 - MCSFishEye

    Date2014.03.19 CategoryiOS Byhooni Views263
    Read More
  3. 애니메이션기능이 추가된 막대, 라인 차트 - PNChart

    Date2014.03.19 CategoryiOS Byhooni Views237
    Read More
  4. 오픈소스 폰트 프레임워크 - ionicons

    Date2014.03.19 CategoryiOS Byhooni Views228
    Read More
  5. 커스텀 상태바 알림 - JDStatusBarNotification

    Date2014.03.19 CategoryiOS Byhooni Views204
    Read More
  6. iOS 7 API를 활용한 샘플 소스 코드 - iOS7-Sampler

    Date2014.03.19 CategoryiOS Byhooni Views209
    Read More
  7. 스와이프 제스처 기반 커스텀 테이블뷰셀 II- slideActionCell

    Date2014.03.19 CategoryiOS Byhooni Views232
    Read More
  8. Placeholder값을 텍스트필드의 타이틀로 바꿔주는 커스텀 컨트롤 - JVFloatLabeledTextField

    Date2014.03.19 CategoryiOS Byhooni Views238
    Read More
  9. 스와이프 제스처 기반 커스텀 테이블뷰셀 - SWTableViewCell

    Date2014.03.19 CategoryiOS Byhooni Views260
    Read More
  10. iOS 7 스타일 배경흐림 뷰 컨트롤러 - REFrostedViewController

    Date2014.03.19 CategoryiOS Byhooni Views265
    Read More
  11. Pulse UI 만들기 - PPImageScrollingTableViewCell

    Date2014.03.19 CategoryiOS Byhooni Views239
    Read More
  12. 사진첩 컨트롤 - PhotoStack

    Date2014.03.19 CategoryiOS Byhooni Views230
    Read More
  13. 상하좌우 미러 카메라, flipped-cam

    Date2014.03.19 CategoryiOS Byhooni Views304
    Read More
  14. 업데이트 내용을 출력하자, 릴리즈노트뷰 - TWSReleaseNotesView

    Date2014.03.19 CategoryiOS Byhooni Views233
    Read More
  15. 풀스크린모달뷰 - MZFormSheetController

    Date2014.03.19 CategoryiOS Byhooni Views271
    Read More
  16. 커스텀 뷰 컨트롤러 트랜지션 - TB_CustomTransition

    Date2014.03.19 CategoryiOS Byhooni Views242
    Read More
Board Pagination Prev 1 3 4 5 6 7 ... 15 Next
/ 15