Skip to content

Commit

Permalink
Use no camera view
Browse files Browse the repository at this point in the history
  • Loading branch information
vadymmarkov committed Nov 12, 2015
1 parent f747547 commit 820b6df
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Source/CameraView/CameraView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ class CameraView: UIViewController {
return view
}()

lazy var noCameraLabel: UILabel = { [unowned self] in
let label = UILabel()
label.font = self.pickerConfiguration.noCameraFont
label.textColor = self.pickerConfiguration.noCameraColor
label.text = self.pickerConfiguration.noCameraTitle
label.alpha = 1
label.sizeToFit()
self.view.addSubview(label)

return label
}()

let captureSession = AVCaptureSession()
let devices = AVCaptureDevice.devices()
var captureDevice: AVCaptureDevice? {
Expand All @@ -72,6 +84,14 @@ class CameraView: UIViewController {
previewLayer?.backgroundColor = self.pickerConfiguration.mainColor.CGColor
}

// MARK: - Layout

override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
noCameraLabel.center = CGPoint(x: view.bounds.width / 2,
y: view.bounds.height / 2 - 100)
}

// MARK: - Initialize camera

func initializeCamera() {
Expand Down

0 comments on commit 820b6df

Please sign in to comment.