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
68 iOS [ios] 애니메이션 초간단 예제 file hooni 2015.01.16 330
67 iOS [ios] UIView+Frame file hooni 2015.10.06 559
66 iOS [ios] iOS Custom Pull-to-Refresh Control Tutorial (Updated for Swift) file hooni 2015.10.29 1278
65 Python zip 파일 암호 깨는 브루트포싱 file hooni 2014.07.14 619
64 iOS XML 파싱을 쉽게 해주는 TBXML file hooni 2014.03.18 211
63 iOS Xcode플러그인관리 플러그인 - JDListInstalledPlugins file hooni 2014.03.18 202
62 iOS Xcode 플러그인 ColorSense file hooni 2014.03.18 277
61 iOS UIWebView에서 한글 txt 파일 정상적으로 표시 file hooni 2014.03.18 276
60 iOS UITableView 를 커스터마이징한 예제입니다. file hooni 2014.03.18 232
59 iOS UITableView + UIAlertView = SBTableAlert file hooni 2014.03.18 219
58 iOS UIScrollView + 페이지접힘효과 = PaperFoldGallery file hooni 2014.03.18 283
57 iOS UICollectionView의 다양한 커스텀 레이아웃지원 예제 - IntroducingCollectionViews file hooni 2014.03.19 289
56 iOS UICollectionView 기반 채팅 UI 구현 오픈소스, SPHChatCollectionView file hooni 2015.07.20 486
55 iOS UIBezierPath만을 이용해 공유버튼 만들기 - GRButtons file hooni 2014.03.18 252
54 iOS TODO 관리를 쉽게해주는 Xcode 플러그인 - XToDo file hooni 2014.03.19 246
53 iOS TinyWings 같은 게임만들기 -TinySeal file hooni 2014.03.18 290
Board Pagination Prev 1 ... 9 10 11 12 13 15 Next
/ 15