{"id":367588,"date":"2024-05-21T03:24:04","date_gmt":"2024-05-21T03:24:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=367588"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T03:24:04","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=367588","title":{"rendered":"<span>\u0423\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u043c boilerplate \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Swift Macros<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0441 \u0432\u0430\u043c\u0438 \u041d\u0438\u043a\u0438\u0442\u0430 \u041a\u043e\u0440\u043e\u0431\u0435\u0439\u043d\u0438\u043a\u043e\u0432, iOS Team Lead \u0432 Surf. \u041d\u0438\u043a\u0438\u0442\u0430 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Swift Macros, \u0441\u0440\u0430\u0432\u043d\u0438\u0442 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0442 Apple \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438: <a href=\"https:\/\/github.com\/Shopify\/liquid\"><u>Liquid<\/u><\/a>, <a href=\"https:\/\/github.com\/strongself\/Generamba\"><u>Generamba<\/u><\/a>, <a href=\"https:\/\/github.com\/krzysztofzablocki\/Sourcery\"><u>Sourcery<\/u><\/a> \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u0442, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 Swift Macros.\u00a0<\/p>\n<p>Apple \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430 <strong>Swift Macros<\/strong> <a href=\"https:\/\/developer.apple.com\/wwdc23\/topics\/swift\/\"><u>\u043d\u0430 WWDC 2023<\/u><\/a>. \u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f \u043e\u0431\u0435\u0449\u0430\u043b\u0430, \u0447\u0442\u043e Swift Macros \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u0435 \u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043e\u043d \u0441\u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c, \u0443\u0431\u0440\u0430\u0442\u044c boilerplate-\u043a\u043e\u0434 \u0438 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.\u00a0<\/p>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, Apple \u0432\u0437\u044f\u043b\u0438 propertyWrapper, \u0441\u043f\u0440\u044f\u0442\u0430\u043b\u0438 \u0432 \u043d\u0435\u0433\u043e \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f Swift-\u043a\u043e\u0434\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0432\u043e\u0434\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ccf\/382\/553\/ccf3825532589a214067c2e146d51618.png\" width=\"2522\" height=\"1438\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ccf\/382\/553\/ccf3825532589a214067c2e146d51618.png\"\/><\/figure>\n<p>\u041f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u2014 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f swift-\u043a\u043e\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 swift-\u043a\u043e\u0434\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u2014 \u0432\u0441\u0435, \u043a\u0430\u043a \u043b\u044e\u0431\u0438\u0442 XZibit. \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0435\u0449\u0451 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0430\u043a\u0440\u043e\u0441\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/491\/37b\/edf\/49137bedfebea522a4827363639db0a0.png\" alt=\"\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: Apple\" title=\"\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: Apple\" width=\"2522\" height=\"872\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/491\/37b\/edf\/49137bedfebea522a4827363639db0a0.png\"\/><\/p>\n<div><figcaption>\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<br \/>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: Apple<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/47f\/d3d\/e65\/47fd3de657592e122d11a5f5082f94df.png\" width=\"2522\" height=\"1438\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/47f\/d3d\/e65\/47fd3de657592e122d11a5f5082f94df.png\"\/><\/figure>\n<p>\u0422\u0438\u043f\u044b \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442, \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u043c\u0430\u043a\u0440\u043e\u0441 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0435\u043d \u043a \u043a\u0430\u043a\u043e\u043c\u0443-\u0442\u043e \u043c\u0435\u0441\u0442\u0443 \u0432 \u043a\u043e\u0434\u0435 \u0438\u043b\u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0435\u0437\u0434\u0435.\u00a0<\/p>\n<p>\u041f\u043e\u0434\u0442\u0438\u043f\u044b \u0438\u043b\u0438 \u0440\u043e\u043b\u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440 \u0438 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0432 swift-\u043a\u043e\u0434. \u041e\u0434\u0438\u043d \u043c\u0430\u043a\u0440\u043e\u0441 \u043c\u043e\u0436\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u043e\u043b\u0435\u0439 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<h3>freestanding (#)<\/h3>\n<p>\u041c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0433\u0434\u0435 \u0443\u0433\u043e\u0434\u043d\u043e: \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430, \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435.\u00a0<\/p>\n<p>\u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043e\u0442\u043e\u0432\u0441\u044e\u0434\u0443.<\/p>\n<h4>\u0420\u043e\u043b\u044c expression<\/h4>\n<p>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442\u044c open-source \u043c\u0430\u043a\u0440\u043e\u0441, \u0434\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0446\u0432\u0435\u0442\u0430.<\/p>\n<pre><code class=\"swift\">\/\/ \u043c\u0430\u043a\u0440\u043e\u0441 let uiColor = #uiColor(\"#ff0055\") \/\/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f let uiColor = UIColor(red: 1.0, green: 0.0, blue: 0.333, alpha: 1.0)<\/code><\/pre>\n<h4>\u0420\u043e\u043b\u044c declaration<\/h4>\n<p>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d3a\/62b\/d73\/d3a62bd73562d231f8b4b8938ff46d22.png\" width=\"2522\" height=\"478\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d3a\/62b\/d73\/d3a62bd73562d231f8b4b8938ff46d22.png\"\/><\/figure>\n<h3>attached (@)<\/h3>\n<p>\u041c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c, \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u0432 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u0430: \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u043b\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<h4>\u0420\u043e\u043b\u044c peer<\/h4>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u2014 \u043f\u043e \u0441\u043e\u0441\u0435\u0434\u0441\u0442\u0432\u0443 \u0441 \u043d\u0438\u043c. <br \/>\u041f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442\u044c open-source \u043c\u0430\u043a\u0440\u043e\u0441 Mockable \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u043a\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u043e\u0432.\u00a0<\/p>\n<pre><code class=\"swift\">@Mockable protocol Test {     func modifyValue(_ value: inout Int) } #if MOCKING final class MockTest: Test, Mockable {     private var mocker = Mocker&lt;MockTest>() \/\/...     func modifyValue(_ value: inout Int) {         let member: Member = .m1_modifyValue(.value(value))         try! mocker.mock(member) { producer in             let producer = try cast(producer) as (Int) -> Void             return producer(value)         }     } \/\/.. }<\/code><\/pre>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e, \u0438 \u043c\u0430\u043a\u0440\u043e\u0441 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u043a-\u043a\u043b\u0430\u0441\u0441 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0441\u0431\u0440\u043e\u0441\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u041e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e.<\/p>\n<h4>\u0420\u043e\u043b\u044c accessor<\/h4>\n<p>\u041f\u043e\u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a didSet, willSet \u0438 \u0434\u0440\u0443\u0433\u0438\u0445.<\/p>\n<h4>\u0420\u043e\u043b\u044c member<\/h4>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0442\u0435\u043b\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441 \u0442\u0430\u043a\u043e\u0439 \u0440\u043e\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e\u043c\u0443 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u043c\u0443 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u0438\u043b\u0434\u0435\u0440\u0443. <br \/>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0441 \u0442\u0430\u043a\u043e\u0439 \u0440\u043e\u043b\u044c\u044e, \u043d\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u043a\u0435\u0441\u043e\u043c, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<h4>\u0420\u043e\u043b\u044c memberAttribute<\/h4>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0443.<\/p>\n<h4>\u0420\u043e\u043b\u044c extension<\/h4>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 (extension) \u043a \u043a\u043b\u0430\u0441\u0441\u0443. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 generic where \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 generic \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 extension.<\/p>\n<h2>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0431\u044b\u043b\u0438 \u043e\u043d\u0438<\/h2>\n<p>\u0414\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f Swift Macros \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0435 \u0441\u0438\u0434\u0435\u043b\u0438 \u0431\u0435\u0437 \u0434\u0435\u043b\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0422\u0430\u043a \u043a\u0430\u043a\u0438\u0435 \u0436\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u044b \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438?<\/p>\n<h3>Liquid<\/h3>\n<p>\u042d\u0442\u043e \u044f\u0437\u044b\u043a \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0434\u043b\u044f Contents.json \u0438\u0437 imageasset<\/p>\n<pre><code class=\"json\">{   \"images\" : [ {   \"filename\" : \"{{ name }}-light.pdf\",   \"idiom\" : \"universal\" }, {   \"appearances\" : [     {       \"appearance\" : \"luminosity\",       \"value\" : \"dark\"     }   ],   \"filename\" : \"{{ name }}-dark.pdf\",   \"idiom\" : \"universal\" }   ],   \"info\" : { \"author\" : \"xcode\", \"version\" : 1   } }<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0438\u043c\u0435\u043d\u0438 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d<\/p>\n<pre><code class=\"ruby\">@template = Liquid::Template.parse(template) palette = @template.render('name' => icon_name) File.write(output_file, palette)<\/code><\/pre>\n<p><em>\u041d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u044b \u0438 \u0441\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438\u0437 \u043c\u0430\u043a\u0435\u0442\u0430 \u0432 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/em><\/p>\n<p>\u041f\u043b\u044e\u0441\u044b:\u00a0<\/p>\n<ul>\n<li>\n<p>\u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u044f\u0437\u044b\u043a\u043e\u043c \u2014\u00a0 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0445\u043e\u0442\u044c Swift, \u0445\u043e\u0442\u044c json;<\/p>\n<\/li>\n<li>\n<p>\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u043b\u0438 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 buildPhases.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u0438\u043d\u0443\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>\u0422\u0440\u0443\u0434\u043d\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<h3>Generamba<\/h3>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043d\u0430\u0434\u0441\u0442\u0440\u043e\u0435\u043a \u043d\u0430\u0434 liquid, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p>\u0412 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440:\u00a0<\/p>\n<ul>\n<li>\n<p>VIPER;<\/p>\n<\/li>\n<li>\n<p>MVP;<\/p>\n<\/li>\n<li>\n<p>MVVM \u0438 \u0434\u0440\u0443\u0433\u0438\u0445;<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0432 Surf \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0432\u043e\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 SurfMVP \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 Geberamba.<\/p>\n<p>\u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u2014 Rambafile \u0438 Rambaspec.<\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<pre><code class=\"yaml\">### Templates templates: - {name: surf_mvp_coordinatable_module} - {name: surf_mvp_coordinatable_alert}<\/code><\/pre>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<pre><code class=\"yaml\">### Presenter layer - {name: Presenter\/Presenter.swift, path: Code\/Presenter\/presenter.swift.liquid} - {name: Presenter\/ModuleInput.swift, path: Code\/Presenter\/module_input.swift.liquid} - {name: Presenter\/ModuleOutput.swift, path: Code\/Presenter\/module_output.swift.liquid}<\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u0432\u044b\u0437\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">bundle exec generamba gen $(modName) surf_mvp_coordinatable_module --module_path 'Flows\/$(flow)' --test_path 'UnitTests\/$(flow)' --custom_parameters flow:'$(flow)'<\/code><\/pre>\n<p>\u041f\u043b\u044e\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>\u0443\u0437\u043a\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439. \u0425\u043e\u0440\u043e\u0448\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0432\u043e\u044e \u0437\u0430\u0434\u0430\u0447\u0443;<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u0438\u043d\u0443\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u043a\u0438\u043d\u0443\u0442\u044c \u0432 Rambafile \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u2014 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d liquid.<\/p>\n<\/li>\n<li>\n<p>\u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u043b\u043e\u0436\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u043d\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b.<\/p>\n<\/li>\n<\/ul>\n<h3>Sourcery<\/h3>\n<p>\u042d\u0442\u043e, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0431\u043b\u0438\u0437\u043a\u0438\u0439 \u043a Swift Macros \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439. \u0410 \u0438\u0445 \u0443\u0436\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c output-\u0444\u0430\u0439\u043b\u0435.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 Sourcery \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044f\u0437\u044b\u043a \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 stencil, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 liquid, \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u044f\u043c\u043e \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0445\u043e\u0434 \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0443\u0441\u043b\u043e\u0432\u0438\u0439.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e AutoMockable. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0435 \u0440\u044f\u0434\u043e\u043c \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430.<\/p>\n<pre><code class=\"swift\">\/\/ sourcery: AutoMockable protocol StrategyDropable { func canDrop(from source: IndexPath, to destination: IndexPath) -> Bool }<\/code><\/pre>\n<p>\u0418 \u0432 \u0444\u0430\u0439\u043b\u0435 AutoMockable.generated.swift \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 mock \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430.<\/p>\n<pre><code class=\"swift\">class StrategyDropableMock: StrategyDropable {  \/\/MARK: - canDrop  var canDropFromToCallsCount = 0 var canDropFromToCalled: Bool {     return canDropFromToCallsCount > 0 } var canDropFromToReceivedArguments: (source: IndexPath, destination: IndexPath)? var canDropFromToReceivedInvocations: [(source: IndexPath, destination: IndexPath)] = [] var canDropFromToReturnValue: Bool! var canDropFromToClosure: ((IndexPath, IndexPath) -> Bool)?  func canDrop(from source: IndexPath, to destination: IndexPath) -> Bool {         canDropFromToCallsCount += 1         canDropFromToReceivedArguments = (source: source, destination: destination)         canDropFromToReceivedInvocations.append((source: source, destination: destination))         if let canDropFromToClosure = canDropFromToClosure {             return canDropFromToClosure(source, destination)         } else {         return canDropFromToReturnValue         } }  }<\/code><\/pre>\n<p>\u041f\u043b\u044e\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430 Swift;<\/p>\n<\/li>\n<li>\n<p>\u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u0435 (\u0447\u0435\u043c \u0432 liquid) \u0448\u0430\u0431\u043b\u043e\u043d\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u0438\u043d\u0443\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>\u0444\u0430\u0439\u043b \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u043c.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u0430\u043a\u0438\u0435 \u0431\u044b\u0432\u0430\u044e\u0442 \u043c\u0430\u043a\u0440\u043e\u0441\u044b<\/h2>\n<h3>Open-source \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043b\u043e \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e open source \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u0430\u043a SPM \u043f\u0430\u043a\u0435\u0442 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0418\u043b\u0438 \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u044f.<br \/><a href=\"https:\/\/github.com\/krzysztofzablocki\/Swift-Macros\"><u>\u0422\u0443\u0442<\/u><\/a> \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0438 \u043d\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u0434\u043b\u044f \u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u044b. \u0410 \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430.<\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430\u00a0<\/h3>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430<\/strong>: \u0435\u0441\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 (var) \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c mutating func \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"swift\">\/\/ \u0434\u0430\u043d\u043e struct SomeStruct {     let id: String = \"\"     var someVar: Bool = false }<\/code><\/pre>\n<pre><code class=\"swift\">\/\/ \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c struct SomeStruct {     let id: String = \"\"     var someVar: Bool = false      mutating func set(someVar: Bool) {        self.someVar = someVar     } }<\/code><\/pre>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u043f\u043e \u043c\u0435\u0440\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0432\u044b\u0448\u0430\u0442\u044c\u0441\u044f.\u00a0<\/p>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c \u0441 \u0438\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0442\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0435\u043b\u0438\u043a \u0441\u043e\u0431\u043b\u0430\u0437\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0443 \u0438 \u043d\u0430\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u043e \u043d\u0435\u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u0441\u0442\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043c\u0443\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0435\u043c\u0441\u044f \u043a\u043e\u0434\u0435, \u043f\u043e\u0440\u043e\u0436\u0434\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c.<\/p>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0430\u043a\u0440\u043e\u0441<\/strong>\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6ca\/e0c\/9ed\/6cae0c9ed6a2d3cc9d42e565413f5cf2.png\" alt=\"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u0434\u043b\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430\" title=\"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u0434\u043b\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430\" width=\"2522\" height=\"1438\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6ca\/e0c\/9ed\/6cae0c9ed6a2d3cc9d42e565413f5cf2.png\"\/><\/p>\n<div><figcaption>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u0434\u043b\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430<\/figcaption><\/div>\n<\/figure>\n<p>Xcode \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 SPM \u0442\u0430\u0440\u0433\u0435\u0442 \u0441 \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u043e\u0439 \u043f\u043e\u0434:<\/p>\n<ul>\n<li>\n<p>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u2014 <em>{target-name}Definition.swift;<\/em><\/p>\n<\/li>\n<li>\n<p>\u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u2014 <em>{target-name}Plugin.swift;<\/em><\/p>\n<\/li>\n<li>\n<p>\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 <em>{macros-name}MacroTests.swift;<\/em><\/p>\n<\/li>\n<li>\n<p>\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u2014 <em>{macros-name}Macro.swift;<\/em><\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u043b\u0430\u0434\u043a\u0443 \u2014 <em>main.swift \u2014 <\/em>\u043d\u0430\u0448\u0438\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0442\u0438\u043f\u0430 \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0438 \u0441\u0432\u044f\u0437\u044c\u044e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u0438 \u0444\u0430\u0439\u043b\u043e\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"swift\">\/\/ MacroDefinition.swift @attached(member, names: named(set)) public macro Mutable() = #externalMacro(module: \"Macros\", type: \"MutableMacro\")<\/code><\/pre>\n<p>\u0424\u0430\u0439\u043b <em>{target-name}Plugin.swift <\/em>\u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432\u043d\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0430\u0440\u0433\u0435\u0442\u0430.<\/p>\n<pre><code class=\"swift\">\/\/ MacroPlugin.swift import SwiftCompilerPlugin import SwiftSyntaxMacros  @main struct MacroPlugin: CompilerPlugin {     let providingMacros: [Macro.Type] = [     MutableMacro.self,     BuildableMacro.self     ] }<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0448 \u043c\u0430\u043a\u0440\u043e\u0441 \u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u0442\u0435\u0441\u0442\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u043e\u0434\u043d\u043e\u0439 \u043b\u0438\u0448\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u043a\u043e\u0439: \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430.<\/p>\n<pre><code class=\"swift\">\/\/ MutableMacroTests.swift import SwiftSyntaxMacros import SwiftSyntaxMacrosTestSupport import XCTest import Macros  final class MutableMacroTests: XCTestCase {      let testMacros: [String: Macro.Type] = [     \"Mutable\": MutableMacro.self     ]      func testExpansionSucceded_whenAppliedToStruct_withVariablesAndType() {     assertMacroExpansion(         \"\"\"         @Mutable         struct SomeStruct {             let id: String = \"\"             var someVar: Bool = false         }         \"\"\",         expandedSource:         \"\"\"          struct SomeStruct {             let id: String = \"\"             var someVar: Bool = false              mutating func set(someVar: Bool) {                     self.someVar = someVar             }         }         \"\"\",         macros: testMacros     )     }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043d\u0435\u0437\u0430\u0442\u0435\u0439\u043b\u0438\u0432\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u2014 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0440\u043e\u0439\u043d\u044b\u0445 \u043a\u0430\u0432\u044b\u0447\u0435\u043a \u2014 \u043c\u0430\u043a\u0440\u043e\u0441 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430\u0434\u0435\u0436\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443.\u00a0<\/p>\n<p>\u0411\u0443\u0434\u044c\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b \u043a \u0442\u0430\u0431\u0443\u043b\u044f\u0446\u0438\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u0442\u0435\u043b\u0430, \u0438\u0431\u043e \u0442\u0435\u0441\u0442 \u043e\u0447\u0435\u043d\u044c \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u0435\u043d \u043a \u044d\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u00ab\u043f\u0430\u0434\u0435\u043d\u0438\u044f\u00bb.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0439 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0436\u0438\u0434\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0435, \u0430 \u043d\u0435 \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435.\u00a0<\/p>\n<pre><code class=\"swift\">func testExpansionFailed_whenAppliedTo_nonStruct() {     assertMacroExpansion(         \"\"\"         @Mutable         class SomeStruct {             let id: String = \"\"             var someVar: Bool = false         }         \"\"\",         expandedSource:         \"\"\"          class SomeStruct {             let id: String = \"\"             var someVar: Bool = false         }         \"\"\",         diagnostics: [             .init(message: \"onlyApplicableToStruct\",                   line: 1,                   column: 1)         ],         macros: testMacros     ) }<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 mutating \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430. <\/p>\n<p>\u0422\u0435\u0441\u0442\u044b \u0433\u043e\u0442\u043e\u0432\u044b, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <strong>Swift Syntax,<\/strong> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u044b, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 D<strong>SL (<em>domain specific language<\/em>), <\/strong>\u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0433\u043e Swift-\u043a\u043e\u0434\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430\u0448 \u043a\u043e\u0434 \u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438 \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u0434. \u0422\u0430\u043a \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,<\/p>\n<ul>\n<li>\n<p>\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 = StructDeclSyntax<\/p>\n<\/li>\n<li>\n<p>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f = VariableDeclSyntax<\/p>\n<\/li>\n<\/ul>\n<p>\u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043b\u0430\u0441\u0441\u043e\u0432.\u00a0<\/p>\n<p>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u0435\u043d.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c extension \u0434\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u2014 \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435.<\/p>\n<pre><code class=\"swift\">\/\/ \u043f\u043e\u0438\u0441\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b extension StructDeclSyntax {     var variables: [VariableDeclSyntax] {     return memberBlock.members         .compactMap { $0.decl.as(VariableDeclSyntax.self) }         .filter { $0.bindingKeyword.text == \"var\" }     } }<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043b\u0438\u0448\u043d\u0438\u0435.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e extension, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u043e \u043a\u0440\u0430\u0441\u043e\u0442\u0435.<\/p>\n<pre><code class=\"swift\">\/\/ \u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u0438 \u0438 \u0442\u0438\u043f\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 extension VariableDeclSyntax {      func parseNameAndType() throws -> (name: TokenSyntax, type: TypeSyntax)? {     guard let variableBinding = bindings.first,           let variableType = variableBinding.typeAnnotation?.type.trimmed else {         let variableName = bindings.first?.pattern.trimmedDescription         throw MacroError.typeAnnotationRequiredFor(variableName: variableName ?? \"unknown\")     }      let variableName = TokenSyntax(stringLiteral: variableBinding.pattern.description)          return (name: variableName, type: variableType)     }  }<\/code><\/pre>\n<p>\u0418 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 \u0442\u0435\u043b\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<pre><code class=\"swift\">\/\/ \u0424\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 mutating func \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 private extension MutableMacro {       static func prepareEditorDeclarations(for variables: [VariableDeclSyntax]) throws -> [FunctionDeclSyntax] {     try variables.compactMap { variableDecl -> FunctionDeclSyntax? in          guard let variable = try variableDecl.parseNameAndType() else {             return nil         }          return FunctionDeclSyntax(leadingTrivia: .newlines(2),                                   modifiers: .init(itemsBuilder: {             DeclModifierSyntax(name: .keyword(.mutating))         }),                                   identifier: .identifier(\"set\"),                                   signature: .init(input: .init(parameterListBuilder: {             FunctionParameterSyntax(firstName: variable.name,                                     type: variable.type)                      })),                                   body: .init(statementsBuilder: {             ExprSyntax(stringLiteral: \"self.\\(variable.name.text)=\\(variable.name.text)\")         })         )     }     }  }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f.<\/p>\n<pre><code class=\"swift\">\/\/ MutableMacro.swift import SwiftSyntax import SwiftSyntaxBuilder import SwiftSyntaxMacros  \/\/\/ A macro which generates `mutating func` for all variables inside a struct. public struct MutableMacro: MemberMacro {       public static func expansion(of node: SwiftSyntax.AttributeSyntax, providingMembersOf declaration: some SwiftSyntax.DeclGroupSyntax, in context: some SwiftSyntaxMacros.MacroExpansionContext) throws -> [SwiftSyntax.DeclSyntax] {     guard let baseStruct = declaration.as(StructDeclSyntax.self) else {         throw MacroError.onlyApplicableToStruct     }      let variables = baseStruct.variables      let functions = try prepareEditorDeclarations(for: variables)      return functions.compactMap { $0.as(DeclSyntax.self) }     }  }<\/code><\/pre>\n<p>\u041e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b <strong>Member Macro<\/strong>. \u041e\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0434\u0442\u0438\u043f\u0443 attached-\u043c\u0430\u043a\u0440\u043e\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u0430.\u00a0<\/p>\n<p>\u0412 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u0442\u0438\u043f\u043e\u0432. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432 \u0442\u0435\u043b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u0441 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 expansion \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0443\u0437\u043b\u0430\u043c\u0438 (node).<\/p>\n<h4>\u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u0433\u0430\u0439\u0434 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043c\u0430\u043a\u0440\u043e\u0441\u0430<\/h4>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 Swift Macros.<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0432 <em>*Definition.swift.<\/em><\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0432 <em>*Plugin.swift.<\/em><\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u0434\u043b\u044f \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043b\u0430\u0434\u043a\u0430 \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0432 <em>main.swift.<\/em><\/p>\n<\/li>\n<\/ol>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 Swift Macros \u2014 \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u0448\u0430\u0433 \u0432 \u0441\u0432\u0435\u0442\u043b\u043e\u0435 \u0431\u0443\u0434\u0443\u0449\u0435\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043b\u044e\u0431\u0430\u044f \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u2014 Swift, \u0431\u0443\u0434\u044c \u0442\u043e \u0432\u0435\u0440\u0441\u0442\u043a\u0430, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u043c\u0438, \u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438\u043b\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430.\u00a0<\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0434\u0430 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e legacy-\u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 (liquid, sourcery \u0438 \u0434\u0440\u0443\u0433\u0438\u0435). \u041d\u0435 \u0432\u0441\u0435 \u043a\u0435\u0439\u0441\u044b \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Swift Macros.<\/p>\n<p>\u041c\u044b \u0431\u044b\u043b\u0438 \u0440\u0430\u0434\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Swift Macros. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0435 \u2014 \u043c\u0438\u043b\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u0438\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438!<\/p>\n<blockquote>\n<p>\u0411\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u043f\u0440\u043e iOS \u2014 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b\u0435 Surf iOS Team. \u041f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u043c \u043a\u0435\u0439\u0441\u044b, \u043b\u0443\u0447\u0448\u0438\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438, \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u0438 \u0432\u0430\u043a\u0430\u043d\u0441\u0438\u0438 Surf.\u00a0<a href=\"https:\/\/t.me\/+HOm8pht0seI5ZTQy\"><strong>\u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c>><\/strong><\/a><\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/792062\/\"> https:\/\/habr.com\/ru\/articles\/792062\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0441 \u0432\u0430\u043c\u0438 \u041d\u0438\u043a\u0438\u0442\u0430 \u041a\u043e\u0440\u043e\u0431\u0435\u0439\u043d\u0438\u043a\u043e\u0432, iOS Team Lead \u0432 Surf. \u041d\u0438\u043a\u0438\u0442\u0430 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Swift Macros, \u0441\u0440\u0430\u0432\u043d\u0438\u0442 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0442 Apple \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438: <a href=\"https:\/\/github.com\/Shopify\/liquid\"><u>Liquid<\/u><\/a>, <a href=\"https:\/\/github.com\/strongself\/Generamba\"><u>Generamba<\/u><\/a>, <a href=\"https:\/\/github.com\/krzysztofzablocki\/Sourcery\"><u>Sourcery<\/u><\/a> \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u0442, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 Swift Macros.\u00a0<\/p>\n<p>Apple \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430 <strong>Swift Macros<\/strong> <a href=\"https:\/\/developer.apple.com\/wwdc23\/topics\/swift\/\"><u>\u043d\u0430 WWDC 2023<\/u><\/a>. \u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f \u043e\u0431\u0435\u0449\u0430\u043b\u0430, \u0447\u0442\u043e Swift Macros \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u0435 \u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043e\u043d \u0441\u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c, \u0443\u0431\u0440\u0430\u0442\u044c boilerplate-\u043a\u043e\u0434 \u0438 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.\u00a0<\/p>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, Apple \u0432\u0437\u044f\u043b\u0438 propertyWrapper, \u0441\u043f\u0440\u044f\u0442\u0430\u043b\u0438 \u0432 \u043d\u0435\u0433\u043e \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f Swift-\u043a\u043e\u0434\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0432\u043e\u0434\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u2014 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f swift-\u043a\u043e\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 swift-\u043a\u043e\u0434\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u2014 \u0432\u0441\u0435, \u043a\u0430\u043a \u043b\u044e\u0431\u0438\u0442 XZibit. \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0435\u0449\u0451 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0430\u043a\u0440\u043e\u0441\u0430.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<br \/>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: Apple<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0438\u043f\u044b \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442, \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u043c\u0430\u043a\u0440\u043e\u0441 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0435\u043d \u043a \u043a\u0430\u043a\u043e\u043c\u0443-\u0442\u043e \u043c\u0435\u0441\u0442\u0443 \u0432 \u043a\u043e\u0434\u0435 \u0438\u043b\u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0435\u0437\u0434\u0435.\u00a0<\/p>\n<p>\u041f\u043e\u0434\u0442\u0438\u043f\u044b \u0438\u043b\u0438 \u0440\u043e\u043b\u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440 \u0438 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0432 swift-\u043a\u043e\u0434. \u041e\u0434\u0438\u043d \u043c\u0430\u043a\u0440\u043e\u0441 \u043c\u043e\u0436\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u043e\u043b\u0435\u0439 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<h3>freestanding (#)<\/h3>\n<p>\u041c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0433\u0434\u0435 \u0443\u0433\u043e\u0434\u043d\u043e: \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430, \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435.\u00a0<\/p>\n<p>\u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043e\u0442\u043e\u0432\u0441\u044e\u0434\u0443.<\/p>\n<h4>\u0420\u043e\u043b\u044c expression<\/h4>\n<p>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442\u044c open-source \u043c\u0430\u043a\u0440\u043e\u0441, \u0434\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0446\u0432\u0435\u0442\u0430.<\/p>\n<pre><code class=\"swift\">\/\/ \u043c\u0430\u043a\u0440\u043e\u0441 let uiColor = #uiColor(\"#ff0055\") \/\/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f let uiColor = UIColor(red: 1.0, green: 0.0, blue: 0.333, alpha: 1.0)<\/code><\/pre>\n<h4>\u0420\u043e\u043b\u044c declaration<\/h4>\n<p>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>attached (@)<\/h3>\n<p>\u041c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c, \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u0432 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u0430: \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u043b\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<h4>\u0420\u043e\u043b\u044c peer<\/h4>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u2014 \u043f\u043e \u0441\u043e\u0441\u0435\u0434\u0441\u0442\u0432\u0443 \u0441 \u043d\u0438\u043c. <br \/>\u041f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442\u044c open-source \u043c\u0430\u043a\u0440\u043e\u0441 Mockable \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u043a\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u043e\u0432.\u00a0<\/p>\n<pre><code class=\"swift\">@Mockable protocol Test {     func modifyValue(_ value: inout Int) } #if MOCKING final class MockTest: Test, Mockable {     private var mocker = Mocker&lt;MockTest>() \/\/...     func modifyValue(_ value: inout Int) {         let member: Member = .m1_modifyValue(.value(value))         try! mocker.mock(member) { producer in             let producer = try cast(producer) as (Int) -> Void             return producer(value)         }     } \/\/.. }<\/code><\/pre>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e, \u0438 \u043c\u0430\u043a\u0440\u043e\u0441 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u043a-\u043a\u043b\u0430\u0441\u0441 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0441\u0431\u0440\u043e\u0441\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u041e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e.<\/p>\n<h4>\u0420\u043e\u043b\u044c accessor<\/h4>\n<p>\u041f\u043e\u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a didSet, willSet \u0438 \u0434\u0440\u0443\u0433\u0438\u0445.<\/p>\n<h4>\u0420\u043e\u043b\u044c member<\/h4>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0442\u0435\u043b\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441 \u0442\u0430\u043a\u043e\u0439 \u0440\u043e\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e\u043c\u0443 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u043c\u0443 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u0438\u043b\u0434\u0435\u0440\u0443. <br \/>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0441 \u0442\u0430\u043a\u043e\u0439 \u0440\u043e\u043b\u044c\u044e, \u043d\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u043a\u0435\u0441\u043e\u043c, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<h4>\u0420\u043e\u043b\u044c memberAttribute<\/h4>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0443.<\/p>\n<h4>\u0420\u043e\u043b\u044c extension<\/h4>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 (extension) \u043a \u043a\u043b\u0430\u0441\u0441\u0443. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 generic where \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 generic \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 extension.<\/p>\n<h2>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0431\u044b\u043b\u0438 \u043e\u043d\u0438<\/h2>\n<p>\u0414\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f Swift Macros \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0435 \u0441\u0438\u0434\u0435\u043b\u0438 \u0431\u0435\u0437 \u0434\u0435\u043b\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0422\u0430\u043a \u043a\u0430\u043a\u0438\u0435 \u0436\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u044b \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438?<\/p>\n<h3>Liquid<\/h3>\n<p>\u042d\u0442\u043e \u044f\u0437\u044b\u043a \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0434\u043b\u044f Contents.json \u0438\u0437 imageasset<\/p>\n<pre><code class=\"json\">{   \"images\" : [ {   \"filename\" : \"{{ name }}-light.pdf\",   \"idiom\" : \"universal\" }, {   \"appearances\" : [     {       \"appearance\" : \"luminosity\",       \"value\" : \"dark\"     }   ],   \"filename\" : \"{{ name }}-dark.pdf\",   \"idiom\" : \"universal\" }   ],   \"info\" : { \"author\" : \"xcode\", \"version\" : 1   } }<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0438\u043c\u0435\u043d\u0438 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d<\/p>\n<pre><code class=\"ruby\">@template = Liquid::Template.parse(template) palette = @template.render('name' => icon_name) File.write(output_file, palette)<\/code><\/pre>\n<p><em>\u041d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u044b \u0438 \u0441\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438\u0437 \u043c\u0430\u043a\u0435\u0442\u0430 \u0432 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/em><\/p>\n<p>\u041f\u043b\u044e\u0441\u044b:\u00a0<\/p>\n<ul>\n<li>\n<p>\u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u044f\u0437\u044b\u043a\u043e\u043c \u2014\u00a0 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0445\u043e\u0442\u044c Swift, \u0445\u043e\u0442\u044c json;<\/p>\n<\/li>\n<li>\n<p>\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u043b\u0438 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 buildPhases.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u0438\u043d\u0443\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>\u0422\u0440\u0443\u0434\u043d\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<h3>Generamba<\/h3>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043d\u0430\u0434\u0441\u0442\u0440\u043e\u0435\u043a \u043d\u0430\u0434 liquid, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p>\u0412 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440:\u00a0<\/p>\n<ul>\n<li>\n<p>VIPER;<\/p>\n<\/li>\n<li>\n<p>MVP;<\/p>\n<\/li>\n<li>\n<p>MVVM \u0438 \u0434\u0440\u0443\u0433\u0438\u0445;<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0432 Surf \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0432\u043e\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 SurfMVP \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 Geberamba.<\/p>\n<p>\u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u2014 Rambafile \u0438 Rambaspec.<\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<pre><code class=\"yaml\">### Templates templates: - {name: surf_mvp_coordinatable_module} - {name: surf_mvp_coordinatable_alert}<\/code><\/pre>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<pre><code class=\"yaml\">### Presenter layer - {name: Presenter\/Presenter.swift, path: Code\/Presenter\/presenter.swift.liquid} - {name: Presenter\/ModuleInput.swift, path: Code\/Presenter\/module_input.swift.liquid} - {name: Presenter\/ModuleOutput.swift, path: Code\/Presenter\/module_output.swift.liquid}<\/code><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u0432\u044b\u0437\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">bundle exec generamba gen $(modName) surf_mvp_coordinatable_module --module_path 'Flows\/$(flow)' --test_path 'UnitTests\/$(flow)' --custom_parameters flow:'$(flow)'<\/code><\/pre>\n<p>\u041f\u043b\u044e\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>\u0443\u0437\u043a\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439. \u0425\u043e\u0440\u043e\u0448\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0432\u043e\u044e \u0437\u0430\u0434\u0430\u0447\u0443;<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u0438\u043d\u0443\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u043a\u0438\u043d\u0443\u0442\u044c \u0432 Rambafile \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u2014 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d liquid.<\/p>\n<\/li>\n<li>\n<p>\u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u043b\u043e\u0436\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u043d\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b.<\/p>\n<\/li>\n<\/ul>\n<h3>Sourcery<\/h3>\n<p>\u042d\u0442\u043e, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0431\u043b\u0438\u0437\u043a\u0438\u0439 \u043a Swift Macros \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439. \u0410 \u0438\u0445 \u0443\u0436\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c output-\u0444\u0430\u0439\u043b\u0435.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 Sourcery \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044f\u0437\u044b\u043a \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 stencil, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 liquid, \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u044f\u043c\u043e \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0445\u043e\u0434 \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0443\u0441\u043b\u043e\u0432\u0438\u0439.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e AutoMockable. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0435 \u0440\u044f\u0434\u043e\u043c \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430.<\/p>\n<pre><code class=\"swift\">\/\/ sourcery: AutoMockable protocol StrategyDropable { func canDrop(from source: IndexPath, to destination: IndexPath) -> Bool }<\/code><\/pre>\n<p>\u0418 \u0432 \u0444\u0430\u0439\u043b\u0435 AutoMockable.generated.swift \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 mock \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430.<\/p>\n<pre><code class=\"swift\">class StrategyDropableMock: StrategyDropable {  \/\/MARK: - canDrop  var canDropFromToCallsCount = 0 var canDropFromToCalled: Bool {     return canDropFromToCallsCount > 0 } var canDropFromToReceivedArguments: (source: IndexPath, destination: IndexPath)? var canDropFromToReceivedInvocations: [(source: IndexPath, destination: IndexPath)] = [] var canDropFromToReturnValue: Bool! var canDropFromToClosure: ((IndexPath, IndexPath) -> Bool)?  func canDrop(from source: IndexPath, to destination: IndexPath) -> Bool {         canDropFromToCallsCount += 1         canDropFromToReceivedArguments = (source: source, destination: destination)         canDropFromToReceivedInvocations.append((source: source, destination: destination))         if let canDropFromToClosure = canDropFromToClosure {             return canDropFromToClosure(source, destination)         } else {         return canDropFromToReturnValue         } }  }<\/code><\/pre>\n<p>\u041f\u043b\u044e\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430 Swift;<\/p>\n<\/li>\n<li>\n<p>\u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u0435 (\u0447\u0435\u043c \u0432 liquid) \u0448\u0430\u0431\u043b\u043e\u043d\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u0438\u043d\u0443\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>\u0444\u0430\u0439\u043b \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u043c.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u0430\u043a\u0438\u0435 \u0431\u044b\u0432\u0430\u044e\u0442 \u043c\u0430\u043a\u0440\u043e\u0441\u044b<\/h2>\n<h3>Open-source \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043b\u043e \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e open source \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u0430\u043a SPM \u043f\u0430\u043a\u0435\u0442 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0418\u043b\u0438 \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u044f.<br \/><a href=\"https:\/\/github.com\/krzysztofzablocki\/Swift-Macros\"><u>\u0422\u0443\u0442<\/u><\/a> \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0438 \u043d\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u0434\u043b\u044f \u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u044b. \u0410 \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430.<\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430\u00a0<\/h3>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430<\/strong>: \u0435\u0441\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 (var) \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c mutating func \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"swift\">\/\/ \u0434\u0430\u043d\u043e struct SomeStruct {     let id: String = \"\"     var someVar: Bool = false }<\/code><\/pre>\n<pre><code class=\"swift\">\/\/ \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c struct SomeStruct {     let id: String = \"\"     var someVar: Bool = false      mutating func set(someVar: Bool) {        self.someVar = someVar     } }<\/code><\/pre>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u043f\u043e \u043c\u0435\u0440\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0432\u044b\u0448\u0430\u0442\u044c\u0441\u044f.\u00a0<\/p>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c \u0441 \u0438\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0442\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0435\u043b\u0438\u043a \u0441\u043e\u0431\u043b\u0430\u0437\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0443 \u0438 \u043d\u0430\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u043e \u043d\u0435\u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u0441\u0442\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043c\u0443\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0435\u043c\u0441\u044f \u043a\u043e\u0434\u0435, \u043f\u043e\u0440\u043e\u0436\u0434\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c.<\/p>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0430\u043a\u0440\u043e\u0441<\/strong>\u00a0<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u0434\u043b\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430<\/figcaption><\/div>\n<\/figure>\n<p>Xcode \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 SPM \u0442\u0430\u0440\u0433\u0435\u0442 \u0441 \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u043e\u0439 \u043f\u043e\u0434:<\/p>\n<ul>\n<li>\n<p>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u2014 <em>{target-name}Definition.swift;<\/em><\/p>\n<\/li>\n<li>\n<p>\u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u2014 <em>{target-name}Plugin.swift;<\/em><\/p>\n<\/li>\n<li>\n<p>\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 <em>{macros-name}MacroTests.swift;<\/em><\/p>\n<\/li>\n<li>\n<p>\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u2014 <em>{macros-name}Macro.swift;<\/em><\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u043b\u0430\u0434\u043a\u0443 \u2014 <em>main.swift \u2014 <\/em>\u043d\u0430\u0448\u0438\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0442\u0438\u043f\u0430 \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0438 \u0441\u0432\u044f\u0437\u044c\u044e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u0438 \u0444\u0430\u0439\u043b\u043e\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"swift\">\/\/ MacroDefinition.swift @attached(member, names: named(set)) public macro Mutable() = #externalMacro(module: \"Macros\", type: \"MutableMacro\")<\/code><\/pre>\n<p>\u0424\u0430\u0439\u043b <em>{target-name}Plugin.swift <\/em>\u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432\u043d\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0430\u0440\u0433\u0435\u0442\u0430.<\/p>\n<pre><code class=\"swift\">\/\/ MacroPlugin.swift import SwiftCompilerPlugin import SwiftSyntaxMacros  @main struct MacroPlugin: CompilerPlugin {     let providingMacros: [Macro.Type] = [     MutableMacro.self,     BuildableMacro.self     ] }<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0448 \u043c\u0430\u043a\u0440\u043e\u0441 \u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u0442\u0435\u0441\u0442\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u043e\u0434\u043d\u043e\u0439 \u043b\u0438\u0448\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u043a\u043e\u0439: \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430.<\/p>\n<pre><code class=\"swift\">\/\/ MutableMacroTests.swift import SwiftSyntaxMacros import SwiftSyntaxMacrosTestSupport import XCTest import Macros  final class MutableMacroTests: XCTestCase {      let testMacros: [String: Macro.Type] = [     \"Mutable\": MutableMacro.self     ]<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-367588","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/367588","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=367588"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/367588\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=367588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=367588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=367588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}