[![CI Status](http://img.shields.io/travis/Mohssen Fathi/CameraLevel.svg?style=flat)](https://travis-ci.org/Mohssen Fathi/CameraLevel)
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];
CameraLevel is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "CameraLevel"
- Reduce the amount of drawing needed to change properties. Remove 'redraw' method.
- Add more customization options
- Add modular components, to be able to customize the indicators in the level.
Mohssen Fathi, mmohssenfathi@gmail.com
CameraLevel is available under the MIT license. See the LICENSE file for more info.