//取得正顯示的ViewController let navigationController = application.windows[0].rootViewController as! UINavigationController let activeViewCont = navigationController.visibleViewController //顯示Alert var alert = UIAlertController(title: "Alert", message: "Message", preferredStyle: UIAlertControllerStyle.Alert) alert.addAction(UIAlertAction(title: "關閉", style: UIAlertActionStyle.Default, handler: nil)) activeViewCont.presentViewController(alert, animated: true, completion: nil)
iOS開發記錄,以及Java, Servlet, JavaScript, CSS, Html, Objective-c, Swift, NodeJS, ExpressJS, React Native, Python..etc