let alertController = UIAlertController(title: "Title", message: "Some message", preferredStyle: .alert) let alertAction = UIAlertAction(title: "OK", style: .default, handler: nil) alertController.addAction(alertAction) view?.window?.rootViewController?.present(alertController, animated: true, completion: nil)