Swift 5.3, which has recently become available with Xcode 12, includes a number of significant new features at the syntax level, including support for multi-pattern catch
clauses, increased availability for implicit self
, and more. Additionally, the Swift team has worked on improving runtime performance, especially when using SwiftUI, and developer experience.
Swift 5.3 makes error handling with do try/catch
more convenient by allowing to specify more patterns with a single [catch](https://github.com/apple/swift-evolution/blob/master/proposals/0276-multi-pattern-catch-clauses.md)
clause. For example, you can now write:
do {
try performTask()
} catch TaskError.someRecoverableError {
recover()
} catch TaskError.someFailure(let msg),
TaskError.anotherFailure(let msg) {
showMessage(msg)
}
#ios #programming languages #swift #mobile #apple #macos #development #news