Proper way to exit iPhone application?

前端 未结 25 3032
难免孤独
难免孤独 2020-11-22 01:54

I am programming an iPhone app, and I need to force it to exit due to certain user actions. After cleaning up memory the app allocated, what\'s the appropriate method to ca

25条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-22 02:58

    Swift 4.2 (or older)

    Library called Darvin can be used.

    import Darwin
    
    exit(0) // Here you go
    

    NB: This is not recomanded in iOS applications.

    Doing this will get you crash log.

提交回复
热议问题