[![CI Status](http://img.shields.io/travis/Vien Vu/VTCameraPreviewView.svg?style=flat)](https://travis-ci.org/Vien Vu/VTCameraPreviewView)
To run the example project, clone the repo, and run pod install
from the Example directory first.
Xcode 7 and iOS 8 Above
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.
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()
Vien Vu
VTCameraPreviewView is available under the MIT license. See the LICENSE file for more info.