vienvu89 / VTCameraPreviewView

A Subclass of UIView allow you show preview camera to view. Very simple to use.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VTCameraPreviewView

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

Example

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

Requirements

Xcode 7 and iOS 8 Above

Installation

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

pod 'VTCameraPreviewView'

Remember use

use_frameworks!

when you use pod swift.

Usage

You can put view from xib and make class is this class. And set camera isFront = yes or no . Done!

Or

import VTCameraPreviewView

.
.
.


override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.



    self.preview = VTCameraPreviewView(isFront: true)
}



override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()

     self.preview.frame = self.view.bounds
      self.view.addSubview(preiview)
}

And you can change camera by one line:

    self.preview.switchCamera()

Author

Vien Vu

License

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

About

A Subclass of UIView allow you show preview camera to view. Very simple to use.

License:MIT License


Languages

Language:Shell 62.1%Language:Swift 27.3%Language:Ruby 7.0%Language:Objective-C 3.6%