How can I catch runtime exceptions in Swift?

Sometimes when my app crashes I get an exception like this: EXC_BREAKPOINT (SIGTRAP).

But I don't know how to catch it. Is there a way in Swift to catch such exceptions?

Answered by Scott in 816639022

See this recent thread for a good discussion of the topic.

You don’t give a specific example of the condition that may trigger that specific crash, but the answer is basically that Swift doesn’t support handling low-level exceptions like that.

See this recent thread for a good discussion of the topic.

You don’t give a specific example of the condition that may trigger that specific crash, but the answer is basically that Swift doesn’t support handling low-level exceptions like that.

How can I catch runtime exceptions in Swift?
 
 
Q