CameraLevel 0.1.0

CameraLevel 0.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Feb 2016

Maintained by Mohssen.



  • By
  • Mohssen Fathi

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];


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.