Go to file
nelanelanela 6c76ae1fb8 Resources only recreated when needed. 2014-10-15 17:38:38 +01:00
camera Resources only recreated when needed. 2014-10-15 17:38:38 +01:00
camera.xcodeproj Resources only recreated when needed. 2014-10-15 17:38:38 +01:00
CameraManager.podspec Podspec updated. 2014-10-15 16:29:31 +01:00
LICENSE Licence updated. 2014-10-15 13:47:07 +01:00
Podfile Podspec updated. 2014-10-15 16:29:31 +01:00
README.md Resources only recreated when needed. 2014-10-15 17:38:38 +01:00

README.md

####Camera Manager

V1.0.2 (15-Oct-2014)

####About This is a simple swift class to provide all the configurations you need to create custom camera view in your app. Just drag, drop and use.

####Installation with CocoaPods

The easiest way to install the CameraManager is with: CocoaPods

Podfile

platform :ios, '7.0'
pod 'CameraManager', '~> 1.0

####How to use To use it you just add the preview layer to your desired view

CameraManager.sharedInstance.addPreeviewLayerToView(self.cameraView)

You can set input device to front or back camera:

CameraManager.sharedInstance.cameraDevice = .Front 
CameraManager.sharedInstance.cameraDevice = .Back 

You can set output format to Image, video or video with audio:

CameraManager.sharedInstance.cameraOutputMode = .StillImage
CameraManager.sharedInstance.cameraOutputMode = .VideoWithMic
CameraManager.sharedInstance.cameraOutputMode = .VideoOnly

You can set the quality:

CameraManager.sharedInstance.cameraOutputQuality = .Low
CameraManager.sharedInstance.cameraOutputQuality = .Medium
CameraManager.sharedInstance.cameraOutputQuality = .High

And flash mode:

CameraManager.sharedInstance.flashMode = .Off
CameraManager.sharedInstance.flashMode = .On
CameraManager.sharedInstance.flashMode = .Auto

You can even setUp your custom block to handle error messages:

CameraManager.sharedInstance.showErrorBlock = { (erTitle: String, erMessage: String) -> Void in
    UIAlertView(title: erTitle, message: erMessage, delegate: nil, cancelButtonTitle: "OK").show()
}

To shoot image all you need to do is call:

CameraManager.sharedInstance.capturePictureWithCompletition({ (image) -> Void in
	self.myImage = image             
})

To record video you do:

CameraManager.sharedInstance.startRecordingVideo()
CameraManager.sharedInstance.stopRecordingVideo({ (videoURL) -> Void in
	NSFileManager.defaultManager().copyItemAtURL(videoURL, toURL: self.myVideoURL, error: &error)
})

####Support

Supports iOS 7 and above

####License

Copyright © 2014 ImaginaryCloud, imaginarycloud.com. This plugin is licensed under the MIT license.