I am facing a serious issue. I have a framework named "abc.framework" and it contains a function in which you can pass a viewController object.
//this is the method in my framework
func launchView(view:UIViewController){
}
//this is what needs to be written on App side
myFrameworkFile.launchView(view: self)
The above method is used to present the Framework's viewcontroller i.e abc.framework viewController on top of the the viewController object passed. The launch method contains the following code :
func launchView(view:UIViewController)
{
var rootController: UIViewController?
rootController = view
let storyboard = UIStoryboard(name: "abcFrameworkBundle.bundle/abcUIMain", bundle: nil)
let VC1 = storyboard.instantiateViewController(withIdentifier: "selectedviewcontroller") as! SelectedViewController
rootController?.present(VC1, animated: true, completion: nil)
}
From the above method the viewController the SelectedViewController viewDidLoad method is getting called however it is not getting presented and I am getting the below warning
Warning: Attempt to present on whose view is not in the window hierarchy!
Has anyone faced the same issue?