https://github.com/wilddylan/dlmotion
DLMotion, CoreMotion For your iphone oriention and degrees
https://github.com/wilddylan/dlmotion
Last synced: 11 months ago
JSON representation
DLMotion, CoreMotion For your iphone oriention and degrees
- Host: GitHub
- URL: https://github.com/wilddylan/dlmotion
- Owner: wilddylan
- License: mit
- Created: 2015-04-21T10:08:21.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-04-21T10:13:52.000Z (about 11 years ago)
- Last Synced: 2025-01-29T00:25:33.008Z (over 1 year ago)
- Language: Objective-C
- Size: 129 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DLMotion
DLMotion, CoreMotion For your iphone oriention and degrees
---
####DLMotion
Add CoreMotion.Framework
`#import `
Properties:
```objective-c
//! @abstract Motion shareInstance
+ (instancetype)DefulatMotion;
//! @abstract motionManager
@property (nonatomic, strong) CMMotionManager * motionManager;
//! @abstract OperationQueue
@property (nonatomic, strong) NSOperationQueue * operationQueue;
//! @abstract DeviceOrientation
@property (nonatomic, assign) UIDeviceOrientation newDeviceOrientation;
//! @abstract newInterFaceOriention
@property (nonatomic, assign) UIInterfaceOrientation newInterfaceOrientation;
//! @abstract updateSuccess
@property (nonatomic, assign) BOOL updateSuccess;
//! @abstract affineTransform
@property (nonatomic, assign) CGAffineTransform affineTransform;
//! @abstract Degrees
@property (nonatomic, assign) CGFloat degrees;
//! @abstract Device motion Manager
@property (nonatomic, strong) CMMotionManager * mMotionManager;
```
Methods:
```objective-c
- (void)UpdateDeviceMotion: (UpdateOriention)updateBlock;
/**
* Begin update Motion Data
*/
- (void)beginMotion;
/**
* End
*/
- (void)EndMotion;
```
For use:
```objective-c
[[DLMotion DefulatMotion] UpdateDeviceMotion:^(CGFloat DEGREE) {
[UIView animateWithDuration:.2 animations:^{
_flashButton.transform = CGAffineTransformIdentity;
_flashButton.transform = CGAffineTransformRotate(_flashButton.transform, DEGREE);
}];
}];
```
Or:
```objective-c
Add Notification and Call "[[DLMotion DefulatMotion] beginMotion];"
```