ios - Is MyViewController in the window hierarchy? -


is there way check if myviewcontroller in window hierarchy ? want know if can present uialertcontroller :

var alert = uialertcontroller(title: "hello", message: "just fun", preferredstyle: uialertcontrollerstyle.alert) myviewcontroller.presentviewcontroller(alert, animated: true, completion: nil) 

the view controller's view have window property set if in hierarchy

if myviewcontroller.view.window != nil {     // in window hierarchy } 

Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -