{"id":304162,"date":"2020-05-24T21:00:27","date_gmt":"2020-05-24T21:00:27","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=304162"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=304162","title":{"rendered":"Swift 5.3: \u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e?"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/503606\/\">\u041f\u0440\u0438\u0432\u0435\u0442 \u0425\u0430\u0431\u0440! \u042f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Swift \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0432\u0438\u0434\u0443 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043f\u043e\u0434 iOS, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043d\u044f\u0442\u044b\u0445 \u0432 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c Swift \u0432\u0435\u0440\u0441\u0438\u0438 5.3.<\/p>\n<h4>Multiple trailing closures<\/h4>\n<p>  \u041d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f (<a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/master\/proposals\/0279-multiple-trailing-closures.md\" rel=\"nofollow\">SE-0279<\/a>) \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u042d\u0442\u043e \u0441\u0432\u043e\u0434\u0438\u0442 \u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043a\u043e\u0431\u043e\u043a \u0432 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<pre><code class=\"swift\">import Foundation  func load(url: String, success: (Data) -&gt; Void, failure: (Error) -&gt; Void) {      }  \/\/ old  version  load(url: &quot;someURL&quot;, success: { data in }, failure: { error in })  \/\/ new multiple trailing closures  load(url: &quot;someURL&quot;) { (data) in     \/\/ do smth } failure: { (error) in     \/\/ do smth }<\/code><\/pre>\n<p>  \u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 2 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u0435\u0435.<\/p>\n<h4>Multi-Pattern Catch Clauses<\/h4>\n<p>  \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 catch \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0435 do-catch \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0448\u0430\u0431\u043b\u043e\u043d. \u0427\u0442\u043e\u0431\u044b \u043e\u0431\u043e\u0439\u0442\u0438 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u043e\u0440\u043e\u0432 \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432 \u0442\u0435\u043b\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 catch, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0438 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 (<a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/master\/proposals\/0276-multi-pattern-catch-clauses.md\" rel=\"nofollow\">SE-0276<\/a>).<br \/>  <a name=\"habracut\"><\/a><br \/>  Catch-\u043f\u0443\u043d\u043a\u0442\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441 \u0442\u0435\u043b\u043e\u043c catch \u2014 \u043a\u0430\u043a \u0432 switch-\u0435.<\/p>\n<pre><code class=\"swift\">enum NetworkError: Error {     case failure, timeout }  \/\/ old  version func networkCall(){   do{     try someNetworkCall()   } catch NetworkError.timeout{     print(&quot;timeout&quot;)   } catch NetworkError.failure{     print(&quot;failure&quot;)   } }  \/\/ new multi-Pattern catch clauses func networkCall(){   do{     try someNetworkCall()   } catch NetworkError.failure, NetworkError.timeout {     print(&quot;handle for both&quot;)   } }<\/code><\/pre>\n<p>  <\/p>\n<h4>Synthesized Comparable Conformance for Enums<\/h4>\n<p>  \u0414\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c 2 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u043e \u043d\u0435 \u0442\u043e \u0447\u0442\u043e \u0431\u044b \u00ab\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c\u00bb \u0434\u0435\u043b\u043e\u043c. \u041d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u043a\u043e\u043d\u0444\u043e\u0440\u043c\u0438\u0442\u044c Comparable \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e &lt; \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u043e\u0433\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u0440\u0443\u0433\u043e\u0433\u043e.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c Swift (<a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/master\/proposals\/0266-synthesized-comparable-for-enumerations.md\" rel=\"nofollow\">SE-0266<\/a>) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0435 \u00ab\u043f\u0430\u0440\u0438\u0442\u044c\u0441\u044f\u00bb \u043d\u0430\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0432\u0435\u0449\u0435\u0439, \u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043f\u043e\u043a\u0430 \u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b. \u0415\u0441\u043b\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0437\u0430\u0434\u0430\u043d\u044b, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"swift\">enum Brightness: Comparable {     case low(Int)     case medium     case high }  ([.high, .low(1), .medium, .low(0)] as [Brightness]).sorted() \/\/ [Brightness.low(0), Brightness.low(1), Brightness.medium, Brightness.high]<\/code><\/pre>\n<p>  <\/p>\n<h4>\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e self-\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c<\/h4>\n<p>  \u041e\u0442\u043d\u044b\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c self \u0432 \u0442\u0435\u0445 \u043c\u0435\u0441\u0442\u0430\u0445, \u0433\u0434\u0435 \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e (<a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/master\/proposals\/0269-implicit-self-explicit-capture.md\" rel=\"nofollow\">SE-0269<\/a>). \u0420\u0430\u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 self \u0432 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f\u0445 \u0431\u044b\u043b\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438. <\/p>\n<pre><code class=\"swift\">struct OldView: View {      var body: some View {         Button(action: {             self.sayHello()         }) {             Text(&quot;Press&quot;)         }     }          func sayHello() {} }  struct NewView: View {      var body: some View {         Button {             sayHello()         } label: {             Text(&quot;Press&quot;)         }     }          func sayHello(){} }<\/code><\/pre>\n<p>  <\/p>\n<h4>Where \u0432 generic-\u0430\u0445<\/h4>\n<p>  \u041d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u044f\u0437\u044b\u043a\u0430 (<a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/master\/proposals\/0267-where-on-contextually-generic.md\" rel=\"nofollow\">SE-0267<\/a>) \u0432\u0432\u0435\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0442\u044c where \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439.<\/p>\n<pre><code class=\"swift\">struct Stack&lt;Element&gt; {     private var array = [Element]()      mutating func push(_ obj: Element) {         array.append(obj)     }      mutating func pop(_ obj: Element) -&gt; Element? {         array.popLast()     } }  extension Stack {     func sorted() -&gt; [Element] where Element: Comparable {         array.sorted()     } }<\/code><\/pre>\n<p>  \u0412 \u0441\u0442\u0435\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 sorted (), \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0435\u043a\u0430 \u043a\u043e\u043d\u0444\u043e\u0440\u043c\u044f\u0442 Comparable.<\/p>\n<h4>\u041d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f Float16<\/h4>\n<p>  \u0412\u0432\u0435\u0434\u0435\u043d\u0430 Float16 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 (<a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/master\/proposals\/0277-float16.md\" rel=\"nofollow\">SE-0277<\/a>). \u0421 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0433\u043e\u0434\u044b \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0430\u043c\u0431\u0438\u0446\u0438\u0438 Apple \u0432 \u043f\u0440\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u044b. Float 16 \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u0445 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0436\u0430\u0442\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0434\u043b\u044f \u0432\u0435\u0441\u043e\u0432 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 ML.<\/p>\n<pre><code class=\"swift\">let f16: Float16 = 7.29<\/code><\/pre>\n<p>  Swift 5.3 \u0432\u0432\u0435\u043b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439 \u0434\u043b\u044f Swift Package Manager (SPM). \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0436\u0435 \u0438\u0445.<\/p>\n<ol>\n<li><a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/master\/proposals\/0271-package-manager-resources.md\" rel=\"nofollow\">SE-0271<\/a> (Package Manager Resources) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 SPM \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043a\u0430\u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0430\u0443\u0434\u0438\u043e, JSON \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435. <\/li>\n<li><a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/master\/proposals\/0272-swiftpm-binary-dependencies.md\" rel=\"nofollow\">SE-0272<\/a> (Package Manager Binary Dependencies) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 SPM \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u043d\u0430\u0440\u044f\u0434\u0443 \u0441 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u0431\u0449\u0438\u0435 SDK \u0441 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a Firebase, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e SPM.<\/li>\n<li><a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/master\/proposals\/0273-swiftpm-conditional-target-dependencies.md\" rel=\"nofollow\">SE-0273<\/a> (Package Manager Conditional Target Dependencies) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0446\u0435\u043b\u0435\u0432\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0438\u043c\u0435\u043b\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0434\u043b\u044f Linux.<\/li>\n<li><a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/master\/proposals\/0278-package-manager-localized-resources.md\" rel=\"nofollow\">SE-0278<\/a> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b.<\/li>\n<\/ol>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0441\u0442\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f 5.3 \u043f\u0440\u0438\u0432\u043d\u0435\u0441\u043b\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/503606\/\"> https:\/\/habr.com\/ru\/post\/503606\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/503606\/\">\u041f\u0440\u0438\u0432\u0435\u0442 \u0425\u0430\u0431\u0440! \u042f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Swift \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0432\u0438\u0434\u0443 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043f\u043e\u0434 iOS, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043d\u044f\u0442\u044b\u0445 \u0432 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c Swift \u0432\u0435\u0440\u0441\u0438\u0438 5.3.<\/p>\n<h4>Multiple trailing closures<\/h4>\n<p>  \u041d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f (<a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/master\/proposals\/0279-multiple-trailing-closures.md\" rel=\"nofollow\">SE-0279<\/a>) \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u042d\u0442\u043e \u0441\u0432\u043e\u0434\u0438\u0442 \u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043a\u043e\u0431\u043e\u043a \u0432 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<pre><code class=\"swift\">import Foundation  func load(url: String, success: (Data) -&gt; Void, failure: (Error) -&gt; Void) {      }  \/\/ old  version  load(url: &quot;someURL&quot;, success: { data in }, failure: { error in })  \/\/ new multiple trailing closures  load(url: &quot;someURL&quot;) { (data) in     \/\/ do smth } failure: { (error) in     \/\/ do smth }<\/code><\/pre>\n<p>  \u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 2 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u0435\u0435.<\/p>\n<h4>Multi-Pattern Catch Clauses<\/h4>\n<p>  \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 catch \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0435 do-catch \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0448\u0430\u0431\u043b\u043e\u043d. \u0427\u0442\u043e\u0431\u044b \u043e\u0431\u043e\u0439\u0442\u0438 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u043e\u0440\u043e\u0432 \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432 \u0442\u0435\u043b\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 catch, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0438 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 (<a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/master\/proposals\/0276-multi-pattern-catch-clauses.md\" rel=\"nofollow\">SE-0276<\/a>).  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-304162","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=304162"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304162\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}