In my application I have 2 storyboards: Onboarding and Main. When user opens app for a first time - Onboarding storyboard is presented. After that, he presses a button and I show him Main Storyboard with such code:
let storyboard = UIStoryboard(name: "Shop", bundle: nil)
let navigationVc = storyboard.instantiateViewController(withIdentifier: "ShopScreens") as UIViewController
navigationVc.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext
self.present(navigationVc, animated: false, completion: nil)
I wanted to make custom animation, when user switches storyboards. To do so - I've created simple view that I'm presenting on top of everything like this:
UIApplication.shared.keyWindow?.addSubview(self.containerViewForAnimatedView)
And this view is working fine, but only in terms of one Storyboard, it covers everything while app changes screens.
But when I try to switch storyboards - this view gets covered by newly presented storyboard.
I also tried presenting view in such way and brining it to front:
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.window?.addSubview(self.containerViewForAnimatedView)
But that din't work as well.
How can I hide switching of storyboards by presenting custom created view during that transition? Would be grateful for any help.