Code To Crush A Swift Application on Startup/launch
Solution 1:
You can follow app lifecycle events in your UIApplicationDelegate
. For example application(_:didFinishLaunchingWithOptions:))
is called, when the app started and a little time before it's visible. You can put the crashing code there.
There are a few ways to crash the app. One of them is to call fatalError()
.