I've this function
func showMessageNew(msg:String,title: String){
let alertController = UIAlertController(title: title, message: msg, preferredStyle: .alert)
let okAction = UIAlertAction(title: "OK", style: .default)
alertController.addAction(okAction)
self.present(alertController, animated: true)
}
But when I run it I've this in the console: whose view is not in the window hierarchy!