I'm getting Unbalanced calls to begin/end appearance transitions
error when i try to present view controller which is previously added as child controller, how to resolve this?
Unbalanced calls to begin/end appearance transitions
class VideoViewController: UIViewController {
}
class BigPlayerVC: UIViewController {
let videoVC = VideoViewController()
override func viewDidLoad() {
super.viewDidLoad()
addChild(videoVC)
view.addSubview(videoVC.view)
videoVC.view.translatesAutoresizingMaskIntoConstraints = false
// view.constrainViewEqual(videoReactController.playerView, top: 0, bottom: 0, left: 0, righta: 0)
videoVC.didMove(toParent: self)
}
@objc func onBTNClick() {
videoVC.willMove(toParent: nil)
videoVC.view.removeFromSuperview()
videoVC.view.translatesAutoresizingMaskIntoConstraints = true
videoVC.removeFromParent()
self.present(videoVC, animated: false, completion: nil)
}
}