标签: ios swift error-handling runtime-error
如何对iOS上的意外错误做出反应?例如:
func foo(a: Int, _ b: Int) { print(a / b) } //oops, this produces a divide by zero error. How can I react to this //unexpected error so I can report it to a remote server. foo(1, 0)