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 LaunchViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
setupViews()
}
}
private extension LaunchViewController {
func setupViews() {
addRequestCameraAuthorizationView()
}
func addRequestCameraAuthorizationView() {
let requestCameraAuthorizationView = RequestCameraAuthorizationView()
requestCameraAuthorizationView.translatesAutoresizingMaskIntoConstraints = false
requestCameraAuthorizationView.delegate = self
view.addSubview(requestCameraAuthorizationView)
NSLayoutConstraint.activate([
requestCameraAuthorizationView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
requestCameraAuthorizationView.topAnchor.constraint(equalTo: view.topAnchor),
requestCameraAuthorizationView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
requestCameraAuthorizationView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
])
}
}
extension LaunchViewController: RequestCameraAuthorizationViewDelegate {
func requestCameraAuthorizationActionButtonTapped() {
print("request camera authorization button tapped")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.