Giter Club home page Giter Club logo

iperspective's Introduction

iPerspective

iPerspective is a iOS librarie of control with augmented reality.

  • UIImageViewPerspective: UIImageView with perspective when user move device.
  • UIImageView+Perspective: Category for UIImageView and permit to create UIImageView with perspective when user move device.
  • UIViewPerspective: UIView with perspective when user move device. (Under construction)
  • UIView+Perspective: Category for UIView and permit to create UIView with perspective when user move device. (Under construction)

Documentation: iPerspectiveDocs

iPerspective

CI Status Version License Platform

iPerspective

Requirements

N/A

Installation

iPerspective is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'iPerspective'

And execute this command in your project folder:

pod install

Usage of 'UIImageViewPerspective'.

See the sample project iPerspective in 'Exemple' directory.

Prepare 'CMMotionManager'

All control in iPerspective use 'CoreMotion'. It's prefered to create a single instance of CMMotionManager for all control in your app.

#import <CoreMotion/CoreMotion.h>
...
@interface EPViewController2 ()
{
    CMMotionManager *motionmanager;
}
...
- (CMMotionManager *)sharedManager
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        motionmanager = [[CMMotionManager alloc] init];
    });
    return motionmanager;
}

Use UIImageViewPerspective in your application.

UIImageViewPerspective is a subclass of UIImageView. You can use that to replace your UIImageView.

Import :

#import <iPerspective/UIImageViewPerspective.h>

Setup UIImageViewPerspective:

// initialize _imagePerspective
[_imagePerspective setMotionManger:[self sharedManager]]; // (Mandatory) set motion manager

[_imagePerspective setMaximumAmplitude:20.0];   // (Optional) maximum move of UIImageView
[_imagePerspective setMaximumAngle:2.0];        // (OPtional) maximum angle managed
[_imagePerspective setUpdateInterval:0.01];     // (Optional) interval of refresh

Start image motion with core motion:

// start image motion with core motion
[_imagePerspective startUpdate];

Stop image motion:

// stop image motion
[_imagePerspective stopUpdate];

Usage of 'UIImageView+Perspective'.

See the sample project iPerspective in 'Exemple' directory.

Use UIImageView+Perspective in your application.

UIImageView+Perspective is a category. You can use that to replace your UIImageView.

Import :

#import <iPerspective/UIImageView+Perspective.h>

Start image motion with core motion:

// start image motion with core motion
[_imagePerspective startUpdate:0.01 manager:[self sharedManager]];

Stop image motion:

// stop image motion
[_imagePerspective stopUpdate:[self sharedManager]];

Author

Eric Pinet, [email protected]

License

iPerspective is available under the MIT license. See the LICENSE file for more info.

iperspective's People

Contributors

ericpinet avatar eddpt avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.