{"id":16492,"date":"2025-01-22T17:00:09","date_gmt":"2025-01-22T17:00:09","guid":{"rendered":"https:\/\/bestkora.com\/IosDeveloper\/?p=16492"},"modified":"2025-01-25T13:44:14","modified_gmt":"2025-01-25T13:44:14","slug":"%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7","status":"publish","type":"post","link":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/","title":{"rendered":"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c: \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u042d\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438<a href=\"https:\/\/www.massicotte.org\/step-by-step-stateful-systems\" title=\"\"> <strong>Concurrency Step-by-Step: Stateful Systems<\/strong><\/a><\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 <a href=\"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b5%d1%82%d0%b5%d0%b2%d0%be%d0%b9-%d0%b7%d0%b0\/\" title=\"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c:\u00a0 \u0421\u0435\u0442\u0435\u0432\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\">\u043f\u0435\u0440\u0432\u043e\u043c<\/a> \u0438 \u0432\u043e <a href=\"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%87%d1%82%d0%b5%d0%bd%d0%b8%d0%b5-%d0%b8%d0%b7-%d1%85%d1%80\/\" title=\"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c: \u0427\u0442\u0435\u043d\u0438\u0435 \u0438\u0437 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\">\u0432\u0442\u043e\u0440\u043e\u043c <\/a>\u043f\u043e\u0441\u0442\u0430\u0445 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447! \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0438\u0448\u0443\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f &#171;\u043f\u043e \u0441\u0430\u043c\u044b\u0435 \u0443\u0448\u0438&#187; \u0432 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.<br><br>\u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 SwiftUI, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c, \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u043c \u043d\u0430 (\u043c\u043d\u0438\u043c\u043e\u0439) \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u0443\u0436\u0431\u0435.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u041a\u0440\u0430\u0442\u043a\u0438\u0435 \u0437\u0430\u043c\u0435\u0442\u043a\u0438<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041a\u0430\u043a \u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u043e\u0441\u0442\u0430\u0445 \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438, \u044f \u0431\u0443\u0434\u0443 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c <strong>Xcode 16<\/strong>. \u042f \u0442\u0430\u043a\u0436\u0435 \u043e\u0441\u0442\u0430\u044e\u0441\u044c \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u043c \u0432 SwiftUI, \u0430 \u0437\u0434\u0435\u0441\u044c \u0431\u043e\u043b\u044c\u0448\u0435 SwiftUI, \u0447\u0435\u043c \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u0441\u0442\u0430\u0445.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0415\u0449\u0435 \u043e\u0434\u043d\u043e \u0432\u0430\u0436\u043d\u043e\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044f \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0443\u044e \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0443\u044e \u0441\u043b\u0443\u0436\u0431\u0443, \u043d\u043e \u0431\u0435\u0437\u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c. \u041d\u043e \u043f\u043e\u0442\u043e\u043c \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0441\u0442\u044c\u044e. \u0427\u0438\u0442\u0430\u0439\u0442\u0435 \u0434\u0430\u043b\u044c\u0448\u0435, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0447\u0435\u043c\u0443!<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u00ab\u0423\u0434\u0430\u043b\u0435\u043d\u043d\u0430\u044f\u00bb (\u2018remote\u2019) \u0441\u0438\u0441\u0442\u0435\u043c\u0430<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0430\u044f (remote) \u0441\u043b\u0443\u0436\u0431\u0430 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0412\u0435\u0441\u044c \u0441\u043c\u044b\u0441\u043b \u044d\u0442\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u044f \u2014 \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u043b\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u041d\u043e \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u0435\u0435 \u043d\u0430\u0439\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0442\u0432\u043e\u0440\u0438\u043c\u0441\u044f.<\/span><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-Roboto-Mono.ttf\" style=\"font-size:.75rem;font-family:Code-Pro-Roboto-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#abb2bf;--cbp-line-number-width:calc(2 * 0.6 * .75rem);--cbp-line-highlight-color:rgba(134, 167, 228, 0.2);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282c34\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"final class RemoteSystem: @unchecked Sendable {\n\tprivate var state = false\n\tprivate let queue = DispatchQueue(label: &quot;RemoteSystemQueue&quot;)\n\n\tfunc toggleState(completionHandler: @escaping @Sendable () -&gt; Void) {\n\t\tqueue.async {\n\t\t\tself.state.toggle()\n\t\t\tcompletionHandler()\n\t\t}\n\t}\n\t\n\tfunc readState(completionHandler: @escaping @Sendable (Bool) -&gt; Void) {\n\t\tqueue.async {\n\t\t\tcompletionHandler(self.state)\n\t\t}\n\t}\n}\" style=\"color:#abb2bf;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki one-dark-pro\" style=\"background-color: #282c34\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C678DD\">final<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">class<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">RemoteSystem<\/span><span style=\"color: #ABB2BF\">: @<\/span><span style=\"color: #E5C07B\">unchecked Sendable <\/span><span style=\"color: #ABB2BF\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">var<\/span><span style=\"color: #ABB2BF\"> state = <\/span><span style=\"color: #D19A66\">false<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">let<\/span><span style=\"color: #ABB2BF\"> queue = <\/span><span style=\"color: #61AFEF\">DispatchQueue<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #61AFEF\">label<\/span><span style=\"color: #ABB2BF\">: <\/span><span style=\"color: #98C379\">&quot;RemoteSystemQueue&quot;<\/span><span style=\"color: #ABB2BF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">func<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">toggleState<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #61AFEF; font-style: italic\">completionHandler<\/span><span style=\"color: #ABB2BF\">: <\/span><span style=\"color: #C678DD\">@escaping<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">@Sendable<\/span><span style=\"color: #ABB2BF\"> () -&gt; <\/span><span style=\"color: #E5C07B\">Void<\/span><span style=\"color: #ABB2BF\">) {<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\tqueue.<\/span><span style=\"color: #61AFEF\">async<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">state<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #61AFEF\">toggle<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t<\/span><span style=\"color: #61AFEF\">completionHandler<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">func<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">readState<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #61AFEF; font-style: italic\">completionHandler<\/span><span style=\"color: #ABB2BF\">: <\/span><span style=\"color: #C678DD\">@escaping<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">@Sendable<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E5C07B\">Bool<\/span><span style=\"color: #ABB2BF\">) -&gt; <\/span><span style=\"color: #E5C07B\">Void<\/span><span style=\"color: #ABB2BF\">) {<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\tqueue.<\/span><span style=\"color: #61AFEF\">async<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t<\/span><span style=\"color: #61AFEF\">completionHandler<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">state<\/span><span style=\"color: #ABB2BF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u042d\u0442\u043e \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044f \u201c\u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439\u201d \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0440\u043e\u0432\u043d\u043e \u043e\u0434\u043d\u043e\u0439 \u0431\u0443\u043b\u0435\u0432\u043e\u0439 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">Bool<\/mark><\/code> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">var state<\/mark><\/code>. \u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u043c\u0438\u0440 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438\u043b\u0438 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0431\u0443\u043b\u0435\u0432\u0441\u043a\u043e\u0435 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">Bool<\/mark><\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <span style=\"font-weight: 400;\"><code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">state<\/mark><\/code><\/span>, \u043d\u043e \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u042f \u0443\u0432\u0435\u0440\u0435\u043d, \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>Dispatch<\/strong>. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0441\u043e <strong>Swift 6<\/strong>, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443, \u0447\u0442\u043e \u043c\u044b \u0432\u0437\u044f\u043b\u0438 \u043d\u0430 \u0441\u0435\u0431\u044f \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0437\u0430 \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c, \u043e\u0442\u043c\u0435\u0442\u0438\u0432 \u0422\u0418\u041f <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">RemoteSystem<\/mark><\/code> \u043a\u0430\u043a <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">@unchecked Sendable<\/mark><\/code>. \u041d\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <span style=\"font-weight: 400;\"><code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">@Sendable<\/mark><\/code><\/span><\/span> <span style=\"font-weight: 400;\">\u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0439.<\/span><\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\"><strong>View<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">View<\/mark><\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0441 \u044d\u0442\u043e\u0439 <span style=\"font-weight: 400;\"><code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">RemoteSystem<\/mark><\/code><\/span>.<\/span><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-Roboto-Mono.ttf\" style=\"font-size:.75rem;font-family:Code-Pro-Roboto-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#abb2bf;--cbp-line-number-width:calc(2 * 0.6 * .75rem);--cbp-line-highlight-color:rgba(134, 167, 228, 0.2);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282c34\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"struct ContentView: View {\n\t@State private var system = RemoteSystem()\n\t@State private var state = false\n\n\tprivate var imageName: String {\n\t\tstate ? &quot;star.fill&quot; : &quot;star&quot;\n\t}\n\n\tprivate func press() {\n\t\tsystem.toggleState {\n\t\t\tsystem.readState { value in\n\t\t\t\tDispatchQueue.main.async {\n\t\t\t\t\tself.state = value\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tvar body: some View {\n\t\tImage(systemName: imageName)\n\t\t\t.imageScale(.large)\n\t\t\t.foregroundStyle(.tint)\n\t\t\t.onTapGesture {\n\t\t\t\tpress()\n\t\t\t}\n\t\t\t.padding()\n\t}\n}\" style=\"color:#abb2bf;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki one-dark-pro\" style=\"background-color: #282c34\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C678DD\">struct<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">ContentView<\/span><span style=\"color: #ABB2BF\">: <\/span><span style=\"color: #E5C07B\">View <\/span><span style=\"color: #ABB2BF\">{<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">@State<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">var<\/span><span style=\"color: #ABB2BF\"> system = <\/span><span style=\"color: #61AFEF\">RemoteSystem<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">@State<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">var<\/span><span style=\"color: #ABB2BF\"> state = <\/span><span style=\"color: #D19A66\">false<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">var<\/span><span style=\"color: #ABB2BF\"> imageName: <\/span><span style=\"color: #E5C07B\">String<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\tstate ? <\/span><span style=\"color: #98C379\">&quot;star.fill&quot;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">&quot;star&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">func<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">press<\/span><span style=\"color: #ABB2BF\">() {<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\tsystem.<\/span><span style=\"color: #61AFEF\">toggleState<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t\tsystem.<\/span><span style=\"color: #61AFEF\">readState<\/span><span style=\"color: #ABB2BF\"> { value <\/span><span style=\"color: #C678DD\">in<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t\tDispatchQueue.<\/span><span style=\"color: #E06C75\">main<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #61AFEF\">async<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t\t\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">state<\/span><span style=\"color: #ABB2BF\"> = value<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">var<\/span><span style=\"color: #ABB2BF\"> body: <\/span><span style=\"color: #C678DD\">some<\/span><span style=\"color: #ABB2BF\"> View {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #61AFEF\">Image<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #61AFEF\">systemName<\/span><span style=\"color: #ABB2BF\">: imageName)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t.<\/span><span style=\"color: #61AFEF\">imageScale<\/span><span style=\"color: #ABB2BF\">(.<\/span><span style=\"color: #E06C75\">large<\/span><span style=\"color: #ABB2BF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t.<\/span><span style=\"color: #61AFEF\">foregroundStyle<\/span><span style=\"color: #ABB2BF\">(.<\/span><span style=\"color: #E06C75\">tint<\/span><span style=\"color: #ABB2BF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t.<\/span><span style=\"color: #61AFEF\">onTapGesture<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t\t<\/span><span style=\"color: #61AFEF\">press<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t.<\/span><span style=\"color: #61AFEF\">padding<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">body<\/mark><\/code> \u044d\u0442\u043e\u0433\u043e <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">View<\/mark><\/code> \u043d\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430, \u043d\u043e \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">press<\/mark><\/code>\u2014 \u0442\u043e, \u0433\u0434\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0451 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043a\u0430\u0441\u0430\u0435\u0442\u0435\u0441\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u201c\u0437\u0432\u0435\u0437\u0434\u044b\u201d, \u043c\u044b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">state<\/mark><\/code> \u0438\u0437 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">RemoteSystem<\/mark><\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">system.toggleState<\/mark><\/code>, \u0437\u0430\u0442\u0435\u043c \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">system.toggleState<\/mark><\/code>, \u0438, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0448 UI, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u0432\u0441\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u200b\u200b\u0440\u0435\u0436\u0438\u043c\u0435 Swift 6.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\"><em><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438<\/strong>\u0435<\/em>. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 <strong>Swift 6<\/strong> \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f:<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXfZy2n3PeojJMZV2GkNPpsDEXcVBwMFA_88_soxzhuNvAL3vbRgPP2Ofgb4FoGosN3JS7blA5nr8Is-sdudHLJUVqPOP20WFrn4TWjR_MsqG4YXPcN9iIbVURqu9V4li0a5U8nJuA?key=MTlMale8ClV0WfwnN3wjAg2P\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">A \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/span><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-Roboto-Mono.ttf\" style=\"font-size:.75rem;font-family:Code-Pro-Roboto-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#abb2bf;--cbp-line-number-width:calc(2 * 0.6 * .75rem);--cbp-line-highlight-color:rgba(134, 167, 228, 0.2);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282c34\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"import SwiftUI\n struct ContentView: View {\n    @State private var system = RemoteSystem()\n        @State private var state = false\n        private var imageName: String {\n            state ? &quot;star.fill&quot; : &quot;star&quot;\n        }\n        private func press() {\n            system.toggleState {\n                Task {\n                    await system.readState { value in\n                        DispatchQueue.main.async {\n                            self.state = value\n                        }\n                    }\n                }\n            }\n        }\n        var body: some View {\n            Image(systemName: imageName)\n                .imageScale(.large)\n                .foregroundStyle(.tint)\n                .onTapGesture {\n                    press()\n                }\n                .padding()\n        }\n }\" style=\"color:#abb2bf;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki one-dark-pro\" style=\"background-color: #282c34\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">SwiftUI<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">struct<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">ContentView<\/span><span style=\"color: #ABB2BF\">: <\/span><span style=\"color: #E5C07B\">View <\/span><span style=\"color: #ABB2BF\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">@State<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">var<\/span><span style=\"color: #ABB2BF\"> system = <\/span><span style=\"color: #61AFEF\">RemoteSystem<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">@State<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">var<\/span><span style=\"color: #ABB2BF\"> state = <\/span><span style=\"color: #D19A66\">false<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">var<\/span><span style=\"color: #ABB2BF\"> imageName: <\/span><span style=\"color: #E5C07B\">String<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">            state ? <\/span><span style=\"color: #98C379\">&quot;star.fill&quot;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">&quot;star&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">func<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">press<\/span><span style=\"color: #ABB2BF\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">            system.<\/span><span style=\"color: #61AFEF\">toggleState<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">                <\/span><span style=\"color: #61AFEF\">Task<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">                    <\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> system.<\/span><span style=\"color: #61AFEF\">readState<\/span><span style=\"color: #ABB2BF\"> { value <\/span><span style=\"color: #C678DD\">in<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">                        DispatchQueue.<\/span><span style=\"color: #E06C75\">main<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #61AFEF\">async<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">                            <\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">state<\/span><span style=\"color: #ABB2BF\"> = value<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">                        }<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">                    }<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">                }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">            }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">var<\/span><span style=\"color: #ABB2BF\"> body: <\/span><span style=\"color: #C678DD\">some<\/span><span style=\"color: #ABB2BF\"> View {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #61AFEF\">Image<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #61AFEF\">systemName<\/span><span style=\"color: #ABB2BF\">: imageName)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">                .<\/span><span style=\"color: #61AFEF\">imageScale<\/span><span style=\"color: #ABB2BF\">(.<\/span><span style=\"color: #E06C75\">large<\/span><span style=\"color: #ABB2BF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">                .<\/span><span style=\"color: #61AFEF\">foregroundStyle<\/span><span style=\"color: #ABB2BF\">(.<\/span><span style=\"color: #E06C75\">tint<\/span><span style=\"color: #ABB2BF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">                .<\/span><span style=\"color: #61AFEF\">onTapGesture<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">                    <\/span><span style=\"color: #61AFEF\">press<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">                }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">                .<\/span><span style=\"color: #61AFEF\">padding<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\"> }<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Reentrancy<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0418\u0442\u0430\u043a, \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043d\u043e \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">press<\/mark><\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0440\u044f\u0434 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0434\u043e \u044d\u0442\u043e\u0433\u043e. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0438\u0447\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u043d\u043e\u0432\u0430 \u043d\u0430\u0436\u0430\u0442\u044c \u043d\u0430 \u201c\u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0443\u201d, \u043f\u043e\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0435. \u0410 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b <span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"><code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">RemoteSystem<\/mark><\/code><\/span><\/span><\/span> <span style=\"font-weight: 400;\">\u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e \u0438 \u0438\u0437\u043c\u0435\u043d\u0447\u0438\u0432\u043e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0447\u0442\u043e \u0432\u0442\u043e\u0440\u043e\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u0440\u0430\u043d\u044c\u0448\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0434\u0432\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0436\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0439:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span style=\"font-weight: 400;\">\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u201c\u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0443\u201d<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\"><code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">toggleState<\/mark><\/code> \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f, \u043d\u043e \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <strong>\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e<\/strong><\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043d\u043e\u0432\u0430 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442&nbsp; \u043d\u0430 \u201c\u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0443\u201d<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">\u0415\u0449\u0435 \u043e\u0434\u0438\u043d <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">toggleState<\/mark><\/code> \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f, \u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <strong>\u0431\u044b\u0441\u0442\u0440\u043e<\/strong>!<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">\u0417\u0430\u0442\u0435\u043c \u0435\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f, \u0438 UI \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0432\u044b\u0439 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">toggleState<\/mark><\/code> \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f<\/span><\/li>\n\n\n\n<li><span style=\"font-weight: 400;\">UI \u0441\u043d\u043e\u0432\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u043e\u0442\u043c\u0435\u043d\u044f\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/span><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0439 \u044d\u0442\u043e\u0433\u043e. \u041d\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043e\u0434 <strong>\u041d\u0415 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0439<\/strong>. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">press<\/mark><\/code> \u043c\u043e\u0436\u0435\u0442 \u0441\u043d\u043e\u0432\u0430 \u043d\u0430\u0447\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 (\u201center\u201d), \u0430 \u0437\u0430\u0442\u0435\u043c \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043d\u043e\u0432\u0430 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c (\u201cre-enter\u201d) \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437. \u042d\u0442\u043e <strong>reentrancy<\/strong>!<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u0422\u0435\u0440\u043c\u0438\u043d \u00ab<\/strong><strong>reentrancy<\/strong><strong>\u00bb<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041c\u043d\u0435 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0442\u0435\u0440\u043c\u0438\u043d \u00ab<strong>reentrancy<\/strong>\u00bb. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0441\u0438\u0442\u044c \/ \u0447\u0438\u0442\u0430\u0442\u044c. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u0447\u0442\u043e \u00ab\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>reentrant<\/strong><strong>\u00bb<\/strong>, \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u0435\u0435 \u043c\u043e\u0436\u043d\u043e <strong>\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432. \u0418, \u0432-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u0441\u0442\u0430\u0440\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0433\u043e\u043d\u043a\u0438. \u041d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043d\u0435 \u0433\u043e\u043d\u043a\u0430 <strong>\u0434\u0430\u043d\u043d\u044b\u0445<\/strong> (<strong>data race<\/strong>). \u0423 \u043d\u0430\u0441 \u043d\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 (threads), \u0447\u0438\u0442\u0430\u044e\u0449\u0438\u0445 \/ \u043f\u0438\u0448\u0443\u0449\u0438\u0445 \u0432 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u042f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0432\u0435\u0449\u0438 \u00ab<strong>\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438<\/strong>\u00bb \u0433\u043e\u043d\u043a\u0430\u043c\u0438 (\u201c<strong>logical<\/strong>\u201d <strong>races<\/strong>). (\u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0440\u043c\u0438\u043d, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0434\u0430\u0439\u0442\u0435 \u043c\u043d\u0435 \u0437\u043d\u0430\u0442\u044c!)<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 <span style=\"font-weight: 400;\"> \u0433\u043e\u043d\u043e\u043a<\/span><\/span> <span style=\"font-weight: 400;\">(<strong>logical<\/strong> <span style=\"font-weight: 400;\"><strong>races<\/strong><\/span>) \u0432\u0430\u043c \u0434\u0430\u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432. \u0412\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u0435\u043d \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431, \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0449\u0435\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0434\u043d\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441 \u0446\u0438\u043a\u043b\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0443 \u0432\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 <strong>\u041d\u0415<\/strong> \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u0443 \u0432\u0430\u0441 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435\u00a0<span style=\"font-weight: 400;\"> \u0433\u043e\u043d\u043a\u0438<\/span> (<strong>logical<\/strong> <span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"><strong>races<\/strong><\/span><\/span>).<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Actors<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u042f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044e <strong>Dispatch<\/strong> \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0430\u043a\u0442\u043e\u0440\u044b <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">actors<\/mark><\/code> \u0438\u043b\u0438 <strong>Swift concurrency<\/strong>, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043b\u044e\u0434\u0438 \u043c\u043d\u043e\u0433\u043e \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043e \u00ab<strong>actor reentrancy\u00bb<\/strong>, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\u2014 \u0438 \u043d\u0430 \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u0435\u0441\u043a\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430! \u041d\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u044d\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c, \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0430\u043a\u0442\u043e\u0440\u0430 actor \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">RemoteSystem<\/mark><\/code>.<\/span><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-Roboto-Mono.ttf\" style=\"font-size:.75rem;font-family:Code-Pro-Roboto-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#abb2bf;--cbp-line-number-width:calc(2 * 0.6 * .75rem);--cbp-line-highlight-color:rgba(134, 167, 228, 0.2);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282c34\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"actor RemoteSystem {\n\tprivate(set) var state = false\n\n\tinit() {\n\t}\n\n\tfunc toggleState() {\n\t\tself.state.toggle()\n\t}\n}\" style=\"color:#abb2bf;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki one-dark-pro\" style=\"background-color: #282c34\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C678DD\">actor<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">RemoteSystem<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #C678DD\">set<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #C678DD\">var<\/span><span style=\"color: #ABB2BF\"> state = <\/span><span style=\"color: #D19A66\">false<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">init<\/span><span style=\"color: #ABB2BF\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">func<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">toggleState<\/span><span style=\"color: #ABB2BF\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">state<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #61AFEF\">toggle<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0415\u0441\u043b\u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430\u0437\u0430\u0434 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0434\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u043e \u0441\u0442\u0430\u043d\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u043d\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043a\u043e\u0434\u0430. \u0410\u043a\u0442\u043e\u0440\u044b <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">actor<\/mark><\/code> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0449\u0438\u0442\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041e\u0434\u043d\u0430\u043a\u043e, \u044f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0435\u0449\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0430\u043a\u0442\u043e\u0440\u0430\u00a0 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">actor<\/mark><\/code> \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 &#171;\u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b&#187;.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Actor \u043f\u0440\u043e\u0442\u0438\u0432 service<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u044f \u0445\u043e\u0442\u0435\u043b \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u0443\u044e &#171;\u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0443\u044e&#187; <span style=\"font-weight: 400;\">\u0441\u043b\u0443\u0436\u0431\u0443<\/span><\/span> <span style=\"font-weight: 400;\">(remote \u00a0service) . \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0430 &#171;\u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0430\u044f&#187;, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043d\u0435\u0439 \u2014 \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0410\u043a\u0442\u043e\u0440\u044b <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">actor<\/mark><\/code> \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0443\u044e \u0441\u043b\u0443\u0436\u0431\u0443, \u0432 \u0442\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435, \u0447\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0438\u0445 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u2014 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041d\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0435! \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u0443\u044e \u0441\u043b\u0443\u0436\u0431\u0443, \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e \u0441\u0435\u0442\u0438. \u0418, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044d\u0442\u0430 \u0441\u043b\u0443\u0436\u0431\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0430\u043c \u043b\u044e\u0431\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b. \u042d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u0443\u043c\u0430\u0442\u044c \u043e\u0431 \u0430\u043a\u0442\u043e\u0440\u0430\u0445 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">actor<\/mark><\/code> \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0434\u0438\u0437\u0430\u0439\u043d\u0430. \u0412\u0441\u0435 \u0432\u0445\u043e\u0434\u044b <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">inputs<\/mark><\/code> \u0438 \u0432\u044b\u0445\u043e\u0434\u044b <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">outputs<\/mark><\/code> \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0442\u0443\u0434\u0430 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u043b\u0443\u0436\u0431\u0435 \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u044b\u043b\u0438 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438. \u0421 \u0430\u043a\u0442\u043e\u0440\u043e\u043c actor \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f. \u041d\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u0438 \u0422\u0418\u041f\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043f\u043e\u043a\u0438\u0434\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u043f\u043e\u0442\u043e\u043a\/\u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0438 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u00ab\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u00bb (\u201csend\u201d<\/span>))<span style=\"font-weight: 400;\"> \u0438\u0445 \u0430\u043a\u0442\u043e\u0440\u0443 \u00a0<code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">actor<\/mark><\/code>. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u0438 \u0432\u0445\u043e\u0434\u044b <span style=\"font-weight: 400;\"> <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">inputs<\/mark><\/code> <\/span>\u0438 \u0432\u044b\u0445\u043e\u0434\u044b <span style=\"font-weight: 400;\"><code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">outputs<\/mark><\/code> <\/span>\u0431\u044b\u043b\u0438 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">Sendable<\/mark><\/code>.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0410\u043a\u0442\u043e\u0440\u044b <span style=\"font-weight: 400;\"><code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">actor<\/mark><\/code><\/span><\/span> <span style=\"font-weight: 400;\">\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0441\u043b\u0443\u0436\u0431\u044b \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438. \u041d\u043e \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0438\u0437\u043a\u0438! \u0418 \u044f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u0443\u043c\u0430\u0442\u044c \u043e \u043d\u0438\u0445 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">(\u042d\u0442\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0441 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u043b\u0443\u0436\u0431\u0430\u043c\u0438 \u2014 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e, \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0443\u0442\u0441\u044f <a href=\"https:\/\/developer.apple.com\/documentation\/distributed\">\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0430\u043a\u0442\u043e\u0440\u044b<\/a>!)<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u043a\u0442\u043e\u0440\u0430 actor<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0425\u043e\u0440\u043e\u0448\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435. \u041d\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">View<\/mark><\/code>, \u0447\u0442\u043e\u0431\u044b \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0430\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443. \u041d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 press.<\/span><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-Roboto-Mono.ttf\" style=\"font-size:.75rem;font-family:Code-Pro-Roboto-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#abb2bf;--cbp-line-number-width:calc(1 * 0.6 * .75rem);--cbp-line-highlight-color:rgba(134, 167, 228, 0.2);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282c34\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"private func press() {\n\tTask {\n\t\tawait system.toggleState()\n\t\tself.state = await system.state\n\t}\n}\" style=\"color:#abb2bf;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki one-dark-pro\" style=\"background-color: #282c34\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">func<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">press<\/span><span style=\"color: #ABB2BF\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #61AFEF\">Task<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> system.<\/span><span style=\"color: #61AFEF\">toggleState<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">state<\/span><span style=\"color: #ABB2BF\"> = <\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> system.<\/span><span style=\"color: #E06C75\">state<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435. \u041d\u043e \u044d\u0442\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0435\u043c \u043a\u043e\u0434\u0430 \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u0435! \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e, \u0438 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">async<\/mark><\/code> \u043c\u0435\u0442\u043e\u0434\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">Task<\/mark><\/code>. \u0412\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e &#171;\u0432\u044b\u0432\u043e\u0434 \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430&#187; (inference) \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">isolation<\/mark><\/code>  \u0441\u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">press @MainActor<\/mark><\/code>. \u042d\u0442\u043e, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0435\u043b\u043e \u0437\u0430\u0434\u0430\u0447\u0438 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">Task<\/mark><\/code> \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">@MainActor<\/mark><\/code>. \u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u0437\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">self.state.<\/mark><\/code><\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">(\u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0435\u0441\u0442\u044c \u0432 <a href=\"https:\/\/www.massicotte.org\/step-by-step-network-request\">\u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0441\u0442\u0435<\/a>. \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"https:\/\/www.massicotte.org\/isolation-intuition\">\u0443\u0433\u043b\u0443\u0431\u0438\u0442\u044c\u0441\u044f <\/a>\u043a\u0430\u043a \u0432 \u201c\u0432\u044b\u0432\u043e\u0434 \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u201d (inference) \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">isolation<\/mark><\/code>, \u0442\u0430\u043a \u0438 \u0432 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 (inheritance), \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435.)<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u042f \u043b\u044e\u0431\u043b\u044e \u0437\u0430\u044f\u0432\u043b\u044f\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u2014 \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u0438\u043b\u0438 \u043f\u043e\u0447\u0435\u043c\u0443 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">self.state<\/mark><\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 (<strong>main thread<\/strong>). \u042d\u0442\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0422\u0418\u041f\u043e\u0432, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u0412\u0441\u0435 \u044d\u0442\u043e <strong>\u0440\u0435\u0437\u043a\u043e <\/strong>\u043a\u043e\u043d\u0442\u0440\u0430\u0441\u0442\u0438\u0440\u0443\u0435\u0442 \u0441 <strong>Dispatch<\/strong> \u0432\u0435\u0440\u0441\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u043c\u0443 \u043d\u0443\u0436\u0435\u043d <strong>DispatchQueue.main.async <\/strong>\u0434\u043b\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 (thread<\/span>s)<span style=\"font-weight: 400;\">.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041d\u043e \u0437\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u043d\u043a\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b. \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u0435\u0440\u043d\u0435\u0442\u0435\u0441\u044c \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 <strong>Dispatch<\/strong> \u0432\u0435\u0440\u0441\u0438\u044e \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e press \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">system.toggleState<\/mark><\/code> <strong>\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e<\/strong>. \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0432\u0435\u0441\u044c \u043f\u0443\u0442\u044c \u043e\u0442 UI \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u043d\u0443\u0442\u0440\u044c \u043c\u0435\u0442\u043e\u0434\u0430 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">RemoteSystem<\/mark><\/code>, \u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u044f \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 (<strong>main thread<\/strong>).<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0417\u0434\u0435\u0441\u044c \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0435 \u0442\u0430\u043a! \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0432\u0432\u0435\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0448\u0430\u0433. \u042d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">Task<\/mark><\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e. \u041e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 (<strong>main queue<\/strong>).<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">(\u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0435\u0439 \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">Task<\/mark><\/code> \u0438 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0435\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0437\u0430\u0434\u0430\u0447\u0435 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">Task<\/mark><\/code> \u0441 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u043e\u0439 FIFO. \u042d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 <strong>concurrency<\/strong> \u0438 <strong>Dispatch<\/strong>.)<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u042d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u044d\u0442\u043e\u043c <strong>\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c<\/strong> \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u042d\u0442\u043e \u0442\u043e, \u043e \u0447\u0435\u043c \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u0432\u043e\u0434\u0438\u0442\u0435 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">Task<\/mark><\/code>. \u0418 \u0432\u0434\u0432\u043e\u0439\u043d\u0435 \u0434\u0443\u043c\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u044d\u0442\u043e \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">completionHandlers<\/mark><\/code> \u043d\u0430 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">async\/await<\/mark><\/code>. \u042d\u0442\u043e \u0431\u044b\u043b\u0430 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0435\u0440\u0432\u044b\u0445 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>Swift concurrency<\/strong>.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041c\u044b \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u044d\u0442\u043e\u0439 \u0438\u0434\u0435\u0435, \u043d\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u0435\u043a <\/strong><strong>delay<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u043c\u044b \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0438 \u043e\u043a\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 <strong>\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0433\u043e\u043d\u043a\u0438<\/strong>. \u0412 \u044d\u0442\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435 \u043e\u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u0443\u0445\u0443\u0434\u0448\u0438\u043b\u0430\u0441\u044c! \u041d\u043e \u044f \u043d\u0435 \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a \u0443\u0436 \u043f\u043b\u043e\u0445\u043e. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044f\u0441\u044c \u0441 <strong>\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0433\u043e\u043d\u043a\u0430\u043c\u0438<\/strong> (\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u043c\u0438), \u044f \u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u0435\u043b\u0430\u044e \u044d\u0442\u043e \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e. \u0417\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0447\u0430\u0441\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u044f\u0432\u0438\u0442\u044c \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u044d\u0442\u043e\u0439. \u041c\u043d\u043e\u0433\u0438\u0435 \u0433\u043e\u043d\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0430\u043b\u043e\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b, \u043f\u0440\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u042d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u043d\u0430\u043c \u0440\u0430\u0437\u0432\u0438\u0442\u044c \u043b\u0443\u0447\u0448\u0443\u044e \u0438\u043d\u0442\u0443\u0438\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u0434. \u0418, \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, <strong>\u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443<\/strong> \u043e\u043d \u0431\u043e\u043b\u0435\u0435 \u0432\u043e\u0441\u043f\u0440\u0438\u0438\u043c\u0447\u0438\u0432 \u043a<strong> \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0433\u043e\u043d\u043a\u0430\u043c<\/strong>. \u041e\u043d\u0438 (\u043f\u043e\u043a\u0430) \u043d\u0435 \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043d\u0430\u0441, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u0434.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u0434\u043e 1 \u0441.<\/span><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-Roboto-Mono.ttf\" style=\"font-size:.75rem;font-family:Code-Pro-Roboto-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#abb2bf;--cbp-line-number-width:calc(1 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282c34\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"func randomDelay() {\n\tlet delayRange: Range&lt;UInt32&gt; = 0..&lt;1_000_000\n\n\tusleep(delayRange.randomElement()!)\n}\" style=\"color:#abb2bf;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki one-dark-pro\" style=\"background-color: #282c34\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C678DD\">func<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">randomDelay<\/span><span style=\"color: #ABB2BF\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">let<\/span><span style=\"color: #ABB2BF\"> delayRange: <\/span><span style=\"color: #E5C07B\">Range<\/span><span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E5C07B\">UInt32<\/span><span style=\"color: #ABB2BF\">&gt; = <\/span><span style=\"color: #D19A66\">0<\/span><span style=\"color: #ABB2BF\">..&lt;<\/span><span style=\"color: #D19A66\">1_000_000<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #61AFEF\">usleep<\/span><span style=\"color: #ABB2BF\">(delayRange.<\/span><span style=\"color: #61AFEF\">randomElement<\/span><span style=\"color: #ABB2BF\">()!)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0412\u0430\u043c \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u0432\u044b\u0447\u0443\u0440\u043d\u044b\u043c. \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">sleep(1) <\/mark><\/code>\u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041d\u043e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043d\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043c\u043e\u0436\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0432\u0440\u0435\u0434\u0438\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e. \u0418 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u0445 \u0437\u0430\u0434\u0435\u0440\u0436\u0435\u043a \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0432\u044b\u044f\u0432\u0438\u0442\u044c \u0433\u043e\u043d\u043a\u0438, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u043e\u043d\u0438 \u0435\u0441\u0442\u044c<br>(\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043e <a href=\"https:\/\/developer.apple.com\/library\/archive\/documentation\/System\/Conceptual\/ManPages_iPhoneOS\/man3\/sleep.3.html\">sleep<\/a> \u0438 <a href=\"https:\/\/developer.apple.com\/library\/archive\/documentation\/System\/Conceptual\/ManPages_iPhoneOS\/man3\/usleep.3.html\">usleep<\/a> \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430.)<br> \u0412\u043e\u0442 \u043a\u043e\u0434 \u0441\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430\u043c\u0438:<\/span><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-Roboto-Mono.ttf\" style=\"font-size:.75rem;font-family:Code-Pro-Roboto-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#abb2bf;--cbp-line-number-width:calc(2 * 0.6 * .75rem);--cbp-line-highlight-color:rgba(134, 167, 228, 0.2);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282c34\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"private func press() {\n\tTask {\n\t\trandomDelay() \/\/ start\n\n\t\trandomDelay() \/\/ enter\n\t\tawait system.toggleState()\n\t\trandomDelay() \/\/ complete\n\n\t\trandomDelay() \/\/ enter\n\t\tlet value = await system.state\n\t\trandomDelay() \/\/ complete\n\n\t\tself.state = value\n\t}\n}\" style=\"color:#abb2bf;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki one-dark-pro\" style=\"background-color: #282c34\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">func<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">press<\/span><span style=\"color: #ABB2BF\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #61AFEF\">Task<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #61AFEF\">randomDelay<\/span><span style=\"color: #ABB2BF\">() <\/span><span style=\"color: #7F848E; font-style: italic\">\/\/ start<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #61AFEF\">randomDelay<\/span><span style=\"color: #ABB2BF\">() <\/span><span style=\"color: #7F848E; font-style: italic\">\/\/ enter<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> system.<\/span><span style=\"color: #61AFEF\">toggleState<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #61AFEF\">randomDelay<\/span><span style=\"color: #ABB2BF\">() <\/span><span style=\"color: #7F848E; font-style: italic\">\/\/ complete<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #61AFEF\">randomDelay<\/span><span style=\"color: #ABB2BF\">() <\/span><span style=\"color: #7F848E; font-style: italic\">\/\/ enter<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #C678DD\">let<\/span><span style=\"color: #ABB2BF\"> value = <\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> system.<\/span><span style=\"color: #E06C75\">state<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #61AFEF\">randomDelay<\/span><span style=\"color: #ABB2BF\">() <\/span><span style=\"color: #7F848E; font-style: italic\">\/\/ complete<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">state<\/span><span style=\"color: #ABB2BF\"> = value<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0418\u0445 \u043c\u043d\u043e\u0433\u043e! <br>\u041f\u0435\u0440\u0432\u0430\u044f \u2014 \u044d\u0442\u043e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u0442\u044c \u0417\u0430\u0434\u0430\u0447\u0430 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">Task<\/mark><\/code> \u0435\u0449\u0435 \u0434\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430. \u042d\u0442\u043e \u043f\u0440\u0438\u0441\u0443\u0449\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435\u043c API, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u044d\u0442\u043e\u043c\u0443,\u00a0 \u0438 \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">DispatchQueue.async <\/mark><\/code>\u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u0442\u044c \u0435\u0435. \u041e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c. <br>\u0414\u0430\u043b\u0435\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u043f\u0430\u0440\u044b \u0437\u0430\u0434\u0435\u0440\u0436\u0435\u043a \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0430\u0448\u0438\u0445 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">await<\/mark><\/code>. \u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c\u0443 \u0432\u044b\u0437\u043e\u0432\u0443 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">await<\/mark><\/code> \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430. \u0417\u0430\u0442\u0435\u043c \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043b\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f. <br>\u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u044d\u0442\u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438. \u0422\u043e, \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0434\u0435\u0441\u044c, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u043e\u0447\u044c \u043d\u0430\u043c \u0434\u0443\u043c\u0430\u0442\u044c \u043e \u043d\u0438\u0445 \u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">(\u041f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u0442\u043e\u0433\u043e, \u043a\u043e\u0433\u0434\u0430\/\u043f\u043e\u0447\u0435\u043c\u0443\/\u043a\u0430\u043a <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">await<\/mark><\/code> \u043c\u043e\u0436\u0435\u0442 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u043c. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0432\u0430\u043c \u0440\u0435\u0434\u043a\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f. \u041d\u043e \u044f \u0431\u044b \u0441 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043e\u0431 \u044d\u0442\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432 \u043b\u044e\u0431\u043e\u0439 \u0434\u0435\u043d\u044c.)<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u0421\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u0433\u043e\u043d\u043a\u0435<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0442\u0435\u043f\u0435\u0440\u044c \u044f \u0443\u0431\u0435\u0434\u0438\u043b \u0432\u0430\u0441, \u0447\u0442\u043e \u0443 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0447\u0435\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f UI. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">press<\/mark><\/code> \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0430. \u0415\u0441\u043b\u0438 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0443\u044e <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">@State<\/mark><\/code> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">var inProgress<\/mark><\/code> \u0432 \u043d\u0430\u0448 UI, \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u044d\u0442\u043e.<\/span><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-Roboto-Mono.ttf\" style=\"font-size:.75rem;font-family:Code-Pro-Roboto-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#abb2bf;--cbp-line-number-width:calc(2 * 0.6 * .75rem);--cbp-line-highlight-color:rgba(134, 167, 228, 0.2);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282c34\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"struct ContentView: View {\n\t@State private var inProgress = false\n\n\t\/\/ ...\n\n\tprivate func press() {\n\t\tif inProgress { return }\n\t\tself.inProgress = true\n\t\t\n\t\tTask {\n\t\t\tawait system.toggleState()\n\t\t\tself.state = await system.state\n\t\t\t\n\t\t\tself.inProgress = false\n\t\t}\n\t}\n}\" style=\"color:#abb2bf;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki one-dark-pro\" style=\"background-color: #282c34\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C678DD\">struct<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">ContentView<\/span><span style=\"color: #ABB2BF\">: <\/span><span style=\"color: #E5C07B\">View <\/span><span style=\"color: #ABB2BF\">{<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">@State<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">var<\/span><span style=\"color: #ABB2BF\"> inProgress = <\/span><span style=\"color: #D19A66\">false<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #7F848E; font-style: italic\">\/\/ ...<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">func<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">press<\/span><span style=\"color: #ABB2BF\">() {<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #C678DD\">if<\/span><span style=\"color: #ABB2BF\"> inProgress { <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> }<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">inProgress<\/span><span style=\"color: #ABB2BF\"> = <\/span><span style=\"color: #D19A66\">true<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #61AFEF\">Task<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t<\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> system.<\/span><span style=\"color: #61AFEF\">toggleState<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">state<\/span><span style=\"color: #ABB2BF\"> = <\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> system.<\/span><span style=\"color: #E06C75\">state<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t\t<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">inProgress<\/span><span style=\"color: #ABB2BF\"> = <\/span><span style=\"color: #D19A66\">false<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0412\u0441\u0435, \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0437\u0434\u0435\u0441\u044c, \u044d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0437\u0430\u0449\u0438\u0442\u0443. \u0415\u0441\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0443\u0436\u0435 \u043d\u0430\u0447\u0430\u043b\u0430\u0441\u044c, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u043c. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u043c \u0435\u0435 \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u0443\u044e, \u0437\u0430\u0442\u0435\u043c \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u043c \u0435\u0435 \u043a\u0430\u043a \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u0443\u044e.<br>\u041f\u0440\u043e\u0441\u0442\u043e!<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u041a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044b<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u042f \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0432\u044b \u0443\u0436\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">disabled<\/mark><\/code><\/span> <span style=\"font-weight: 400;\">\u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b\u0438 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">spinners<\/mark><\/code>, \u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a \u0436\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0447\u0443 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c <strong>\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439<\/strong>.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0415\u0441\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0417\u0430\u0434\u0430\u0447\u0438 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">Task<\/mark><\/code>. \u042f \u0445\u043e\u0447\u0443, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0438\u0441\u044c \u043d\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u0435\u0449\u0435 \u0435\u0441\u0442\u044c \u0433\u043e\u043d\u043a\u0430?<\/span><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-Roboto-Mono.ttf\" style=\"font-size:.75rem;font-family:Code-Pro-Roboto-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#abb2bf;--cbp-line-number-width:calc(2 * 0.6 * .75rem);--cbp-line-highlight-color:rgba(134, 167, 228, 0.2);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282c34\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"private func press() {\n\tTask {\n\t\tif inProgress { return }\n\t\tself.inProgress = true\n\t\t\n\t\tawait system.toggleState()\n\t\tself.state = await system.state\n\t\t\n\t\tself.inProgress = false\n\t}\n}\" style=\"color:#abb2bf;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki one-dark-pro\" style=\"background-color: #282c34\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">func<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">press<\/span><span style=\"color: #ABB2BF\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #61AFEF\">Task<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #C678DD\">if<\/span><span style=\"color: #ABB2BF\"> inProgress { <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">inProgress<\/span><span style=\"color: #ABB2BF\"> = <\/span><span style=\"color: #D19A66\">true<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> system.<\/span><span style=\"color: #61AFEF\">toggleState<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">state<\/span><span style=\"color: #ABB2BF\"> = <\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> system.<\/span><span style=\"color: #E06C75\">state<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">inProgress<\/span><span style=\"color: #ABB2BF\"> = <\/span><span style=\"color: #D19A66\">false<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u042d\u0442\u043e <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">body<\/mark><\/code> \u0437\u0430\u0434\u0430\u0447\u0438 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">Task<\/mark><\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 (<strong>main thread<\/strong>). \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0445\u043e\u0442\u044f \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0439 <span style=\"font-weight: 400;\"> \u0437\u0430\u0434\u0430\u0447\u0438 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">Task<\/mark><\/code><\/span>, \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f.<br>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043f\u043e\u0440\u0438\u0442\u044c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043b\u0443\u0447\u0448\u0435, \u043d\u043e \u044d\u0442\u0430 \u0432\u0435\u0440\u0441\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u0430 \u0433\u043e\u043d\u043a\u0430\u043c.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u043d\u0430\u0448 \u043a\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0439\u0442\u0438 \u043d\u0435 \u0442\u0430\u043a, \u0435\u0441\u043b\u0438 \u043c\u044b <strong>\u041d\u0415 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c <\/strong>\u044d\u0442\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e.<\/span><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-Roboto-Mono.ttf\" style=\"font-size:.75rem;font-family:Code-Pro-Roboto-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#abb2bf;--cbp-line-number-width:calc(2 * 0.6 * .75rem);--cbp-line-highlight-color:rgba(134, 167, 228, 0.2);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282c34\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"private func press() {\n\tTask {\n\t\tif inProgress { return }\n\t\t\n\t\tawait system.prepare()\n\t\t\n\t\tself.inProgress = true\n\t\t\n\t\tawait system.toggleState()\n\t\tself.state = await system.state\n\t\t\n\t\tself.inProgress = false\n\t}\n}\" style=\"color:#abb2bf;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki one-dark-pro\" style=\"background-color: #282c34\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">func<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">press<\/span><span style=\"color: #ABB2BF\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #61AFEF\">Task<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #C678DD\">if<\/span><span style=\"color: #ABB2BF\"> inProgress { <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> system.<\/span><span style=\"color: #61AFEF\">prepare<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">inProgress<\/span><span style=\"color: #ABB2BF\"> = <\/span><span style=\"color: #D19A66\">true<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> system.<\/span><span style=\"color: #61AFEF\">toggleState<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">state<\/span><span style=\"color: #ABB2BF\"> = <\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> system.<\/span><span style=\"color: #E06C75\">state<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">inProgress<\/span><span style=\"color: #ABB2BF\"> = <\/span><span style=\"color: #D19A66\">false<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u042f \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u044e\u0434\u0430 \u043d\u043e\u0432\u044b\u0439 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 await. \u041d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u0442\u043a\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u041c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0441 \u043d\u0430\u0448\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">state<\/mark><\/code>. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">state<\/mark><\/code> \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">prepare()<\/mark><\/code>, \u043d\u043e \u044d\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e!<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0434\u0443\u043c\u0430\u0442\u044c \u043e\u0431 <mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\"><code>await<\/code><\/mark> \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u043e \u043c\u0430\u0440\u043a\u0435\u0440\u0435, \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0435\u043c <strong>\u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0435\u043a\u0446\u0438\u044e<\/strong>. \u041c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">state<\/mark><\/code> \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0430 Task \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f. \u042d\u0442\u043e \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u043c\u043d\u043e\u0433\u0438\u0445 \u0432\u0438\u0434\u043e\u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u0410 \u043a\u0430\u043a \u043d\u0430\u0441\u0447\u0435\u0442 \u0430\u043a\u0442\u043e\u0440\u043e\u0432 actor?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0439 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">RemoteSystem<\/mark><\/code>, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 Dispatch.<\/span><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-Roboto-Mono.ttf\" style=\"font-size:.75rem;font-family:Code-Pro-Roboto-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#abb2bf;--cbp-line-number-width:calc(1 * 0.6 * .75rem);--cbp-line-highlight-color:rgba(134, 167, 228, 0.2);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282c34\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"func toggleState(completionHandler: @escaping @Sendable () -&gt; Void) {\n\tqueue.async {\n\t\tself.state.toggle()\n\t\tcompletionHandler()\n\t}\n}\" style=\"color:#abb2bf;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki one-dark-pro\" style=\"background-color: #282c34\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C678DD\">func<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">toggleState<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #61AFEF; font-style: italic\">completionHandler<\/span><span style=\"color: #ABB2BF\">: <\/span><span style=\"color: #C678DD\">@escaping<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">@Sendable<\/span><span style=\"color: #ABB2BF\"> () -&gt; <\/span><span style=\"color: #E5C07B\">Void<\/span><span style=\"color: #ABB2BF\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\tqueue.<\/span><span style=\"color: #61AFEF\">async<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">state<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #61AFEF\">toggle<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t\t<\/span><span style=\"color: #61AFEF\">completionHandler<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041c\u044b \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u043b\u0438 \u044d\u0442\u043e \u0432\u044b\u0448\u0435. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">completionHandler,<\/mark><\/code> \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u043d \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439. \u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u044d\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u200b\u200b\u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0437\u043e\u0432\u0430. \u042d\u0442\u043e <strong>\u041d\u0415 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f<\/strong> \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0430\u043a\u0442\u043e\u0440\u0443 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">actor<\/mark><\/code>! \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043c\u0438\u0440\u0430 \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e.<\/span><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-Roboto-Mono.ttf\" style=\"font-size:.75rem;font-family:Code-Pro-Roboto-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#abb2bf;--cbp-line-number-width:calc(1 * 0.6 * .75rem);--cbp-line-highlight-color:rgba(134, 167, 228, 0.2);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282c34\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"func toggleState() {\n\tself.state.toggle()\n}\n\nawait system.toggleState()\" style=\"color:#abb2bf;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki one-dark-pro\" style=\"background-color: #282c34\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C678DD\">func<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">toggleState<\/span><span style=\"color: #ABB2BF\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">state<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #61AFEF\">toggle<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> system.<\/span><span style=\"color: #61AFEF\">toggleState<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0412 \u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430, \u044d\u0442\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u041d\u0415 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0442\u0435\u043c \u0436\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u0418\u043c\u0435\u0435\u0442 \u043b\u0438 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442, \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e, \u043d\u043e \u044f \u0445\u043e\u0447\u0443 \u044d\u0442\u043e \u0432\u044b\u0441\u043a\u0430\u0437\u0430\u0442\u044c. \u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0445\u0430\u0440 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">completionHandler.<\/mark><\/code> \u041e\u043d\u0438 \u0431\u043b\u0438\u0437\u043a\u0438, \u043d\u043e \u0443 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c<strong> \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435<\/strong> \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u2014 \u0438 \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0438 \u043d\u0430\u0448\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 UI \u0432\u044b\u0448\u0435, \u0443 \u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432\u043d\u0443\u0442\u0440\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0435\u0431\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">toggleState<\/mark><\/code>.<\/span><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-Roboto-Mono.ttf\" style=\"font-size:.75rem;font-family:Code-Pro-Roboto-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#abb2bf;--cbp-line-number-width:calc(1 * 0.6 * .75rem);--cbp-line-highlight-color:rgba(134, 167, 228, 0.2);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282c34\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"func toggleState() async {\n\tawait initializeStateIfNeeded()\n\t\n\tself.state.toggle()\n}\" style=\"color:#abb2bf;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki one-dark-pro\" style=\"background-color: #282c34\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #C678DD\">func<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">toggleState<\/span><span style=\"color: #ABB2BF\">() <\/span><span style=\"color: #C678DD\">async<\/span><span style=\"color: #ABB2BF\"> {<\/span><\/span>\n<span class=\"line cbp-line-highlight\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF\">initializeStateIfNeeded<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">\t<\/span><span style=\"color: #E5C07B\">self<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">state<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #61AFEF\">toggle<\/span><span style=\"color: #ABB2BF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 <strong>\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f<\/strong> <strong>\u0433\u043e\u043d\u043a\u0430<\/strong>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0447\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043e\u0434\u0438\u043d \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">toggleState<\/mark><\/code> \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u0410\u043a\u0442\u043e\u0440\u044b <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">actor<\/mark><\/code> \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u043c\u0438, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">initializeStateIfNeeded<\/mark><\/code> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0430.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0422\u0435\u043f\u0435\u0440\u044c, \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u00abifNeeded\u00bb \u0437\u0434\u0435\u0441\u044c \u043a\u0430\u043a \u0431\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041c\u044b \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">state<\/mark><\/code>, \u043a\u0430\u043a \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0432 UI \u0432\u044b\u0448\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u043e\u0447\u044c. \u041d\u043e \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439. \u042d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u0441\u0442\u0430\u0442\u044c \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u0420\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0431\u0435\u0437 \u0447\u0435\u0433\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 <a href=\"https:\/\/github.com\/mattmassicotte\/Lock\">\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438<\/a>.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u041f\u043e\u0434\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438\u0442\u043e\u0433\u043e\u0432<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u043b\u0435\u0433\u0447\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0433\u043e\u043d\u043a\u0438 \u0441 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">async \/ await<\/mark><\/code>, \u0447\u0435\u043c \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">completionHandler<\/mark><\/code>. \u0412\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u043a\u043e\u0434\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0441\u0442\u0430\u043b\u0438 \u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043c\u043d\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u043c\u0438. \u042d\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b <span style=\"font-weight: 400;\"><code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">completionHandler<\/mark><\/code><\/span><\/span> <span style=\"font-weight: 400;\">\u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f! \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043e\u0449\u043d\u044b\u043c\u0438. \u041d\u043e \u0442\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">async<\/mark><\/code> \u043a\u043e\u0434\u043e\u043c, \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043c\u043e\u0438\u043c \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0435\u043c.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u0437\u0430\u043d\u044f\u043b\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u0447\u0442\u043e\u0431\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u044c \u0447\u0443\u0432\u0441\u0442\u0432\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u0434\u0443\u043c\u044b\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0441 await.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u041e, \u0438 \u0435\u0441\u043b\u0438 \u0432\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u0430\u043c \u0442\u0440\u0443\u0434\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0433\u043e\u043d\u043a\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0430\u043a\u0442\u043e\u0440\u0430 actor, \u0432\u044b \u043d\u0435 \u043e\u0434\u0438\u043d\u043e\u043a\u0438. \u0423 \u043c\u043d\u043e\u0433\u0438\u0445 \u043b\u044e\u0434\u0435\u0439, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043c\u0435\u043d\u044f, \u0431\u044b\u043b\u0438 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 <a href=\"https:\/\/github.com\/mattmassicotte\/Lock\">\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 <\/a>\u0438 <a href=\"https:\/\/github.com\/groue\/Semaphore\">\u0441\u0435\u043c\u0430\u0444\u043e\u0440\u044b<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0432\u0441\u0435 \u0435\u0449\u0451\u00a0 \u043d\u0430\u0445\u043e\u0436\u0443 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438. \u041d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u0435\u0449\u0435 \u043f\u0440\u043e\u0449\u0435, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0443\u0447\u0448\u0438\u043c. \u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0430\u043a\u0442\u043e\u0440\u0430\u043c\u0438 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">actor<\/mark><\/code>\u2014 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0430\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u0435\u043d \u0430\u043a\u0442\u043e\u0440 <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">actor<\/mark><\/code> \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c. \u041f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u043e\u0434\u043d\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u0439 (\u0442\u043e\u043b\u044c\u043a\u043e <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">MainActor<\/mark><\/code>) \u043a\u043e\u0434 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0433\u043e\u043d\u043a\u0430\u043c\u0438.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u0418 \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0441\u043b\u0443\u0436\u0431\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u2014 \u044d\u0442\u043e \u0442\u043e, \u0447\u0435\u0433\u043e \u043c\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0447\u0430\u0441\u0442\u043e <code><mark style=\"background-color:#e2e2e2\" class=\"has-inline-color\">AsyncStream<\/mark><\/code> \u043c\u043e\u0436\u0435\u0442 \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439.<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400;\">\u042f \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e, \u0447\u0442\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u0445\u043e\u0442\u044f\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u042d\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e. \u042f \u043f\u043e\u043b\u0443\u0447\u0430\u044e \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043e <strong>SwiftData<\/strong> \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0438 \u044f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0438\u043c \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f! \u041d\u043e \u044f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043c\u044b \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043c\u043d\u043e\u0433\u043e \u0432\u0430\u0436\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439! \u0423\u043c\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c <strong>\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0433\u043e\u043d\u043a\u0438 <\/strong>\u0438 \u0434\u0443\u043c\u0430\u0442\u044c \u043e\u0431 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0432\u0430\u0436\u043d\u044b, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <strong>Swift concurrency.<\/strong><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u042d\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 Concurrency Step-by-Step: Stateful Systems \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0435\u0440\u0432\u043e\u043c \u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0441\u0442\u0430\u0445 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447! \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0438\u0448\u0443\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f &hellip; <a href=\"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/\">\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[125,124],"tags":[127,126],"class_list":["post-16492","post","type-post","status-publish","format-standard","hentry","category-concurrency","category-swift-6","tag-concurrency","tag-swift-6"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u042d\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 Concurrency Step-by-Step: Stateful Systems \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0435\u0440\u0432\u043e\u043c \u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0441\u0442\u0430\u0445 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447! \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0438\u0448\u0443\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f &quot;\u043f\u043e \u0441\u0430\u043c\u044b\u0435 \u0443\u0448\u0438&quot; \u0432 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 SwiftUI, \u043a\u043e\u0442\u043e\u0440\u043e\u0435\" \/>\n\t<meta name=\"robots\" content=\"max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n\t<meta name=\"author\" content=\"tatiana.kornilova@gmail.com\"\/>\n\t<meta name=\"keywords\" content=\"swift concurrency,swift 6,data race,@mainactor,actor,task,async \/ await,reentrancy,\u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c,main thread\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"ru_RU\" \/>\n\t\t<meta property=\"og:site_name\" content=\"\u041e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043a\u0443\u0440\u0441 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 iOS+Swift \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. | \u0420\u0443\u0441\u0441\u043a\u0438\u0439 \u043d\u0435\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u043f\u0435\u043a\u0442 \u043b\u0435\u043a\u0446\u0438\u0439 \u0421\u0442\u044d\u043d\u0444\u043e\u0440\u0434\u0441\u043a\u043e\u0433\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430 &quot; \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 iOS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439&quot; 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 , 2023,  2024,  2025  \u0438 2026 \u0433\u0433., \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\u043c\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0435\u0439 \u043a\u0443\u0440\u0441\u043e\u0432 \u043a \u043d\u043e\u0432\u044b\u043c \u0432\u0435\u0440\u0441\u0438\u044f\u043c Swift, Objective-C \u0438 iOS.\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c: \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c | \u041e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043a\u0443\u0440\u0441 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 iOS+Swift \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.\" \/>\n\t\t<meta property=\"og:description\" content=\"\u042d\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 Concurrency Step-by-Step: Stateful Systems \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0435\u0440\u0432\u043e\u043c \u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0441\u0442\u0430\u0445 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447! \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0438\u0448\u0443\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f &quot;\u043f\u043e \u0441\u0430\u043c\u044b\u0435 \u0443\u0448\u0438&quot; \u0432 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 SwiftUI, \u043a\u043e\u0442\u043e\u0440\u043e\u0435\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2025-01-22T17:00:09+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2025-01-25T13:44:14+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c: \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c | \u041e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043a\u0443\u0440\u0441 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 iOS+Swift \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.\" \/>\n\t\t<meta name=\"twitter:description\" content=\"\u042d\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 Concurrency Step-by-Step: Stateful Systems \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0435\u0440\u0432\u043e\u043c \u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0441\u0442\u0430\u0445 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447! \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0438\u0448\u0443\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f &quot;\u043f\u043e \u0441\u0430\u043c\u044b\u0435 \u0443\u0448\u0438&quot; \u0432 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 SwiftUI, \u043a\u043e\u0442\u043e\u0440\u043e\u0435\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\\\/#article\",\"name\":\"\\u041c\\u043d\\u043e\\u0433\\u043e\\u043f\\u043e\\u0442\\u043e\\u0447\\u043d\\u043e\\u0441\\u0442\\u044c \\u043f\\u043e \\u0448\\u0430\\u0433\\u0430\\u043c: \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u044b \\u0441 \\u0438\\u0437\\u043c\\u0435\\u043d\\u044f\\u0435\\u043c\\u044b\\u043c \\u0441\\u043e\\u0441\\u0442\\u043e\\u044f\\u043d\\u0438\\u0435\\u043c | \\u041e\\u0431\\u0443\\u0447\\u0430\\u044e\\u0449\\u0438\\u0439 \\u043a\\u0443\\u0440\\u0441 \\u043f\\u043e \\u0440\\u0430\\u0437\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0435 iOS+Swift \\u043f\\u0440\\u0438\\u043b\\u043e\\u0436\\u0435\\u043d\\u0438\\u0439.\",\"headline\":\"\\u041c\\u043d\\u043e\\u0433\\u043e\\u043f\\u043e\\u0442\\u043e\\u0447\\u043d\\u043e\\u0441\\u0442\\u044c \\u043f\\u043e \\u0448\\u0430\\u0433\\u0430\\u043c: \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u044b \\u0441 \\u0438\\u0437\\u043c\\u0435\\u043d\\u044f\\u0435\\u043c\\u044b\\u043c \\u0441\\u043e\\u0441\\u0442\\u043e\\u044f\\u043d\\u0438\\u0435\\u043c\",\"author\":{\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/author\\\/tatiana-lornilovagmail-com\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/lh7-rt.googleusercontent.com\\\/docsz\\\/AD_4nXfZy2n3PeojJMZV2GkNPpsDEXcVBwMFA_88_soxzhuNvAL3vbRgPP2Ofgb4FoGosN3JS7blA5nr8Is-sdudHLJUVqPOP20WFrn4TWjR_MsqG4YXPcN9iIbVURqu9V4li0a5U8nJuA?key=MTlMale8ClV0WfwnN3wjAg2P\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\\\/#articleImage\"},\"datePublished\":\"2025-01-22T17:00:09+00:00\",\"dateModified\":\"2025-01-25T13:44:14+00:00\",\"inLanguage\":\"ru-RU\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\\\/#webpage\"},\"articleSection\":\"Concurrency, Swift 6, Concurrency, Swift 6\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/category\\\/swift-6\\\/#listItem\",\"name\":\"Swift 6\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/category\\\/swift-6\\\/#listItem\",\"position\":2,\"name\":\"Swift 6\",\"item\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/category\\\/swift-6\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\\\/#listItem\",\"name\":\"\\u041c\\u043d\\u043e\\u0433\\u043e\\u043f\\u043e\\u0442\\u043e\\u0447\\u043d\\u043e\\u0441\\u0442\\u044c \\u043f\\u043e \\u0448\\u0430\\u0433\\u0430\\u043c: \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u044b \\u0441 \\u0438\\u0437\\u043c\\u0435\\u043d\\u044f\\u0435\\u043c\\u044b\\u043c \\u0441\\u043e\\u0441\\u0442\\u043e\\u044f\\u043d\\u0438\\u0435\\u043c\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\\\/#listItem\",\"position\":3,\"name\":\"\\u041c\\u043d\\u043e\\u0433\\u043e\\u043f\\u043e\\u0442\\u043e\\u0447\\u043d\\u043e\\u0441\\u0442\\u044c \\u043f\\u043e \\u0448\\u0430\\u0433\\u0430\\u043c: \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u044b \\u0441 \\u0438\\u0437\\u043c\\u0435\\u043d\\u044f\\u0435\\u043c\\u044b\\u043c \\u0441\\u043e\\u0441\\u0442\\u043e\\u044f\\u043d\\u0438\\u0435\\u043c\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/category\\\/swift-6\\\/#listItem\",\"name\":\"Swift 6\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/#person\",\"name\":\"tatiana.kornilova@gmail.com\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\\\/#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/33ccc19059014d8a7849c3621afa2b66a5f3e50ac7291c91c30ff35df5747628?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"tatiana.kornilova@gmail.com\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/author\\\/tatiana-lornilovagmail-com\\\/#author\",\"url\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/author\\\/tatiana-lornilovagmail-com\\\/\",\"name\":\"tatiana.kornilova@gmail.com\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/33ccc19059014d8a7849c3621afa2b66a5f3e50ac7291c91c30ff35df5747628?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"tatiana.kornilova@gmail.com\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\\\/#webpage\",\"url\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\\\/\",\"name\":\"\\u041c\\u043d\\u043e\\u0433\\u043e\\u043f\\u043e\\u0442\\u043e\\u0447\\u043d\\u043e\\u0441\\u0442\\u044c \\u043f\\u043e \\u0448\\u0430\\u0433\\u0430\\u043c: \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u044b \\u0441 \\u0438\\u0437\\u043c\\u0435\\u043d\\u044f\\u0435\\u043c\\u044b\\u043c \\u0441\\u043e\\u0441\\u0442\\u043e\\u044f\\u043d\\u0438\\u0435\\u043c | \\u041e\\u0431\\u0443\\u0447\\u0430\\u044e\\u0449\\u0438\\u0439 \\u043a\\u0443\\u0440\\u0441 \\u043f\\u043e \\u0440\\u0430\\u0437\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0435 iOS+Swift \\u043f\\u0440\\u0438\\u043b\\u043e\\u0436\\u0435\\u043d\\u0438\\u0439.\",\"description\":\"\\u042d\\u0442\\u043e \\u043f\\u0435\\u0440\\u0435\\u0432\\u043e\\u0434 \\u0441\\u0442\\u0430\\u0442\\u044c\\u0438 Concurrency Step-by-Step: Stateful Systems \\u0412 \\u043f\\u0440\\u0435\\u0434\\u044b\\u0434\\u0443\\u0449\\u0438\\u0445 \\u043f\\u0435\\u0440\\u0432\\u043e\\u043c \\u0438 \\u0432\\u043e \\u0432\\u0442\\u043e\\u0440\\u043e\\u043c \\u043f\\u043e\\u0441\\u0442\\u0430\\u0445 \\u044f \\u0438\\u0441\\u043f\\u043e\\u043b\\u044c\\u0437\\u043e\\u0432\\u0430\\u043b \\u0438\\u0441\\u043a\\u043b\\u044e\\u0447\\u0438\\u0442\\u0435\\u043b\\u044c\\u043d\\u043e \\u0441\\u0438\\u0441\\u0442\\u0435\\u043c\\u0443 \\u0442\\u043e\\u043b\\u044c\\u043a\\u043e \\u0434\\u043b\\u044f \\u0447\\u0442\\u0435\\u043d\\u0438\\u044f. \\u042d\\u0442\\u043e \\u0434\\u0430\\u043b\\u0435\\u043a\\u043e \\u043e\\u0442 \\u0440\\u0435\\u0430\\u043b\\u044c\\u043d\\u044b\\u0445 \\u0437\\u0430\\u0434\\u0430\\u0447! \\u0420\\u0435\\u0430\\u043b\\u044c\\u043d\\u044b\\u0435 \\u043f\\u0440\\u0438\\u043b\\u043e\\u0436\\u0435\\u043d\\u0438\\u044f \\u043f\\u0438\\u0448\\u0443\\u0442 \\u0434\\u0430\\u043d\\u043d\\u044b\\u0435 \\u0432 \\u043b\\u043e\\u043a\\u0430\\u043b\\u044c\\u043d\\u043e\\u0435 \\u0445\\u0440\\u0430\\u043d\\u0438\\u043b\\u0438\\u0449\\u0435, \\u0432 \\u0443\\u0434\\u0430\\u043b\\u0435\\u043d\\u043d\\u044b\\u0435 \\u0441\\u0435\\u0440\\u0432\\u0438\\u0441\\u044b \\u0438, \\u043a\\u0430\\u043a \\u043f\\u0440\\u0430\\u0432\\u0438\\u043b\\u043e, \\u043d\\u0430\\u0445\\u043e\\u0434\\u044f\\u0442\\u0441\\u044f \\\"\\u043f\\u043e \\u0441\\u0430\\u043c\\u044b\\u0435 \\u0443\\u0448\\u0438\\\" \\u0432 \\u0438\\u0437\\u043c\\u0435\\u043d\\u044f\\u0435\\u043c\\u043e\\u043c \\u0441\\u043e\\u0441\\u0442\\u043e\\u044f\\u043d\\u0438\\u0438. \\u0412 \\u044d\\u0442\\u043e\\u043c \\u043f\\u043e\\u0441\\u0442\\u0435 \\u043c\\u044b \\u0441\\u043e\\u0431\\u0438\\u0440\\u0430\\u0435\\u043c\\u0441\\u044f \\u0441\\u043e\\u0437\\u0434\\u0430\\u0442\\u044c \\u043f\\u0440\\u0438\\u043b\\u043e\\u0436\\u0435\\u043d\\u0438\\u0435 SwiftUI, \\u043a\\u043e\\u0442\\u043e\\u0440\\u043e\\u0435\",\"inLanguage\":\"ru-RU\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/author\\\/tatiana-lornilovagmail-com\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/author\\\/tatiana-lornilovagmail-com\\\/#author\"},\"datePublished\":\"2025-01-22T17:00:09+00:00\",\"dateModified\":\"2025-01-25T13:44:14+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/#website\",\"url\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/\",\"name\":\"\\u041e\\u0431\\u0443\\u0447\\u0430\\u044e\\u0449\\u0438\\u0439 \\u043a\\u0443\\u0440\\u0441 \\u043f\\u043e \\u0440\\u0430\\u0437\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0435 iOS+Swift \\u043f\\u0440\\u0438\\u043b\\u043e\\u0436\\u0435\\u043d\\u0438\\u0439.\",\"description\":\"\\u0420\\u0443\\u0441\\u0441\\u043a\\u0438\\u0439 \\u043d\\u0435\\u0430\\u0432\\u0442\\u043e\\u0440\\u0438\\u0437\\u043e\\u0432\\u0430\\u043d\\u043d\\u044b\\u0439 \\u043a\\u043e\\u043d\\u0441\\u043f\\u0435\\u043a\\u0442 \\u043b\\u0435\\u043a\\u0446\\u0438\\u0439 \\u0421\\u0442\\u044d\\u043d\\u0444\\u043e\\u0440\\u0434\\u0441\\u043a\\u043e\\u0433\\u043e \\u0443\\u043d\\u0438\\u0432\\u0435\\u0440\\u0441\\u0438\\u0442\\u0435\\u0442\\u0430 \\\" \\u0420\\u0430\\u0437\\u0440\\u0430\\u0431\\u043e\\u0442\\u043a\\u0430 iOS \\u043f\\u0440\\u0438\\u043b\\u043e\\u0436\\u0435\\u043d\\u0438\\u0439\\\" 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 , 2023,  2024,  2025  \\u0438 2026 \\u0433\\u0433., \\u0441\\u043e\\u043f\\u0440\\u043e\\u0432\\u043e\\u0436\\u0434\\u0430\\u0435\\u043c\\u044b\\u0439 \\u0440\\u0435\\u0448\\u0435\\u043d\\u0438\\u044f\\u043c\\u0438 \\u0437\\u0430\\u0434\\u0430\\u043d\\u0438\\u0439 \\u0438 \\u0434\\u043e\\u043f\\u043e\\u043b\\u043d\\u0435\\u043d\\u0438\\u044f\\u043c\\u0438, \\u0441\\u0432\\u044f\\u0437\\u0430\\u043d\\u043d\\u044b\\u043c\\u0438 \\u0441 \\u0430\\u0434\\u0430\\u043f\\u0442\\u0430\\u0446\\u0438\\u0435\\u0439 \\u043a\\u0443\\u0440\\u0441\\u043e\\u0432 \\u043a \\u043d\\u043e\\u0432\\u044b\\u043c \\u0432\\u0435\\u0440\\u0441\\u0438\\u044f\\u043c Swift, Objective-C \\u0438 iOS.\",\"inLanguage\":\"ru-RU\",\"publisher\":{\"@id\":\"https:\\\/\\\/bestkora.com\\\/IosDeveloper\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c: \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c | \u041e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043a\u0443\u0440\u0441 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 iOS+Swift \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.","description":"\u042d\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 Concurrency Step-by-Step: Stateful Systems \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0435\u0440\u0432\u043e\u043c \u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0441\u0442\u0430\u0445 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447! \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0438\u0448\u0443\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \"\u043f\u043e \u0441\u0430\u043c\u044b\u0435 \u0443\u0448\u0438\" \u0432 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 SwiftUI, \u043a\u043e\u0442\u043e\u0440\u043e\u0435","canonical_url":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/","robots":"max-snippet:-1, max-image-preview:large, max-video-preview:-1","keywords":"swift concurrency,swift 6,data race,@mainactor,actor,task,async \/ await,reentrancy,\u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c,main thread","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/#article","name":"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c: \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c | \u041e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043a\u0443\u0440\u0441 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 iOS+Swift \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.","headline":"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c: \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c","author":{"@id":"https:\/\/bestkora.com\/IosDeveloper\/author\/tatiana-lornilovagmail-com\/#author"},"publisher":{"@id":"https:\/\/bestkora.com\/IosDeveloper\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXfZy2n3PeojJMZV2GkNPpsDEXcVBwMFA_88_soxzhuNvAL3vbRgPP2Ofgb4FoGosN3JS7blA5nr8Is-sdudHLJUVqPOP20WFrn4TWjR_MsqG4YXPcN9iIbVURqu9V4li0a5U8nJuA?key=MTlMale8ClV0WfwnN3wjAg2P","@id":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/#articleImage"},"datePublished":"2025-01-22T17:00:09+00:00","dateModified":"2025-01-25T13:44:14+00:00","inLanguage":"ru-RU","mainEntityOfPage":{"@id":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/#webpage"},"isPartOf":{"@id":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/#webpage"},"articleSection":"Concurrency, Swift 6, Concurrency, Swift 6"},{"@type":"BreadcrumbList","@id":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/bestkora.com\/IosDeveloper#listItem","position":1,"name":"Home","item":"https:\/\/bestkora.com\/IosDeveloper","nextItem":{"@type":"ListItem","@id":"https:\/\/bestkora.com\/IosDeveloper\/category\/swift-6\/#listItem","name":"Swift 6"}},{"@type":"ListItem","@id":"https:\/\/bestkora.com\/IosDeveloper\/category\/swift-6\/#listItem","position":2,"name":"Swift 6","item":"https:\/\/bestkora.com\/IosDeveloper\/category\/swift-6\/","nextItem":{"@type":"ListItem","@id":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/#listItem","name":"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c: \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c"},"previousItem":{"@type":"ListItem","@id":"https:\/\/bestkora.com\/IosDeveloper#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/#listItem","position":3,"name":"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c: \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c","previousItem":{"@type":"ListItem","@id":"https:\/\/bestkora.com\/IosDeveloper\/category\/swift-6\/#listItem","name":"Swift 6"}}]},{"@type":"Person","@id":"https:\/\/bestkora.com\/IosDeveloper\/#person","name":"tatiana.kornilova@gmail.com","image":{"@type":"ImageObject","@id":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/33ccc19059014d8a7849c3621afa2b66a5f3e50ac7291c91c30ff35df5747628?s=96&d=mm&r=g","width":96,"height":96,"caption":"tatiana.kornilova@gmail.com"}},{"@type":"Person","@id":"https:\/\/bestkora.com\/IosDeveloper\/author\/tatiana-lornilovagmail-com\/#author","url":"https:\/\/bestkora.com\/IosDeveloper\/author\/tatiana-lornilovagmail-com\/","name":"tatiana.kornilova@gmail.com","image":{"@type":"ImageObject","@id":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/33ccc19059014d8a7849c3621afa2b66a5f3e50ac7291c91c30ff35df5747628?s=96&d=mm&r=g","width":96,"height":96,"caption":"tatiana.kornilova@gmail.com"}},{"@type":"WebPage","@id":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/#webpage","url":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/","name":"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c: \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c | \u041e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043a\u0443\u0440\u0441 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 iOS+Swift \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.","description":"\u042d\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 Concurrency Step-by-Step: Stateful Systems \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0435\u0440\u0432\u043e\u043c \u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0441\u0442\u0430\u0445 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447! \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0438\u0448\u0443\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \"\u043f\u043e \u0441\u0430\u043c\u044b\u0435 \u0443\u0448\u0438\" \u0432 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 SwiftUI, \u043a\u043e\u0442\u043e\u0440\u043e\u0435","inLanguage":"ru-RU","isPartOf":{"@id":"https:\/\/bestkora.com\/IosDeveloper\/#website"},"breadcrumb":{"@id":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/#breadcrumblist"},"author":{"@id":"https:\/\/bestkora.com\/IosDeveloper\/author\/tatiana-lornilovagmail-com\/#author"},"creator":{"@id":"https:\/\/bestkora.com\/IosDeveloper\/author\/tatiana-lornilovagmail-com\/#author"},"datePublished":"2025-01-22T17:00:09+00:00","dateModified":"2025-01-25T13:44:14+00:00"},{"@type":"WebSite","@id":"https:\/\/bestkora.com\/IosDeveloper\/#website","url":"https:\/\/bestkora.com\/IosDeveloper\/","name":"\u041e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043a\u0443\u0440\u0441 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 iOS+Swift \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.","description":"\u0420\u0443\u0441\u0441\u043a\u0438\u0439 \u043d\u0435\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u043f\u0435\u043a\u0442 \u043b\u0435\u043a\u0446\u0438\u0439 \u0421\u0442\u044d\u043d\u0444\u043e\u0440\u0434\u0441\u043a\u043e\u0433\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430 \" \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 iOS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439\" 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 , 2023,  2024,  2025  \u0438 2026 \u0433\u0433., \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\u043c\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0435\u0439 \u043a\u0443\u0440\u0441\u043e\u0432 \u043a \u043d\u043e\u0432\u044b\u043c \u0432\u0435\u0440\u0441\u0438\u044f\u043c Swift, Objective-C \u0438 iOS.","inLanguage":"ru-RU","publisher":{"@id":"https:\/\/bestkora.com\/IosDeveloper\/#person"}}]},"og:locale":"ru_RU","og:site_name":"\u041e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043a\u0443\u0440\u0441 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 iOS+Swift \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. | \u0420\u0443\u0441\u0441\u043a\u0438\u0439 \u043d\u0435\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u043f\u0435\u043a\u0442 \u043b\u0435\u043a\u0446\u0438\u0439 \u0421\u0442\u044d\u043d\u0444\u043e\u0440\u0434\u0441\u043a\u043e\u0433\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430 &quot; \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 iOS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439&quot; 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 , 2023,  2024,  2025  \u0438 2026 \u0433\u0433., \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\u043c\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0435\u0439 \u043a\u0443\u0440\u0441\u043e\u0432 \u043a \u043d\u043e\u0432\u044b\u043c \u0432\u0435\u0440\u0441\u0438\u044f\u043c Swift, Objective-C \u0438 iOS.","og:type":"article","og:title":"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c: \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c | \u041e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043a\u0443\u0440\u0441 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 iOS+Swift \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.","og:description":"\u042d\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 Concurrency Step-by-Step: Stateful Systems \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0435\u0440\u0432\u043e\u043c \u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0441\u0442\u0430\u0445 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447! \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0438\u0448\u0443\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f &quot;\u043f\u043e \u0441\u0430\u043c\u044b\u0435 \u0443\u0448\u0438&quot; \u0432 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 SwiftUI, \u043a\u043e\u0442\u043e\u0440\u043e\u0435","og:url":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/","article:published_time":"2025-01-22T17:00:09+00:00","article:modified_time":"2025-01-25T13:44:14+00:00","twitter:card":"summary","twitter:title":"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c: \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c | \u041e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043a\u0443\u0440\u0441 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 iOS+Swift \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.","twitter:description":"\u042d\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 Concurrency Step-by-Step: Stateful Systems \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u0435\u0440\u0432\u043e\u043c \u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0441\u0442\u0430\u0445 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447! \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0438\u0448\u0443\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f &quot;\u043f\u043e \u0441\u0430\u043c\u044b\u0435 \u0443\u0448\u0438&quot; \u0432 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 SwiftUI, \u043a\u043e\u0442\u043e\u0440\u043e\u0435"},"aioseo_meta_data":{"post_id":"16492","title":null,"description":null,"keywords":[{"label":"Swift concurrency","value":"Swift concurrency"},{"label":"Swift 6","value":"Swift 6"},{"label":"Data race","value":"Data race"},{"label":"@MainActor","value":"@MainActor"},{"label":"actor","value":"actor"},{"label":"Task","value":"Task"},{"label":"async \/ await","value":"async \/ await"},{"label":"reentrancy","value":"reentrancy"},{"label":"\u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c","value":"\u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c"},{"label":"main thread","value":"main thread"}],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2025-01-22 16:59:02","updated":"2026-02-22 19:55:18","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/bestkora.com\/IosDeveloper\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/bestkora.com\/IosDeveloper\/category\/swift-6\/\" title=\"Swift 6\">Swift 6<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c: \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/bestkora.com\/IosDeveloper"},{"label":"Swift 6","link":"https:\/\/bestkora.com\/IosDeveloper\/category\/swift-6\/"},{"label":"\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0448\u0430\u0433\u0430\u043c: \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c","link":"https:\/\/bestkora.com\/IosDeveloper\/%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%bf%d0%be%d1%82%d0%be%d1%87%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bf%d0%be-%d1%88%d0%b0%d0%b3%d0%b0%d0%bc-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d1%81-%d0%b8%d0%b7\/"}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/posts\/16492","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/comments?post=16492"}],"version-history":[{"count":5,"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/posts\/16492\/revisions"}],"predecessor-version":[{"id":16513,"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/posts\/16492\/revisions\/16513"}],"wp:attachment":[{"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/media?parent=16492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/categories?post=16492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/tags?post=16492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}