I have implemented iOS App, In that if we get any unknown crash i want to show one message like \"sorry some thing went wrong\". Meanwhile the App did not close. It still open i
Short answer: This is not a good idea and should be avoided at all cost. Convince the person who provided that requirement that this should not be done.
Long answer: When your app crashes, this means something went horribly wrong. It got into a state where nothing can be guaranteed any longer and it is better (even for the app user) to quit the app right away. The reasons for a crash could be:
For the first case you could setup unhandled error handlers across your app or globally; this is what crash reporting SDKs do. For the other reasons you need to set up signal handlers (or even Mach exception handlers) to get those. One rule in those cases is that at crash time you should NOT allocate new memory, simply because you have no guarantee that will work or would not overwrite memory used by other parts of your app which then could cause major corruption of the user's data, or deadlock the device which means the device owner has to restart it.
Not being allowed to allocate any memory at crash time means you can't use any Swift or Objective-C code, because allocating a new object WILL allocate new memory. And showing an alert will just do that as having the app continue to run will do as well. You can only use a subset of (async-safe) C methods at crash time!
So the end of the story is:
If the operating system decides that your app should exit (crash) because of such an unsafe scenario, you as an app developer should not decide otherwise.