Git Product home page Git Product logo

cameramanager's Introduction

####Camera Manager

V1.0.9 (10-Mar-2015)

####About This is a simple swift class to provide all the configurations you need to create custom camera view in your app. It follows orientation change and updates UI accordingly, supports front and rear camera selection, different flash modes, inputs and outputs. Just drag, drop and use.

####Installation with CocoaPods

The easiest way to install the CameraManager is with: CocoaPods

Podfile

use_frameworks!

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 specify if you want to save the files to phone library:

CameraManager.sharedInstance.writeFilesToPhoneLibrary = true

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 8 and above

####License

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

cameramanager's People

Contributors

nelanelanela avatar davidortinau avatar davidy avatar

Watchers

James Cloos avatar Miken 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.