Latest 0.1.0
Homepage https://github.com/mohssenfathi/CameraLevel
License MIT
Platforms ios 7.0, requires ARC
Authors

[![CI Status](http://img.shields.io/travis/Mohssen Fathi/CameraLevel.svg?style=flat)](https://travis-ci.org/Mohssen Fathi/CameraLevel)
Version
License
Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

CameraLevel is a UIView subclass. It can be create with initWithFrame or in Interface Builder

To start and stop the camera receiving accelerometer data, use:

    [self.cameraLevel start];

    [self.cameraLevel stop];

, respectively.

By default the level sets it’s vertical center (for pitch) at the position where the phone is perpendicular to the ground. To set the default center to the devices current position, call:

[self.cameraLevel recenterPitch];

There are a few customizable options for the level:

The pitch indicator lines:

self.cameraLevel.lineWidth = 2.0f;
self.cameraLevel.lineColor = [UIColor redColor];

The outer and inner circles:

self.cameraLevel.circleWidth = 1.0f;
self.cameraLevel.circleColor = [UIColor greenColor];

The tick marks along the outer circle:

self.cameraLevel.tickWidth = 4.0f;
self.cameraLevel.tickColor = [UIColor orange];

To apply changes made to the levels properties you must call:

[self.cameraLevel redraw];

Camera Level
Customization

Requirements

Installation

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

pod "CameraLevel"

ToDo

  1. Reduce the amount of drawing needed to change properties. Remove ‘redraw’ method.
  2. Add more customization options
  3. Add modular components, to be able to customize the indicators in the level.

Author

Mohssen Fathi, [email protected]

License

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

Latest podspec

{
    "name": "CameraLevel",
    "version": "0.1.0",
    "summary": "CameraLevel is a quick drop in level, similar to a DSLR's digital level, that can be overlayed on a camera preview layer.",
    "description": "CameraLevel uses the devices accelerometer to calculate the current pitch and roll of the device. It is a UIView subclass that can be overlayed on an AV preview layer. The level is intended to be used in photography applications, similar to the levels found on common DSLRs.",
    "homepage": "https://github.com/mohssenfathi/CameraLevel",
    "license": "MIT",
    "authors": {
        "Mohssen Fathi": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mohssenfathi/CameraLevel.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "CameraLevel": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This