Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7195

Crash handling in swiftUI

$
0
0

Newcomer in ios with some android experience . I would like to handle app crashes (if possible in ios) in swiftui like i do in android ie forward the user to a custom View.Basically , when an lethal error occurs in java it is caught and user forwarded .

Here is the code in java

public void uncaughtException(Thread thread, Throwable exception) {    StringWriter stackTrace = new StringWriter();    exception.printStackTrace(new PrintWriter(stackTrace));    System.err.println(stackTrace);    Intent intent = new Intent(myContext, myActivityClass);    String s = stackTrace.toString();    intent.putExtra("error", s);    myContext.startActivity(intent);    android.os.Process.killProcess(android.os.Process.myPid());    System.exit(0);}

Viewing all articles
Browse latest Browse all 7195

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>