Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Youtube: https://www.youtube.com/watch?v=7AlZxClmhPw
// Source: https://hashaam.com/2020/07/30/creating-camera-application-with-avfoundation/
import UIKit
class RequestCameraAuthorizationView: UIView {
@IBOutlet private weak var contentView: UIView!
override init(frame: CGRect) {
super.init(frame: frame)
customInit()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
customInit()
}
private func customInit() {
let bundle = Bundle.main
let nibName = String(describing: Self.self)
bundle.loadNibNamed(nibName, owner: self, options: nil)
addSubview(contentView)
contentView.frame = bounds
contentView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment