{"id":282090,"date":"2016-12-06T22:15:03","date_gmt":"2016-12-06T19:15:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=282090"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=282090","title":{"rendered":"\u0422\u044e\u043d\u0438\u043d\u0433 Swift \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430. \u0427\u0430\u0441\u0442\u044c 1"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/cloud.kilograpp.com\/f\/26970d482b\/?dl=1&amp;t=1\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041e\u0431\u0437\u043e\u0440 Swift 3 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0435\u0433\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c. \u0427\u0430\u0441\u0442\u044c 1.<br \/>  \u0420\u0430\u0437\u0432\u0435\u043d\u0447\u0430\u043d\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u0438\u0444\u043e\u0432. \u041c\u043d\u0435\u043d\u0438\u0435 \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 autocompletion \u0432 Xcode.<\/p>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h3 id=\"predislovie\">\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435:<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430\u0448\u0430 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043f\u043e\u0434 \u043a\u043b\u044e\u0447. \u041c\u043d\u043e\u0433\u0438\u0435 \u043d\u0430\u0448\u0438 iOS \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043d\u0430 Objective-C \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c, \u0438\u0445 \u0434\u0435\u0432\u0443\u0448\u043a\u0430 Cocoa, \u0430 \u0441\u043f\u044f\u0442 \u043e\u043d\u0438 \u0432 \u043e\u0431\u043d\u0438\u043c\u043a\u0443 \u0441 \u0430\u0439\u0444\u043e\u043d\u043e\u043c\u2026 \u0438 \u0432\u043e\u0442 \u0441\u0442\u0430\u043b\u0438 \u043c\u044b \u0432\u0434\u0440\u0443\u0433 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 Swift.<\/p>\n<p>  <\/p>\n<p>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043e\u0441\u044f\u043a\u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430, \u0432\u0435\u0441\u0435\u043b\u044b\u0435 &quot;Segmentation Fault: 11&quot;, \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u0430\u0441\u043d\u0443\u0449\u0443\u044e \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0443, \u044d\u0442\u043e \u0432\u0441\u0435 \u0438 \u0442\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e. \u041f\u0443\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u043d\u043e, \u043d\u043e \u0442\u0435\u0440\u043f\u0438\u043c\u043e.<br \/>  \u041d\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u0435-\u0447\u0442\u043e \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u0443\u0431\u0438\u0432\u0430\u044e\u0449\u0435\u0435 \u0431\u0438\u0437\u043d\u0435\u0441, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0435 \u0434\u0438\u0441\u043a\u043e\u043c\u0444\u043e\u0440\u0442. \u041c\u0435\u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440. \u0414\u0430-\u0434\u0430, \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0433\u0440\u043e\u043c\u043a\u0438\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a.<br \/>  \u041a\u043e\u0433\u0434\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043f\u043e \u043e\u0431\u044a\u0435\u043c\u0443 Obj-C \u0438 Swift \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0441 \u0447\u0435\u0442\u044b\u0440\u0435\u0445\u043a\u0440\u0430\u0442\u043d\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b \u0432\u0441\u0435\u0433\u043e \u043a\u043e\u0434\u0430. \u041a\u043e\u0433\u0434\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u044b\u0432\u043e\u0434\u044f\u0442 \u0435\u0433\u043e \u0438\u0437 \u0441\u0442\u0440\u043e\u044f \u2014 \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0443\u0431\u0438\u0439\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u0410 \u043a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e: \u0432\u0440\u0435\u043c\u044f \u2014 \u044d\u0442\u043e \u0434\u0435\u043d\u044c\u0433\u0438. <\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430: \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u043d\u044b\u0442\u044c \u0438 \u0442\u0435\u0440\u043f\u0435\u0442\u044c, \u043b\u0438\u0431\u043e \u0440\u0435\u0448\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441. \u041c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0432\u0442\u043e\u0440\u043e\u0435. <\/p>\n<p>  <\/p>\n<h3 id=\"izobretenie-velosipeda\">\u0418\u0437\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u0438\u0435 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430<\/h3>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u043a\u043e\u043b\u0435\u043d\u043e \u0432 Swift, \u043c\u044b \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0448\u0443\u0440\u0448\u0430\u043b\u0438 \u043f\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439 \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438. \u041a \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u0447\u0430\u0441\u0442\u044c\u044e \u0431\u044b\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u043d\u0435\u043f\u043b\u043e\u0445\u0430\u044f <a href=\"https:\/\/habrahabr.ru\/post\/283106\/\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a> \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u043d\u0430 <a href=\"https:\/\/medium.com\/@RobertGummesson\/regarding-swift-build-time-optimizations-fc92cdd91e31#.sc8u006hd\">\u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c<\/a>. <\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0437\u0430\u0447\u0435\u043c \u0436\u0435 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u043f\u043b\u043e\u0434\u0438\u0442\u044c? \u0410 \u0437\u0430\u0442\u0435\u043c, \u0447\u0442\u043e, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0432\u0441\u0435 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0435\u0449\u0435 \u0434\u043e \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0441\u0432\u0438\u0444\u0442\u0430, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0432\u0435\u0440\u043d\u044b, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0432\u0430\u0440\u043d\u044b\u0445 \u043c\u0435\u0441\u0442 \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c. \u0427\u0435\u043c \u043c\u044b \u0438 \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f. <\/p>\n<p>  <\/p>\n<p>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u0442\u0443\u0442 \u043d\u0435 \u043d\u0430 \u043e\u0434\u043d\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u0442\u0430\u043a \u0447\u0442\u043e \u0431\u0443\u0434\u0443 \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e.<br \/>  \u0414\u0430 \u0438 \u043a\u0440\u043e\u043c\u0435 \u0441\u0430\u043c\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u0444\u0430\u043a\u0442\u043e\u0440 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 runtime, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u043e\u0436\u0435 \u043d\u0430\u0434\u043e \u0431\u044b \u043e\u0441\u0432\u0435\u0442\u0438\u0442\u044c. <\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043d\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 Swift 3. <\/p>\n<p>  <\/p>\n<h4 id=\"nil-coalescing-operator\">Nil Coalescing Operator<\/h4>\n<p>  <\/p>\n<p>\u041c\u043e\u044f \u043b\u044e\u0431\u0438\u043c\u0430\u044f \u0444\u0438\u0448\u043a\u0430 Swift, \u0441\u0430\u0445\u0430\u0440\u043d\u044b\u0439 optional. \u0427\u0435\u043c-\u0442\u043e \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 nil-safe \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 Obj-C. <\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439. \u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044b \u043f\u043e\u0439\u043c\u0435\u0442\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d\u0438 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b:<\/p>\n<p>  <\/p>\n<pre><code>let left: UIView? = UIView() let right: UIView? = UIView() let width: CGFloat = 10 let height: CGFloat = 10  let size = CGSize(width: width + (left?.bounds.width ?? 0) + (right?.bounds.width ?? 0) + 22, height: height)<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0412\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong>: 12 \u0441\u0435\u043a\u0443\u043d\u0434! <del>\u041f\u0440\u0438\u044f\u0442\u0435\u043b\u044c, \u0443 \u0442\u0435\u0431\u044f \u0442\u0440\u0435\u0442\u0438\u0439 \u043f\u0435\u043d\u044c \u0447\u0442\u043e \u043b\u0438?<\/del><br \/>  \u0414\u0430\u0436\u0435 \u0445\u0443\u0436\u0435, \u0447\u0435\u043c \u0431\u044b\u043b\u043e \u0432 Swift 2.2. <\/p>\n<p>  <\/p>\n<p>\u0425\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u043a\u0430\u0437\u0430\u0442\u044c: &quot;\u0412\u043e\u0443, Apple, \u0447\u0442\u043e \u0437\u0430?&quot;, \u043d\u043e \u043d\u0435 \u0441\u043f\u0435\u0448\u0438\u0442\u0435 \u0441 \u0432\u044b\u0432\u043e\u0434\u0430\u043c\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u0440\u0430\u0437\u0431\u0438\u0432 \u0434\u043b\u0438\u043d\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445:<\/p>\n<p>  <\/p>\n<pre><code>let firstPart = left?.bounds.width ?? 0 + width let secondPart = right?.bounds.width ?? 0 + 22 let requiredWidth = firstPart + secondPart let size = CGSize(width: requiredWidth, height: height)<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0412\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong>: 30 ms. (\u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434)<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0434\u0435\u043b\u043e \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 \u0432 \u0437\u043b\u044b\u0445 optional?<br \/>  \u041d\u043e \u043d\u0435\u0442, \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443:<\/p>\n<p>  <\/p>\n<pre><code>class A {     var b: B? = B() }  class B {     var c: C? = C() }  class C {     var d: D? = D() }  class D {     var value: CGFloat? = 10 }  ...  let left: A? = A() let right: A? = A() let width: CGFloat = 10 let height: CGFloat = 10  \/\/ \u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u043b\u0430\u043c\u0431\u0430\u0434\u0430!  let firstPart = left?.b?.c?.d?.value ?? 0 + width let secondPart = right?.b?.c?.d?.value ?? 0 + 22 let requiredWidth = firstPart + secondPart let size = CGSize(width: requiredWidth, height: height)<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0412\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong>: 35 ms. <\/p>\n<p>  <\/p>\n<p><strong>\u0412\u044b\u0432\u043e\u0434<\/strong>: \u0423 Nil Coalescing Operator \u0432\u0441\u0435 \u0441\u0442\u0435\u0440\u0438\u043b\u044c\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<br \/>  \u041d\u043e \u0442\u043e\u0433\u0434\u0430 \u0432 \u0447\u0435\u043c \u0436\u0435 \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430? <\/p>\n<p>  <\/p>\n<p>\u0423\u0436\u0435 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u0440\u0435\u043d\u044c \u0437\u043b\u0430 \u0442\u0430\u0438\u0442\u0441\u044f \u0432 \u0434\u043b\u0438\u043d\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445. \u0410\u0432\u0442\u043e\u0440 \u0440\u0443\u0441\u0441\u043a\u043e\u0439 <a href=\"https:\/\/habrahabr.ru\/post\/283106\/\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u0432\u0441\u043a\u043e\u043b\u044c\u0437\u044c \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b, \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 nil coalescing operator \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445, \u043d\u043e, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435 \u0437\u0430\u043e\u0441\u0442\u0440\u0438\u043b \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. <\/p>\n<p>  <\/p>\n<p><strong>\u041f\u0440\u0430\u0432\u0438\u043b\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435<\/strong>: \u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0437\u0430\u043f\u043e\u0440 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u043c\u0438. \u0422\u043e \u0435\u0441\u0442\u044c \u0442\u0435\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u043d\u043e \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0410 \u0432\u043e\u0442 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0412\u044b, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0441\u043a\u0430\u0436\u0435\u0442\u0435: &quot;\u0413\u0434\u0435 \u043f\u0440\u0443\u0444\u044b, \u0411\u0438\u043b\u043b\u0438?&quot; <\/p>\n<p>  <\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e. \u0422\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434, \u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0434\u0440\u043e\u0431\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043f\u043e\u0434-\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code>let requiredWidth = left?.b?.c?.d?.value ?? 0 + right?.b?.c?.d?.value ?? 0 + width + 22 let size = CGSize(width: requiredWidth, height: height)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0434\u043e\u043b\u0433\u043e \u0436\u0434\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c (\u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c):<br \/>  <img decoding=\"async\" src=\"https:\/\/cloud.kilograpp.com\/f\/78389a8373\/?dl=1&amp;t=\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0426\u0438\u0442\u0438\u0440\u0443\u044e, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043e \u0441\u043a\u0440\u0438\u043d\u0430: &quot;Expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions&quot;.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0432\u043e\u0434: &quot;\u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0420\u0430\u0437\u0431\u0435\u0439\u0442\u0435 \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0434-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.&quot;<\/p>\n<p>  <\/p>\n<p>\u0427.\u0442.\u0434.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0432\u0435\u0440\u0445-\u044d\u0444\u0444\u0435\u043a\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<p><em>\u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435\u043c \u0431\u0435\u0437 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0430\u0437\u044b.<\/em><\/p>\n<p>  <\/p>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043b\u0438, \u0447\u0442\u043e \u0432 Xcode \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u043e\u0442\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f auto-completion. \u042d\u0442\u043e, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0444\u043e\u043d\u043e\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 &quot;<em>Expression was too complex<\/em>&quot;, \u0442\u043e \u0441\u0440\u0430\u0437\u0443 \u0437\u0430 \u044d\u0442\u0438\u043c \u0443\u043c\u0440\u0443\u0442 \u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438. <\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0442\u043e\u0442 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434 \u0438 \u043d\u0430\u0447\u043d\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c self.view, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443:<br \/>  <img decoding=\"async\" src=\"https:\/\/cloud.kilograpp.com\/f\/4ec001aabf\/?dl=1\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0410 \u043f\u043e\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0448\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435-\u0443\u0431\u0438\u0439\u0446\u0443. \u0412\u0441\u0435, \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a \u0432\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0443\u0441\u0438\u043b\u0435\u043d\u043d\u043e \u043b\u0443\u043f\u0438\u0442\u044c \u043f\u043e ctrl+space:<br \/>  <img decoding=\"async\" src=\"https:\/\/cloud.kilograpp.com\/f\/46e4368c44\/?dl=1\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041b\u0435\u0447\u0438\u0442\u0441\u044f \u044d\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u044f\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430. <\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0418\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435. <\/p>\n<p>  <\/p>\n<h4 id=\"ternarnyy-operator\">\u0422\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440<\/h4>\n<p>  <\/p>\n<p>\u0412 <a href=\"https:\/\/medium.com\/@RobertGummesson\/regarding-swift-build-time-optimizations-fc92cdd91e31#.4lj0xudhi\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u0442\u0430\u043a \u0436\u0435 \u043e\u0441\u0432\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u0412\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445:<\/p>\n<p>  <\/p>\n<pre><code>\/\/ Build time: 239.0ms let labelNames = type == 0 ? (1...5).map{type0ToString($0)} : (0...2).map{type1ToString($0)}  \/\/ Build time: 16.9ms var labelNames: [String] if type == 0 {     labelNames = (1...5).map{type0ToString($0)} } else {     labelNames = (0...2).map{type1ToString($0)} }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0443 \u043c\u0435\u043d\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u0430\u043a type0ToString \u0432 SDK \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c. \u042f \u0435\u0433\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u043b \u043d\u0430 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043d\u0438\u043a\u0430\u043a\u043e\u0439:<\/p>\n<p>  <\/p>\n<pre><code>let labelNames = type == 0 ? (1...5).map{String($0)} : (0...2).map{String($0)}<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0412\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong>: 260 ms. \u041f\u043e\u043a\u0430 \u0432\u0441\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0441\u044f. <\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043d\u0435\u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e \u043e\u0431\u0432\u0438\u043d\u0435\u043d. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043d\u043e\u0432\u0430 \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043d\u043e \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f if-else:<\/p>\n<p>  <\/p>\n<pre><code>let first = (1...5).map{String($0)} let second = (0...2).map{String($0)} let labelNames = type == 0 ? first : second<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0412\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong>: 45 ms<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u0435\u043b. \u0423\u043f\u0440\u043e\u0441\u0442\u0438\u043c \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435:<\/p>\n<p>  <\/p>\n<pre><code>let first = 4 let second = 5 let labelNames = type == 0 ? first : second<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0412\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong>: 7 ms. <\/p>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u0434\u0438\u043a\u0442: \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d. <\/p>\n<p>  <\/p>\n<h4 id=\"esche-neskolko-amnistiy\">\u0415\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u043c\u043d\u0438\u0441\u0442\u0438\u0439<\/h4>\n<p>  <\/p>\n<p>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f Round():<\/p>\n<p>  <\/p>\n<pre><code>\/\/ Build time: 1433.7ms let expansion = a - b - c + round(d * 0.66) + e<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0412\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong>: 6ms<\/p>\n<p>  <\/p>\n<p>\u0421\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code>\/\/ Build time Swift 2.2: 1250.3ms \/\/ Build time Swift 3.0: 92.7ms  ArrayOfStuff + [Stuff]<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0412\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong>: 19ms<\/p>\n<p>  <\/p>\n<p>\u0418 \u0441\u0430\u043c\u043e\u0435 \u0441\u043b\u0430\u0434\u043a\u043e\u0435:<\/p>\n<p>  <\/p>\n<pre><code>let myCompany = [             &quot;employees&quot;: [                 &quot;employee 1&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 2&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 3&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 4&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 5&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 6&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 7&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 8&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 9&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 10&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 11&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 12&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 13&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 14&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 15&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 16&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 17&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 18&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 19&quot;: [&quot;attribute&quot;: &quot;value&quot;],                 &quot;employee 20&quot;: [&quot;attribute&quot;: &quot;value&quot;],             ]         ]<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u0412\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong>: 86 ms. \u041c\u043e\u0433\u043b\u043e \u0431\u044b\u0442\u044c \u0438 \u043b\u0443\u0447\u0448\u0435, \u043d\u043e \u0443\u0436\u0435 \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0435 <a href=\"https:\/\/spin.atomicobject.com\/2016\/04\/26\/swift-long-compile-time\/\">12 \u0447\u0430\u0441\u043e\u0432<\/a>.<\/p>\n<p>  <\/p>\n<hr\/>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0435\u0440\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c. \u0412 \u043d\u0435\u0439 \u043c\u044b \u0440\u0430\u0437\u0432\u0435\u043d\u0447\u0430\u043b\u0438 \u043c\u0438\u0444\u044b \u043e\u0431 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0438 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u0445, \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445. \u0423\u0437\u043d\u0430\u043b\u0438 \u043e\u0431 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0440\u0438\u0447\u0438\u043d \u0437\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u0439 autocompletion, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e Swift \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u043e\u0440\u043c\u043e\u0437\u044f\u0442 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0443\u043b\u044b. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0435\u0449\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u0430\u0441\u043f\u0435\u043a\u0442\u0430\u043c \u044f\u0437\u044b\u043a\u0430, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043d\u0430 \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b switch-case, if-else, guard \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. <\/p>\n<p>  <\/p>\n<p>\u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438. \u041f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u0447\u0442\u043e \u0440\u0430\u0437<em>\u0445\u0430\u0431\u0440<\/em>\u0430\u0442\u044c \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c.<\/p>\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:\/\/habrahabr.ru\/post\/316986\/\"> https:\/\/habrahabr.ru\/post\/316986\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/cloud.kilograpp.com\/f\/26970d482b\/?dl=1&amp;t=1\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041e\u0431\u0437\u043e\u0440 Swift 3 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0435\u0433\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c. \u0427\u0430\u0441\u0442\u044c 1.<br \/>  \u0420\u0430\u0437\u0432\u0435\u043d\u0447\u0430\u043d\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u0438\u0444\u043e\u0432. \u041c\u043d\u0435\u043d\u0438\u0435 \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 autocompletion \u0432 Xcode.<\/p>\n<p>  <\/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-282090","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282090","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=282090"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282090\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=282090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=282090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}