模拟按Home键退出应用的简单方法(分享)
程序员文章站
2023-11-24 18:14:28
实例如下:
func exitapplication() {
let app = uiapplication.sharedapplication()....
实例如下:
func exitapplication() { let app = uiapplication.sharedapplication().delegate as! appdelegate let window = app.window dispatch_async(dispatch_get_main_queue(), { uiview.animatewithduration(0.5, animations: { window!.alpha = 0 window?.frame = cgrectmake((window?.bounds.size.width)!/2.0, (window?.bounds.size.height)!/2.0, 0, 0) }) { (finish) in exit(0) } }) }
以上这篇模拟按home键退出应用的简单方法(分享)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。