I have problem to display my ViewControllers. Sometimes happens this... freezing UI while pushing new ViewController. All UI elements created programmatically with SnapKit (in current code CameraUI class).
GIF demo: https://radikal.ru/video/VeDy5trCfNn
Pushing Action from origin ViewController
@objc func cameraAction(){
let cameraVC = CameraViewController()
self.navigationController?.pushViewController(cameraVC, animated: true)
}
CameraViewController
class CameraViewController: UIViewController{
lazy var UI = CameraUI(view: self.view, navController: self.navigationController!)
override func viewDidLoad() {
super.viewDidLoad()
title = "Camera"
addUIElements()
setupCaptureSession()
setupDevice()
setupInputOutput()
setupPreviewLayer()
startRunningCaptureSession()
addActions()
}
private func addUIElements(){
UI.addElementsToSuperView()
view.layoutIfNeeded()
}
}