PPLiveCameraCell.swift 433 B

12345678910111213141516171819
  1. import UIKit
  2. import AVFoundation
  3. /**
  4. Cell representing live camera feed in Assets Collection Controller.
  5. */
  6. class PPLiveCameraCell: UICollectionViewCell {
  7. func set(layer: AVCaptureVideoPreviewLayer) {
  8. layer.frame = bounds
  9. self.layer.insertSublayer(layer, at: 0)
  10. }
  11. override func layoutSubviews() {
  12. self.layer.sublayers?[0].frame = bounds
  13. }
  14. }
  15. extension PPLiveCameraCell: PPReusableView {}