{"id":298865,"date":"2020-02-18T15:00:15","date_gmt":"2020-02-18T15:00:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=298865"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=298865","title":{"rendered":"\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0442\u0435\u0445.\u0434\u043e\u043b\u0433 \u0441\u0432\u043e\u0435\u043c\u0443 \u042d\u0413\u041e"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/488862\/\">\n<h4>\u041e\u0431\u043e\u0436\u0430\u044e \u0442\u0435\u0441\u0442\u044b! <\/h4>\n<p>  \u0421\u0435\u0440\u044c\u0451\u0437\u043d\u043e. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0430\u044e. \u041e\u043d\u0438 \u043d\u0435\u043e\u0441\u043f\u043e\u0440\u0438\u043c\u043e \u043f\u0440\u0438\u0434\u0430\u044e\u0442 \u043c\u043e\u0435\u043c\u0443 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c\u0443 <i>ios<\/i>-\u043d\u0438\u043a\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f. \u041f\u043e\u0441\u043b\u0435 \u043d\u0438\u0445 \u044f, \u0431\u0443\u0434\u0442\u043e \u0431\u044b, \u043e\u0431\u0440\u0435\u0442\u0430\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043b\u0435\u0442\u0430\u0442\u044c\u2026 <s>, \u043a\u0430\u043a \u0438 \u0442\u043e\u0442 \u0431\u0435\u0434\u043d\u044b\u0439 \u0451\u0436, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043d\u0443\u043b\u0438<\/s>.<br \/>  \u0421\u0442\u043e\u043f, \u0441\u0442\u043e\u043f, \u0441\u0442\u043e\u043f. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0434\u0443\u043c\u0430\u043b\u0438, \u0447\u0442\u043e \u0442\u0435\u0440\u043f\u0435\u0442\u044c \u0444\u0438\u0430\u0441\u043a\u043e \u2014 \u043f\u043e\u0441\u0442\u044b\u0434\u043d\u043e, \u0442\u043e \u043f\u043e\u0432\u0435\u0440\u044c\u0442\u0435, &quot;<i>\u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0441\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f, \u044d\u0442\u043e \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e. \u041f\u0443\u0441\u0442\u044c \u043b\u0443\u0447\u0448\u0435 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0442\u0430\u043a\u0438\u043c\u0438<\/i>&quot; (\u0441) \u043c\u043e\u0439 \u0434\u0440\u0443\u0433 \u2014 \u041f\u0440\u0435\u0437\u0438\u0434\u0435\u043d\u0442 \u0422\u0430\u043c\u0431\u043e\u0432\u0441\u043a\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u043d\u043e\u0439 \u0442\u043e\u0440\u0433\u043e\u0432\u043e-\u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u043b\u0430\u0442\u044b \u0412\u043e\u0440\u043e\u043d\u0438\u043d\u0430 \u0415\u043b\u0435\u043d\u0430 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440\u043e\u0432\u043d\u0430. <br \/>  \u041f\u0440\u0438\u0440\u043e\u0434\u0430 \u0438\u0441\u043f\u044b\u0442\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0432\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u0438 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0442\u0440\u0438\u0443\u043c\u0444\u0430, \u0438 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0444\u0438\u0430\u0441\u043a\u043e<s>, \u0431\u0440\u0430\u0442\u0430\u043d<\/s>. \u0417\u0430\u0442\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u043e \u043f\u043e\u043b\u043a\u0430\u043c \u0432\u0441\u0451 \u0442\u043e, \u0447\u0435\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0434\u043e \u0443\u0441\u043f\u0435\u0445\u0430. <\/p>\n<p>  \u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u0442\u0430\u043a\u043e\u0432\u0430:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5l\/b6\/ol\/5lb6olbr4nyddia_fyl_c_5tjw8.png\"><\/p>\n<p>  \u0414\u0430, \u0434\u0430, \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043c\u0435\u044f\u0442\u044c\u0441\u044f, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0430\u043b\u044c\u0446\u0430\u043c\u0438, \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u043e\u0436\u0438\u0446\u044b \u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0447\u0435\u0435, \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u0435\u043b\u0430\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 <i>iOS<\/i>-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u0410 \u044f \u0432\u043e\u0442 <i><b>bad guy<\/b><\/i>, \u043c\u043d\u0435 <b><u>\u043d\u0443\u0436\u043d\u043e<\/u><\/b> \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c.<a name=\"habracut\"><\/a><\/p>\n<p>  <b>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c<\/b><br \/>  \u0422\u0430\u043a \u043a\u0430\u043a \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u0430\u0445 \u043d\u0435\u0442, \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u0440\u043e\u0439\u0442\u0438 \u0432\u0441\u0451 \u0437\u0430\u043d\u043e\u0432\u043e. <\/p>\n<h3>1 question:<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/sv\/-g\/pa\/sv-gpax61lvzxeuw_4l-iqc3-wg.png\"> <\/p>\n<p>  \u0417\u0430\u0441\u0443\u0447\u0438\u0432\u0430\u0435\u043c \u0440\u0443\u043a\u0430\u0432\u0430\u2026 <br \/>  \u041f\u043b\u0435\u0439\u0433\u0440\u0430\u0443\u043d\u0434 \u2014 \u043d\u0430\u0448\u0435 \u0432\u0441\u0451. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ed\/aj\/42\/edaj42hkpl_w09abzd7t1j_arfo.png\"><\/p>\n<p>  \u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0441 \u044d\u0442\u0438\u043c \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0443\u0442 <br \/>  <i><a href=\"https:\/\/blog.bobthedeveloper.io\/generic-protocols-with-associated-type-7e2b6e079ee2\" rel=\"nofollow\">blog.bobthedeveloper.io\/generic-protocols-with-associated-type-7e2b6e079ee2<\/a><\/i><\/p>\n<p>  \u041f\u0438\u0448\u0435\u043c \u0447\u0442\u043e-\u0442\u043e \u0442\u0438\u043f\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0432\u0438\u0434\u0438\u043c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/at\/3v\/ge\/at3vge1u2gsoen1hqzqfpdok3la.png\"><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"swift\">protocol GenericProtocol {     associatedtype myType     var propertyWithMyType: myType { get set } }  class MyClass: GenericProtocol {     var propertyWithMyType = &quot;BOB&quot; }  let object = MyClass()<\/code><\/pre>\n<p>  \u041e\u0448\u0438\u0431\u043e\u043a \u043d\u0435 \u0432\u044b\u0434\u0430\u0451\u0442. \u0414\u0430, \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u043a\u0430\u0441\u0430\u0435\u043c\u043e <i>typealias<\/i> \u0438 \u0432\u0441\u0451 \u0441\u0432\u0435\u0434\u0451\u0442\u0441\u044f \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u043a\u043e\u0434\u0443:  <\/p>\n<pre><code class=\"swift\">class SomeClass: GenericProtocol {  typealias myType = String  var anyProperty: myType = &quot;Bob&quot; }<\/code><\/pre>\n<p>, \u043d\u043e \u044d\u0442\u043e \u2014 \u0443\u0436\u0435 \u0434\u0435\u0442\u0430\u043b\u0438. <\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043d\u043e\u0432\u0430 \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043e\u0442\u0432\u0435\u0442\u0430\u043c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441. \u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u043e\u043d\u0438 \u0442\u0430\u043a\u043e\u0432\u044b:<\/p>\n<ol>\n<li><i>\u0414\u0430, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435\u0442?<\/i><\/li>\n<li><i>\u041d\u0435\u0442, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0441 associatedtype \u0441 \u0442\u0435\u043c \u0436\u0435 \u043c\u043e\u0442\u0438\u0432\u043e\u043c<\/i><\/li>\n<li><i>\u041d\u0435\u0442, \u0442.\u043a. \u044d\u0442\u043e \u043d\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445<\/i><\/li>\n<li><i>\u0414\u0430, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u0432 <i>NSObject<\/i><\/i><\/li>\n<\/ol>\n<p>  <b><i>\u041d\u0430 \u044d\u0442\u0438 \u043e\u0442\u0432\u0435\u0442\u044b \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u044b:<\/i><\/b><br \/>  1. \u0427\u0442\u043e \u0432 \u0432\u0430\u0448\u0435\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0438 <i>generic protocol<\/i> \u043f\u043e\u043c\u0438\u043c\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 <i>genericType<\/i>-\u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438?<br \/>  2. \u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0437\u0430\u043a\u043b\u044e\u0447\u0451\u043d \u0432 \u0432\u043e\u043f\u0440\u043e\u0441\u0435\u041d\u0430\u0412\u043e\u043f\u0440\u043e\u0441?<br \/>  3. \u0427\u0442\u043e \u0435\u0441\u0442\u044c \u00ab\u043c\u043e\u0442\u0438\u0432 \u0434\u043b\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u0441 <i>associatedtype<\/i>\u00bb? \u042d\u0442\u043e \u0436\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438. \u041c\u043e\u0442\u0438\u0432 <s>\u0434\u043b\u044f \u0443\u0431\u0438\u0439\u0441\u0442\u0432\u0430<\/s> \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a.<\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043e\u0441\u0432\u0435\u0442\u0438\u0442\u044c, <u>\u0447\u0442\u043e \u0436\u0435 \u0442\u0430\u043a\u043e\u0435 \u043e\u0431\u044a\u0435\u043a\u0442-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a <i>NSObject<\/i>?<\/u>.<br \/>  \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b \u043c\u0438\u043c\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u0433\u0434\u0435 \u043d\u0430\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043b\u043e\u043c\u0430\u0435\u0442 \u0433\u043e\u043b\u043e\u0432\u0443 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0440\u0430\u0437\u0443\u043c \u2014 <i><a href=\"https:\/\/twitter.com\/mobileunderhood\/status\/1103205173336436736\" rel=\"nofollow\">twitter.com\/mobileunderhood\/status\/1103205173336436736<\/a><\/i>. \u0417\u0430\u0431\u0430\u0432\u043d\u043e.<\/p>\n<p>  \u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0441\u0430\u043c\u043e\u0435 \u0434\u043e\u0445\u043e\u0434\u0447\u0438\u0432\u043e\u0435 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u0451\u0442 <i>Andr\u00e9 Braga<\/i> \u0432 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0438 <i><a href=\"https:\/\/www.quora.com\/What-is-NSObject-When-do-Swift-developers-need-to-use-NSObject\" rel=\"nofollow\">www.quora.com\/What-is-NSObject-When-do-Swift-developers-need-to-use-NSObject<\/a><\/i> .<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0415\u0433\u043e \u043e\u0442\u0432\u0435\u0442 \u0442\u0443\u0442<\/b><\/p>\n<div class=\"spoiler_text\"><i>The answer to this question is two-pronged. Either you deal with NSObject directly by subclassing (some class that descends from) it, or indirectly when you use dynamic facilities powered by the Objective-C runtime. But what is NSObject?<\/p>\n<p>  It is one of the few root classes in Cocoa (the other immediately coming to mind is NSProxy). This predates Swift by a quarter of a century, mind you \ud83d\ude09 It offers a number of useful features such as a default memory allocation scheme, a default comparison scheme (by memory address, i.e., reference identity or the equivalent of JavaScript\u2019s === operator), and the most important, being a root class it kickstarts the message passing machinery.<\/p>\n<p>  See, Objective-C is a dynamic language by design through the means of its runtime. Method calls are invoked on objects in response to the arrival of a message, but messages can be intercepted, inspected, ignored, modified, forwarded, replaced and whatnot. Their handlers \u2013 the methods \u2013 can also be modified to some extent during runtime (a technique known as swizzling). This flexibility allows building several design patterns with tremendous ease, and also enables some surprising technology such as aspect oriented programming (my GitHub repo has a nice example[1] of this) without the amount of hacking involved in, for example, Aspect-J, that works by manipulating the compiled bytecode.<\/p>\n<p>  On the other hand Swift\u2019s dynamic facilities are opt-in, meaning whatever can be determined statically, is, for speed; but when the flexibility is necessary, you can progressively turn the knob to dynamic.<\/p>\n<p>  But that&#8217;s in theory. In practice, at this point in its evolution Swift doesn&#8217;t have much of a dynamic runtime of its own, rather piggybacking on Objective-C\u2019s (implicitly via adopting some objc runtime mechanism or explicitly via subclassing NSObject) on several occasions to achieve the same functionalities such as indirect method calling via selectors, nib archiving and key-value coding (essential for things we take for granted like wiring outlets and actions in Xibs and Storyboards); late binding, message forwarding, key-value observation (together with KVC this is what makes Core Data magical); method swizzling (essential for aspects which I mentioned before but there are other uses); and of course for basic interoperability such as subclassing anything that inherits from NSObject, of note the whole of UIKit\/AppKit (the basic memory layout of Swift- and NS-Objects is pretty much compatible but not identical; Swift objects have other data such as vtables etc.[2] [this was Way Back Then; I\u2019m not sure whether anyone has dissected the current Swift 3 or 4 layout]). In such situations you are dealing with dynamic objects backed by the Objective-C runtime, not pure Swift objects. And this is a good thing. The Objective-C runtime has been refined for almost 30 years now, and it\u2019s been influential to the point of Aarch64 (the definition of the 64-bit ARM architecture that powers almost every smartphone you can buy today) having a feature whose existence can be traced back directly to it, Top Byte Ignore for tagged pointers[3][4]. Swift is truly standing on the shoulders of a giant.<\/p>\n<p>  So. Until Swift gets to the point of (natively) offering all of those dynamic facilities it can&#8217;t fully replace the Objective-C runtime, at least not for Cocoa development, and the whole point is that it doesn&#8217;t have to. It was carefully crafted to be interoperable and to bring many advantages while doing so. Whatever Swift gains in native dynamic capabilities is to the greater benefit of other platforms where the Objective-C runtime is not implied, such as Linux.<\/p>\n<p>  Some people look down on Objective-C or Swift or both because of this, but I really believe that this is out of ignorance. Tools have no value by themselves, it&#8217;s up to the programmer to extract value from them.<\/p>\n<p>  And when it comes to Computer Science \u201cpurity\u201d is rarely a good thing; unless we dope semiconductors with \u201cimpurities\u201d we can&#8217;t build processors. We employ heuristics to tackle otherwise intractable problems. We represent real numbers with floating point. We compress (moving) images and music by discarding imperceptible details. Same goes with programming environments: some compromises are for the best. In nature purebreds are seldom the fittest for survival \ud83d\ude09<\/i><\/p>\n<p>  Footnotes<br \/>  [1] <a href=\"https:\/\/github.com\/andrebraga\/AOP-for-Objective-C\" rel=\"nofollow\">github.com\/andrebraga\/AOP-for-Objective-C<\/a><br \/>  [2] <a href=\"https:\/\/www.mikeash.com\/pyblog\/friday-qa-2014-07-18-exploring-swift-memory-layout.html\" rel=\"nofollow\">www.mikeash.com\/pyblog\/friday-qa-2014-07-18-exploring-swift-memory-layout.html<\/a><br \/>  [3] <a href=\"http:\/\/nondot.org\/sabre\/Resume.html\" rel=\"nofollow\">nondot.org\/sabre\/Resume.html<\/a><br \/>  [4] <a href=\"https:\/\/developer.arm.com\/docs\/den0024\/latest\/12-the-memory-management-unit\/125-translation-table-configuration\/1251-virtual-address-tagging%20\" rel=\"nofollow\">developer.arm.com\/docs\/den0024\/latest\/12-the-memory-management-unit\/125-translation-table-configuration\/1251-virtual-address-tagging%20<\/a>(https:\/\/developer.arm.com\/docs\/den0024\/latest\/12-the-memory-management-unit\/125-translation-table-configuration\/1251-virtual-address-tagging  <\/div>\n<\/div>\n<p>, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e <b><i>\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043e\u0442 <i>NSObject<\/i>-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e <i>SwiftObject<\/i> \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <i>runtime<\/i>, <i>swizzling<\/i>, \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044e, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438\u2026 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b <i>Objective-C<\/i><\/i><\/b>.<\/p>\n<p>  <b>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u0432\u043e\u043f\u0440\u043e\u0441\u0443<\/b><br \/>  <b>\u041b\u0438\u0447\u043d\u043e \u044f \u043d\u0435 \u0432\u0438\u0436\u0443 \u0441\u0432\u044f\u0437\u043a\u0438 \u043c\u0435\u0436\u0434\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u0438 \u044d\u0442\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u043e\u0442\u0432\u0435\u0442\u0430.<\/b> \u041a\u0441\u0442\u0430\u0442\u0438 \u0433\u043e\u0432\u043e\u0440\u044f, <u>\u043d\u0430\u043f\u043e\u043c\u043d\u044e<\/u>, \u0447\u0442\u043e <u>\u0432 <i>Objective-C<\/i> <i>generic<\/i>-\u043e\u0432 \u043d\u0435\u0442 \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u044b\u0445<\/u>. \u0412 \u043a\u0440\u0430\u0439\u043d\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438\u043c\u0435\u044e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 (\u0434\u0430-\u0434\u0430, \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <i>id<\/i>), \u0447\u0442\u043e \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u00ab\u0430\u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u00bb \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<p>  <b>\u0412\u044b\u0432\u043e\u0434<\/b>: \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0438\u043c\u0435\u043b \u0432\u0432\u0438\u0434\u0443 \u0430\u0432\u0442\u043e\u0440 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043b\u0438\u0431\u043e 1, \u043b\u0438\u0431\u043e 2. \u0415\u0441\u043b\u0438 \u044f \u043d\u0435 \u043f\u0440\u0430\u0432 \u2014 \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439.<\/p>\n<h3>2 question:<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cr\/ga\/ok\/crgaokfjvmjawfx4wzh1jdukkz4.png\"><br \/>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/00\/rd\/vr\/00rdvr18dd8lhpi4otb6krdvdcg.png\"><br \/>  \u0422\u0430\u043a \u0438 \u0435\u0441\u0442\u044c. <\/p>\n<h3>3 question:<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cb\/t6\/gv\/cbt6gvf7ydgwjsqh0mqwdwj4muy.png\"><\/p>\n<p>  \u041f\u0438\u0448\u0435\u043c \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"swift\">protocol SomeProtocol { \/\/ \u0412\u0430\u0440\u0438\u0430\u043d\u0442 1     func some1() }  protocol SomeAnyProtocol: Any {  \/\/ \u0412\u0430\u0440\u0438\u0430\u043d\u0442 2     func some2() }  protocol SomeAnyObjectProtocol: AnyObject {  \/\/ \u0412\u0430\u0440\u0438\u0430\u043d\u0442 3     func some3() }  class SomeClass {     weak var delegate1: SomeProtocol?     weak var delegate2: SomeAnyProtocol?     weak var delegate3: SomeAnyObjectProtocol? }  let some = SomeClass()<\/code><\/pre>\n<p> \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 <i>Any<\/i> \u0438 \u043d\u0435\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u043e\u0442 \u0447\u0435\u0433\u043e-\u043b\u0438\u0431\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430:<br \/>  <b><i>error: &#8216;weak&#8217; must not be applied to non-class-bound &#8216;SomeProtocol&#8217;; consider adding a protocol conformance that has a class bound<\/i><\/b><br \/>  <b>\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u0431\u044b\u043b <i>AnyObject<\/i><\/b>.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0425\u043e\u0440\u043e\u0448\u0435\u0435 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0442\u0443\u0442<\/b><\/p>\n<div class=\"spoiler_text\"><i><a href=\"https:\/\/stackoverflow.com\/questions\/24066304\/how-can-i-make-a-weak-protocol-reference-in-pure-swift-without-objc\" rel=\"nofollow\">stackoverflow.com\/questions\/24066304\/how-can-i-make-a-weak-protocol-reference-in-pure-swift-without-objc<\/a><\/i><\/p>\n<h4>Supplemental Answer<\/h4>\n<p>  <i>I was always confused about whether delegates should be weak or not. Recently I&#8217;ve learned more about delegates and when to use weak references, so let me add some supplemental points here for the sake of future viewers.<\/p>\n<p>   \u2014 The purpose of using the weak keyword is to avoid strong reference cycles (retain cycles). Strong reference cycles happen when two class instances have strong references to each other. Their reference counts never go to zero so they never get deallocated.<br \/>   \u2014 You only need to use weak if the delegate is a class. Swift structs and enums are value types (their values are copied when a new instance is made), not reference types, so they don&#8217;t make strong reference cycles.<br \/>   \u2014 weak references are always optional (otherwise you would used unowned) and always use var (not let) so that the optional can be set to nil when it is deallocated.<br \/>   \u2014 A parent class should naturally have a strong reference to its child classes and thus not use the weak keyword. When a child wants a reference to its parent, though, it should make it a weak reference by using the weak keyword.<br \/>   \u2014 weak should be used when you want a reference to a class that you don&#8217;t own, not just for a child referencing its parent. When two non-hierarchical classes need to reference each other, choose one to be weak. The one you choose depends on the situation. See the answers to this question for more on this.<br \/>  As a general rule, delegates should be marked as weak because most delegates are referencing classes that they do not own. This is definitely true when a child is using a delegate to communicate with a parent. Using a weak reference for the delegate is what the documentation recommends. (But see this, too.)<br \/>  Protocols can be used for both reference types (classes) and value types (structs, enums). So in the likely case that you need to make a delegate weak, you have to make it an object-only protocol. The way to do that is to add AnyObject to the protocol&#8217;s inheritance list. (In the past you did this using the class keyword, but AnyObject is preferred now.)<\/i>  <\/p>\n<pre><code class=\"swift\">protocol MyClassDelegate: AnyObject {     \/\/ ... }  class SomeClass {     weak var delegate: MyClassDelegate? }<\/code><\/pre>\n<p>  <\/p>\n<h4>Further Study<\/h4>\n<p>  <i>Reading the following articles is what helped me to understand this much better. They also discuss related issues like the unowned keyword and the strong reference cycles that happen with closures.<\/p>\n<p>  <a href=\"https:\/\/docs.swift.org\/swift-book\/LanguageGuide\/Protocols.html#ID276\" rel=\"nofollow\">docs.swift.org\/swift-book\/LanguageGuide\/Protocols.html#ID276<\/a><br \/>  <a href=\"https:\/\/developer.apple.com\/library\/ios\/documentation\/Swift\/Conceptual\/Swift_Programming_Language\/AutomaticReferenceCounting.html\" rel=\"nofollow\">developer.apple.com\/library\/ios\/documentation\/Swift\/Conceptual\/Swift_Programming_Language\/AutomaticReferenceCounting.html<\/a><br \/>  <a href=\"http:\/\/krakendev.io\/blog\/weak-and-unowned-references-in-swift\" rel=\"nofollow\">krakendev.io\/blog\/weak-and-unowned-references-in-swift<\/a><br \/>  <a href=\"http:\/\/www.andrewcbancroft.com\/2015\/05\/08\/strong-weak-and-unowned-sorting-out-arc-and-swift\/\" rel=\"nofollow\">www.andrewcbancroft.com\/2015\/05\/08\/strong-weak-and-unowned-sorting-out-arc-and-swift<\/a><\/i><\/p>\n<h4>Related<\/h4>\n<p>  <i><a href=\"https:\/\/stackoverflow.com\/a\/33549729\/3681880\" rel=\"nofollow\">stackoverflow.com\/a\/33549729\/3681880<\/a><br \/>  <a href=\"http:\/\/natashatherobot.com\/ios-weak-delegates-swift\/\" rel=\"nofollow\">natashatherobot.com\/ios-weak-delegates-swift<\/a><br \/>  <a href=\"https:\/\/stackoverflow.com\/questions\/30056526\/swift-delegation-when-to-use-weak-pointer-on-delegate\" rel=\"nofollow\">stackoverflow.com\/questions\/30056526\/swift-delegation-when-to-use-weak-pointer-on-delegate<\/a><\/i>  <\/div>\n<\/div>\n<h3>4 question:<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wv\/cl\/uz\/wvcluz4frans4hsxnqpiviwbozm.png\"><br \/>  \u041f\u043e \u0444\u0430\u043a\u0442\u0443 \u0438\u043c\u0435\u0435\u043c:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pl\/9w\/cf\/pl9wcffclp7c_vieu3rvcumhmdi.png\"><\/p>\n<h3>5 question:<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gv\/iy\/ob\/gviyobc7tiaizmlblfhyghurkqc.png\"><br \/>  \u041b\u0438\u0447\u043d\u043e \u043c\u0435\u043d\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438\u043d\u043e\u0433\u0434\u0430 \u0441\u043c\u0443\u0449\u0430\u044e\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435. <br \/>  \u0412\u043e\u0442, \u0447\u0442\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <i>Apple<\/i> \u043d\u0430 <i>Objective-C<\/i> \u0434\u043b\u044f <i>view<\/i> \u0443 <i>UIViewController<\/i>: <\/p>\n<pre><code class=\"objectivec\">@property(nonatomic, strong) UIView *view;<\/code><\/pre>\n<p> \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435: <br \/>  <i>The view stored in this property represents the root view for the view controller&#8217;\u0080\u0099s view hierarchy. The default value of this property is nil.<br \/>  If you access this property and its value is currently nil, the view controller automatically calls the loadView method and returns the resulting view.<\/i> <br \/>  \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b <i>lazy<\/i> \u0432 <i>Swift<\/i>, \u043e\u0442\u0441\u044e\u0434\u0430 \u0442\u0430\u043a\u043e\u0439 \u0432\u0435\u0440\u0434\u0438\u043a\u0442, \u043d\u043e \u0432\u043e\u043e\u0431\u0449\u0435 <b>\u043e\u0442\u0432\u0435\u0442 \u0434\u0430\u0451\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432 \u0442\u0435\u0441\u0442\u0435 \u2014 \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435.<\/b><\/p>\n<h3>6 question:<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/w3\/m6\/fr\/w3m6frm9dswpi62c1ol7yg3ptye.png\"><br \/>  \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0434\u0430\u043c \u0441\u043a\u0440\u0438\u043d\u043e\u043c \u0441 \u043a\u043e\u0434\u043e\u043c<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wt\/eo\/j7\/wteoj7sciaz19g3wpn3upofpiwa.png\"><\/p>\n<h3>7 question:<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hg\/pt\/oo\/hgptooacpyvewsgj7uoyr1kgs-u.png\"><br \/>  \u0441\u0438\u043b\u0430 <i>defer<\/i> \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u0434\u0430-\u0434\u0430, \u043f\u043e\u0441\u043b\u0435 <i>return<\/i>):<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zi\/qu\/7g\/ziqu7gfiopjekfpmmxs3ked8sq0.png\"><\/p>\n<h3>8 question:<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zz\/9d\/ry\/zz9dryqi22bbcizeb3uxzqqh6em.png\"><br \/>  \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f <i><a href=\"https:\/\/habr.com\/ru\/post\/338766\/\">habr.com\/ru\/post\/338766<\/a><\/i>, \u0441\u043f\u0430\u0441\u0438\u0431\u043e <a href=\"https:\/\/habr.com\/ru\/users\/ifitows\/\" class=\"user_link\">IFITOWS<\/a>. <\/p>\n<h3>9 question:<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/oz\/yu\/97\/ozyu97gj59bivvk_xykqv2nj62o.png\"><br \/>  \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0441 \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xl\/dh\/hq\/xldhhqtex7wjgjoffn7imin80zu.png\"><br \/>  <u>\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u0431\u044b\u043b \u043f\u0435\u0440\u0432\u044b\u0439 \u043e\u0442\u0432\u0435\u0442, \u0430 \u044f \u043f\u043e\u0441\u043f\u0435\u0448\u0438\u043b, \u0433\u043b\u0443\u043f\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430<\/u>. <\/p>\n<h3>10 question:<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_c\/0o\/0p\/_c0o0pqprg-loqx9fcz79pmr23c.png\"><br \/>  \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0432 \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432 <i>XCode<\/i>, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yi\/hx\/f_\/yihxf_ff5bmnapcc-p1crn8lp5m.png\"><br \/>  \u0412\u044b\u0445\u043e\u0434\u0438\u0442, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u0431\u044b\u043b \u0442\u0440\u0435\u0442\u0438\u0439 \u043e\u0442\u0432\u0435\u0442. \u0420\u0430\u043d\u0435\u0435 \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b, \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u0443\u0434\u0443 \u0437\u043d\u0430\u0442\u044c!<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432<\/h3>\n<p>  \u0412\u0441\u0435\u0433\u043e \u0432 \u0442\u0435\u0441\u0442\u0435 \u0431\u044b\u043b\u043e 26 (\u0435\u0441\u043b\u0438 \u043d\u0435 \u043e\u0448\u0438\u0431\u0430\u044e\u0441\u044c) \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. \u0422\u0435\u0441\u0442 \u0434\u043b\u0438\u043b\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u043e\u043b\u0447\u0430\u0441\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u043e\u0441\u0432\u0435\u0442\u0438\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e 10 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c. \u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u043e\u0437\u0434\u043d\u043e \u0438 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u0432\u043e\u0438\u0445 \u0437\u043d\u0430\u043d\u0438\u044f\u0445 \u0431\u044b\u0432\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0439. \u0415\u0441\u043b\u0438 \u043a \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441, \u0442\u043e \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0449\u0435 1-2 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u043c\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c.<\/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\/488862\/\"> https:\/\/habr.com\/ru\/post\/488862\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/488862\/\">\n<h4>\u041e\u0431\u043e\u0436\u0430\u044e \u0442\u0435\u0441\u0442\u044b! <\/h4>\n<p>  \u0421\u0435\u0440\u044c\u0451\u0437\u043d\u043e. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0430\u044e. \u041e\u043d\u0438 \u043d\u0435\u043e\u0441\u043f\u043e\u0440\u0438\u043c\u043e \u043f\u0440\u0438\u0434\u0430\u044e\u0442 \u043c\u043e\u0435\u043c\u0443 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c\u0443 <i>ios<\/i>-\u043d\u0438\u043a\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f. \u041f\u043e\u0441\u043b\u0435 \u043d\u0438\u0445 \u044f, \u0431\u0443\u0434\u0442\u043e \u0431\u044b, \u043e\u0431\u0440\u0435\u0442\u0430\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043b\u0435\u0442\u0430\u0442\u044c\u2026 <s>, \u043a\u0430\u043a \u0438 \u0442\u043e\u0442 \u0431\u0435\u0434\u043d\u044b\u0439 \u0451\u0436, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043d\u0443\u043b\u0438<\/s>.<br \/>  \u0421\u0442\u043e\u043f, \u0441\u0442\u043e\u043f, \u0441\u0442\u043e\u043f. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0434\u0443\u043c\u0430\u043b\u0438, \u0447\u0442\u043e \u0442\u0435\u0440\u043f\u0435\u0442\u044c \u0444\u0438\u0430\u0441\u043a\u043e \u2014 \u043f\u043e\u0441\u0442\u044b\u0434\u043d\u043e, \u0442\u043e \u043f\u043e\u0432\u0435\u0440\u044c\u0442\u0435, &quot;<i>\u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0441\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f, \u044d\u0442\u043e \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e. \u041f\u0443\u0441\u0442\u044c \u043b\u0443\u0447\u0448\u0435 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0442\u0430\u043a\u0438\u043c\u0438<\/i>&quot; (\u0441) \u043c\u043e\u0439 \u0434\u0440\u0443\u0433 \u2014 \u041f\u0440\u0435\u0437\u0438\u0434\u0435\u043d\u0442 \u0422\u0430\u043c\u0431\u043e\u0432\u0441\u043a\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u043d\u043e\u0439 \u0442\u043e\u0440\u0433\u043e\u0432\u043e-\u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u043b\u0430\u0442\u044b \u0412\u043e\u0440\u043e\u043d\u0438\u043d\u0430 \u0415\u043b\u0435\u043d\u0430 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440\u043e\u0432\u043d\u0430. <br \/>  \u041f\u0440\u0438\u0440\u043e\u0434\u0430 \u0438\u0441\u043f\u044b\u0442\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0432\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u0438 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0442\u0440\u0438\u0443\u043c\u0444\u0430, \u0438 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0444\u0438\u0430\u0441\u043a\u043e<s>, \u0431\u0440\u0430\u0442\u0430\u043d<\/s>. \u0417\u0430\u0442\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u043e \u043f\u043e\u043b\u043a\u0430\u043c \u0432\u0441\u0451 \u0442\u043e, \u0447\u0435\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0434\u043e \u0443\u0441\u043f\u0435\u0445\u0430. <\/p>\n<p>  \u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u0442\u0430\u043a\u043e\u0432\u0430:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5l\/b6\/ol\/5lb6olbr4nyddia_fyl_c_5tjw8.png\"><\/p>\n<p>  \u0414\u0430, \u0434\u0430, \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043c\u0435\u044f\u0442\u044c\u0441\u044f, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0430\u043b\u044c\u0446\u0430\u043c\u0438, \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u043e\u0436\u0438\u0446\u044b \u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0447\u0435\u0435, \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u0435\u043b\u0430\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 <i>iOS<\/i>-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u0410 \u044f \u0432\u043e\u0442 <i><b>bad guy<\/b><\/i>, \u043c\u043d\u0435 <b><u>\u043d\u0443\u0436\u043d\u043e<\/u><\/b> \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c.<\/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-298865","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/298865","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=298865"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/298865\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=298865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=298865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=298865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}