I have to add second view controller's view on UIWindow of the first view controller using addChildViewController
. but I'm getting issue when I'm trying to do that. My query is, it is possible to add that another view controller's view on UIWindow?
secondVC = (self.storyboard?.instantiateViewController(withIdentifier: "secondVC"))!
self.addChildViewController(secondVC)
self.didMove(toParentViewController: self)
draw.view.frame = CGRect(x:0, y:0, 320, 568)
let window = UIApplication.shared.keyWindow
window?.addSubview(secondVC.view)