Suggested approach: Swift’s
catch blocks let us catch several types of errors, specified using comma separation – hence the “multi-pattern” clauses. They are useful as a way of grouping error handling code together: if the error thrown was A or B then take the same action, but if it was C or D take some other action.
Estimated difficulty: Intermediate
Link copied to your pasteboard.