There is a lot of news in Binary sizes, Dirty memory, Heap Usage but I want to focus on language. Here I will describe few new classes etc. from Swift 5.3
So here we go 😃
Multiple trailing closure syntax (SE-0279)
From line 7 you have the new, shortest version on the very same code.
Since its inception, Swift has supported something called trailing closure syntax that lets you pop the final argument to a method out of the parentheses when it’s a closure.
It can be more concise and less nested without the loss of clarity, making the call site much easier to read.
Since its inception, Swift has supported something called trailing closure syntax that lets you pop the final argument to a method out of the parentheses when it’s a closure.
It can be more concise and less nested without the loss of clarity, making the call site much easier to read.
Since its inception, Swift has supported something called trailing closure syntax that lets you pop the final argument to a method out of the parentheses when it’s a closure.
It can be more concise and less nested without the loss of clarity, making the call site much easier to read.
However, the restriction of trailing closure syntax to only the final closure has limited its applicability.
KeyPath Expressions as Functions (SE-0249)

You can use an KeyPath
expression as a function. This means you can pass an KeyPath
argument to any function parameter with a matching signature, and you can delete any duplicate declarations you may have added in the past in order to accept KeyPath
s.
@main (SE-0281)
In Swift 5.3, this feature has been generalized and democratized.
If you’re a library author, just declare a static main method on the protocol or superclass you expect your users to derive their entry point from.



This will enable your users to tag that type with @main
and the compiler to generate an implicit main.swift
on their behalf.
This standardized way to delegate a program’s entry point should make it easier to get up and running, whether you’re working on a command-line tool or an existing application.
Multipattern Catch Clauses (SE-0276)

The grammar of catch
clauses has been extended, providing for the full power of switch
cases. This allows you to flatten the kind of multiclause pattern matching directly into the do
catch
the statement, making it much easier to read.
These are the most important changes in my opinion, for mo check out Apple’s documentation at developer.apple.com
Comments
Post a Comment