且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在iOS 12中以编程方式终止应用

更新时间:2023-12-04 15:59:28

您可以调用退出方法

exit(-1)

或者您可以使用 NSXPCConnection.suspend

UIControl().sendAction(#selector(NSXPCConnection.suspend),
                       to: UIApplication.shared, for: nil)

此外,Apple不建议强制终止您的应用程序.没关系,怎么做.

Besides Apple isn't recommending to force terminate your app. It doesn't matter how you do that.

检查帖子.