I am developing an iOS application using Objective-C and I want to use a Swift class (Alert box). I implement the whole function. Without any error I can pass the values. But I am getting the following error message:
"whose view is not in the window hierarchy!"
I've tried different ways:
Method 1
presentViewController(alertController, animated: true, completion: nil)
Method 2
self.presentViewController(alertController, animated: true, completion: nil)
Method 3
var mainView:MainViewController = MainViewController()
mainView.presentViewController(alertController, animated: true, completion: nil)
All methods are resulting the same error message.