{"id":418191,"date":"2024-06-30T02:01:44","date_gmt":"2024-06-30T02:01:44","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=418191"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-30T02:01:44","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=418191","title":{"rendered":"<span>\u041f\u0435\u0440\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 SwiftUI<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0443 \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e SwiftUI, \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u043d\u0438\u0447\u0435\u0433\u043e \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043e\u0442 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0446\u0438\u0438 Apple &#8212; <a href=\"https:\/\/developer.apple.com\/tutorials\/swiftui\" rel=\"noopener noreferrer nofollow\">\u0432\u043e\u0442 \u043e\u043d<\/a>. \u0415\u0441\u043b\u0438 \u043f\u043b\u043e\u0445\u043e \u0441 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u043c, \u0431\u0440\u0430\u0443\u0437\u0435\u0440 Chrome \u0432 \u043f\u043e\u043c\u043e\u0449\u044c, \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u0430. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0432\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0438 99% \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u0442\u043f\u0430\u0434\u0443\u0442 \u0441\u0430\u043c\u0438 \u0441\u043e\u0431\u043e\u0439. \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d \u043d\u0430 \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0445\u043e\u0442\u044f\u0442 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441\u043e SwiftUI.<\/p>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u043e\u0435\u0433\u043e \u0441\u043a\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043c\u043d\u0435\u043d\u0438\u044f \u043e SwiftUI<\/h2>\n<p>\u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0438 \u043a <strong>Storyboard<\/strong> \u044f \u0431\u043e\u043b\u0435\u0435 \u043d\u0435 \u0432\u0435\u0440\u043d\u0443\u0441\u044c. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c UIKit, \u043d\u043e \u0434\u0443\u043c\u0430\u044e \u0441 \u0442\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044d\u0442\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e\u0439\u0434\u0435\u0442 \u043d\u0430 \u043d\u0435\u0442. \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0430\u043a \u0436\u0435 \u0443\u0434\u0438\u0432\u043b\u044f\u0435\u0442. \u0414\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0438\u043a\u043e\u043c\u0443 \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0443, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u044e\u0434\u0435\u0439, \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0438 \u043c\u043d\u0435\u043d\u0438\u0439, \u043f\u043e\u0436\u0430\u043b\u0443\u0439 \u043d\u0430\u0447\u043d\u0443.<\/p>\n<h2>\u041e \u0447\u0435\u043c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f<\/h2>\n<ul>\n<li>\n<p>\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e SwiftUI<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u044e\u0430\u043d\u0441\u044b \u0440\u0430\u0431\u043e\u0442\u044b SwiftUI<\/p>\n<\/li>\n<li>\n<p>PageView \u043d\u0430 SwiftUI<\/p>\n<\/li>\n<li>\n<p>WebImage \u043d\u0430 SwiftUI (AsyncImage)<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u043c\u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b, \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u0443\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f &#8212; \u043e\u0431\u043e\u0438 \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0441\u0442\u043e\u043b iPhone. \u041a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u0449\u0443\u043f\u0430\u0442\u044c, \u043e\u043d\u043e \u0435\u0441\u0442\u044c \u0432 AppStore  &#8212; <a href=\"https:\/\/apps.apple.com\/ru\/app\/%D0%BE%D0%B1%D0%BE%D0%B8-%D0%B8-%D1%82%D0%B5%D0%BC%D1%8B-%D0%B2-hd-%D0%B8-4k-wallbe\/id1596575218\" rel=\"noopener noreferrer nofollow\">\u0441\u0438\u043b\u044c\u0432\u0443\u043f\u043b\u0435<\/a>. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443\u043c\u0435\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 (Data) \u0432 .cache, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0432 \u0444\u043e\u0442\u043e\u043f\u043b\u0435\u043d\u043a\u0443, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0441\u0435\u0442\u044c\u044e (\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441\u043f\u0438\u0441\u043a\u043e\u0432, \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0442.\u0434.), \u0433\u0440\u0443\u0431\u043e \u0433\u043e\u0432\u043e\u0440\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e. \u041e\u0431 \u044d\u0442\u043e\u043c \u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0442\u0438 \u0440\u0435\u0447\u044c.<\/p>\n<h2>\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e SwiftUI<\/h2>\n<p><strong>@State &#8212; <\/strong>\u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u0430\u044f \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u043e\u043d\u0438 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c.<\/p>\n<pre><code class=\"swift\">struct MyView: View {        @State var text: String = \"\"                var body: some View {         TextField(\"Placeholder\", text: $text)         Text(text)<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c, \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f &#8212; text, \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 <strong><em>String<\/em><\/strong> \u0442.\u0435. \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043f\u043b\u044e\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043e\u0431\u0435\u0440\u0442\u043a\u0435 (<strong><em>Binding&lt;String><\/em><\/strong>). \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0438\u043c\u0435\u043d\u043d\u043e <strong><em>Binding&lt;><\/em>,<\/strong> \u043a\u0430\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <strong><em>TextField()<\/em><\/strong><em> (\u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043f\u043e\u0439\u043c\u0435\u0442\u0435 \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435), <\/em>\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0447\u0435\u0440\u0435\u0437 <strong>$ <\/strong>(\u044d\u0442\u043e \u043d\u0435 \u043e\u0442\u0441\u044b\u043b\u043a\u0430 \u043a php). \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u044d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 (\u0432 SwiftUI, \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c), \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 <strong><em>Text()<\/em><\/strong><em>, <\/em>\u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u043a\u0443 \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u044f<em> <\/em><strong><em>TextField()<\/em><\/strong><em>,<\/em> \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u0443\u0432\u0438\u0434\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 <strong><em>Text()<\/em><\/strong><em>.<\/em> \u041f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u043e\u043b\u0435\u043f\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u043a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043c\u0435\u043d\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443<\/p>\n<pre><code class=\"swift\">struct MyView: View { var myProperty = 0          mutating func myMethod(){         self.myProperty += 1     }          var body: some View {     ...<\/code><\/pre>\n<p>\u043a\u0430\u043a \u0432\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445, \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>mutating, <\/strong>\u0430 \u0432\u043e\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0432 \u043e\u0431\u0435\u0440\u0442\u043a\u0435 <strong><em>Binding&lt;><\/em><\/strong> \u043a\u0430\u043a \u0432\u044b \u0443\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c, \u044d\u0442\u043e \u043d\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f, \u043e\u043d\u0438 \u043f\u043e\u0434\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u043e\u043c\u0443 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e.<\/p>\n<pre><code class=\"swift\">struct MyView: View {     @State var myProperty = 0          func myMethod(){         self.myProperty += 1     }          var body: some View {     ...<\/code><\/pre>\n<p>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <strong><em>Binding&lt;> <\/em><\/strong>\u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u0438 \u0438\u043c \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0441\u0435\u0442\u0442\u0435\u0440\u044b, \u043d\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u0445\u043e\u0434 &#8212; \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <strong><em>onChange<\/em><\/strong><\/p>\n<pre><code class=\"swift\"> \/\/-------- \u0411\u0415\u0417 Binding  struct MyView: View {      var myProperty: Int = 0 {         didSet {             print(\"\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e myProperty \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c\")         }     }     mutating func myMethod(){         self.myProperty += 1     }     var body: some View {         VStack {             Text(String(myProperty))         } ...          \/\/-------- \u0421 Binding  struct MyView: View {      @State var myProperty: Int = 0     func myMethod(){         self.myProperty += 1     }     var body: some View {         VStack {             Text(String(myProperty))         }         .onChange(of: myProperty) { _ in             print(\"\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e myProperty \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c\")         }         ...<\/code><\/pre>\n<p><strong>@Binding &#8212; <\/strong>\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0438\u0437\u0432\u043d\u0435, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u0441 \u043e\u0431\u0435\u0440\u0442\u043a\u043e\u0439<strong> @State<\/strong><\/p>\n<pre><code class=\"swift\">struct MyView: View {      @State var myProperty: String = \"\u0422\u0435\u043a\u0441\u0442\"      var body: some View {         Text(myProperty)         MySecondView(myProperty: $myProperty)     } }          struct MySecondView: View {      @Binding var myProperty: String      var body: some View {         TextField(\"Placeholder\", text: $myProperty)     } }<\/code><\/pre>\n<p>\u0412\u044b\u0448\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c, \u043a\u0430\u043a \u0442\u0435\u043a\u0441\u0442 \u0432 <strong>MyView<\/strong> \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u043f\u043e\u043b\u0435\u043c \u0432\u0432\u043e\u0434\u0430 \u0432 <strong>MySecondView<\/strong>. \u0422\u0435\u043f\u0435\u0440\u044c \u044f \u0434\u0443\u043c\u0430\u044e \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 <strong><em>Binding&lt;> <\/em><\/strong>\u043e\u0431\u0435\u0440\u0442\u043a\u0435. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0438\u0437\u044f\u0449\u043d\u043e\u0435 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439, \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p><strong>@StateObject &#8212; <\/strong>\u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e \u0441\u0443\u0442\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 <strong>@State<\/strong>, \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0441 \u0442\u043e\u0439 \u043b\u0438\u0448\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439, \u0447\u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 <strong>@Binding<\/strong> \u0446\u0435\u043b\u0438\u043a\u043e\u043c (\u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435), \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<pre><code class=\"swift\">struct MyView: View {      @StateObject var myObject: MyClass = MyClass()      var body: some View {         Text(myObject.text)         Text(myObject.title)         MySecondView(myProperty: $myObject.text)     } }          struct MySecondView: View {      @Binding var myProperty: String     var body: some View {         TextField(\"Placeholder\", text: $myProperty)     } }  class MyClass: ObservableObject {     @Published var title: String = \"\"     @Published var text: String = \"\" }<\/code><\/pre>\n<p><strong>@ObservedObject &#8212;<\/strong> \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u0438\u043d\u044f\u0442\u044c<strong> @StateObject <\/strong>\u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f (\u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430).<\/p>\n<pre><code class=\"swift\">struct MyView: View {      @StateObject var myObject: MyClass = MyClass()      var body: some View {         Text(myObject.text)         Text(myObject.title)         MySecondView(myObject: myObject)     } }          struct MySecondView: View {          @ObservedObject var myObject : MyClass     var body: some View {         TextField(\"Placeholder\", text: $myObject.text)     } }<\/code><\/pre>\n<p><strong>@EnvironmentObject &#8212; <\/strong>\u044f \u0431\u044b \u043d\u0430\u0437\u0432\u0430\u043b \u044d\u0442\u043e \u0442\u043e\u0447\u043a\u043e\u0439 \u0432\u0445\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0444\u0440\u0435\u0439\u0432\u043e\u0440\u043a\u0430\u043c\u0438, \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0441 Docker \u0438 \u0442.\u0434., \u0432\u0430\u043c \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0444\u0430\u0439\u043b .env (\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f), \u0442\u0430\u043a \u0432\u043e\u0442<strong> @EnvironmentObject <\/strong>\u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 \u0438 \u0435\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043d\u043e \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0442\u0430\u043a \u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b. \u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e.<\/p>\n<pre><code class=\"swift\">@main struct myApp: App {          @StateObject var myObject: MyClass = MyClass()          var body: some Scene {         WindowGroup {             MyView()                 .environmentObject(myObject)         }     } }<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445, \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0432 \u0435\u0433\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435.<\/p>\n<pre><code class=\"swift\">struct MyView: View {          @EnvironmentObject var myObject: MyClass      var body: some View {         Text(myObject.text)         Text(myObject.title)         MySecondView()     } }          struct MySecondView: View {          @EnvironmentObject var myObject: MyClass          var body: some View {         TextField(\"Placeholder\", text: $myObject.text)     } }<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0443\u0434\u043e\u0431\u043d\u043e, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0440\u044f\u0434 \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432 \u0442.\u043a. <strong>@EnvironmentObject<\/strong> (\u0441\u0440\u0435\u0434\u0430) \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c init() \u0443 \u0412\u0430\u0441 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f (\u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430).<\/p>\n<p><strong>.onAppear<\/strong> \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 &#8212; \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0432 init()<\/p>\n<pre><code class=\"swift\">struct MyView: View {      @StateObject var myObject: MyClass = MyClass()      var body: some View {         Text(myObject.text)         Text(myObject.title)         MySecondView(myObject)     } }          struct MySecondView: View {          @ObservedObject var myObject : MyClass          func hello() {         self.myObject.text = \"hello\"     }          init(_ myObject: MyClass){         self.myObject = myObject         self.hello()     }          var body: some View {         TextField(\"Placeholder\", text: $myObject.text)     } }<\/code><\/pre>\n<p>\u043d\u043e \u043a\u0430\u043a \u043c\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438 \u0440\u0430\u043d\u0435\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <strong>@EnvironmentObject <\/strong>\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c, <strong>onAppear <\/strong>\u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0438 \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443<\/p>\n<pre><code class=\"swift\">struct MyView: View {      @StateObject var myObject: MyClass = MyClass()      var body: some View {         Text(myObject.text)         Text(myObject.title)         MySecondView(myObject: myObject)     } }          struct MySecondView: View {          @ObservedObject var myObject : MyClass          func hello() {         self.myObject.text = \"hello\"     }          var body: some View {         TextField(\"Placeholder\", text: $myObject.text)             .onAppear{                 self.hello()             }     } }<\/code><\/pre>\n<p>\u041a\u043e\u0434 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 \u0432 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435, \u0447\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u043d\u0435\u0436\u0435\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0437\u0434\u043e\u0440\u043e\u0432\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0438\u043c\u0435\u043d\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p><strong>.onDisappear<\/strong> \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 &#8212; \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c <strong>onAppear, <\/strong>\u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043a\u0438\u0434\u0430\u0435\u0442 \u044d\u043a\u0440\u0430\u043d.<\/p>\n<p><strong>\u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b<\/strong> &#8212; \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438\/\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f View, \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0441\u043e\u0431\u043e \u043d\u0435\u0447\u0435\u0433\u043e, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0442\u044f\u0436\u0435\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043b\u0438\u0441\u0442\u0438\u043d\u0433<\/p>\n<pre><code class=\"swift\">struct MySecondView: View {          @ObservedObject var myObject : MyClass          func hello() {         self.myObject.text = \"hello\"     }          var body: some View {         TextField(\"Placeholder\", text: $myObject.text)             .onAppear{                 self.myObject                     .clearText()                     .clearTitle(){                         print(\"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u0447\u0438\u0449\u0435\u043d\")                     }             }     } }  class MyClass: ObservableObject {     @Published var title: String = \"cell\"     @Published var text: String = \"cell\"          public func clearText() -> MyClass {         self.text = \"d\"         return self     }          public func clearTitle(_ closure: @escaping () -> Void) -> MyClass {         self.title = \"d\"         return self     } }<\/code><\/pre>\n<p>\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<h2>\u041d\u044e\u0430\u043d\u0441\u044b SwiftUI<\/h2>\n<p><strong>TableView <\/strong><\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043a\u0440\u043e\u0432\u043e\u043f\u0438\u0439\u0446\u0430 \u0432 \u043c\u043e\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u043e\u0436\u0438\u0440\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0435\u0440\u0432\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u044d\u043a\u0440\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0447\u0435\u0433\u043e \u043b\u0438\u0431\u043e, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440.<\/p>\n<pre><code class=\"swift\">TabView { ...   Content()   Content()   ... } .tabViewStyle(.page(indexDisplayMode: .never))<\/code><\/pre>\n<p>\u041e\u043d \u043c\u0430\u043d\u0438\u0442 \u0441\u0432\u043e\u0435\u0439 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438, \u0437\u0430\u0431\u0435\u0439\u0442\u0435 \u0432 Google <em>&#171;PageView SwiftUI&#187; <\/em>\u0438 \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f TabView, \u043d\u043e \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0442 \u043b\u0443\u043a\u0430\u0432\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u0441\u0435\u0433\u043e \u043f\u0430\u0440\u0443 \u0441\u043e\u0442\u0435\u043d \u043f\u0443\u0441\u0442\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u0441 \u0446\u0432\u0435\u0442\u043e\u043c, \u0432\u0441\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043b\u0430\u0433\u0430\u0442\u044c \u0434\u0430\u0436\u0435 \u043d\u0430 iPhone 13 Pro<\/p>\n<pre><code class=\"swift\">struct MyView: View {      var body: some View {         TabView {             ForEach((1...100).reversed(), id: \\.self) { _ in                 Color.gray                 Color.green             }         }         .tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))     } }<\/code><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0442\u044b\u0441\u044f\u0447\u0430\u0445, \u0440\u0435\u0447\u0438 \u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0431\u044b\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043e\u0442 Apple, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u0441\u044f \u0432\u044b\u0448\u0435, \u044f \u043d\u0430\u0448\u0435\u043b \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0436\u0435, \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0443 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c <strong>PageView<\/strong>.<\/p>\n<p><strong>DispatchQueue<\/strong><\/p>\n<p>\u0412\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 ObservableObject \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0442.\u043a. SwiftUI \u043f\u043e\u0434\u043e\u0431\u0435\u043d UIKit, \u0433\u0434\u0435 \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435. \u0423 \u0412\u0430\u0441 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0438 \u0432\u043d\u0435, \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0442, \u043d\u043e \u043a \u043a\u0430\u043a\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<pre><code class=\"swift\">... func myMethod(){ let cell: Int = 10   let result: Int = cell * 20   DispatchQueue.main.async { self.property = result   } } ...<\/code><\/pre>\n<p><strong>Combine<\/strong><\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u0432 \u043d\u0435\u043c \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <strong>URLSession.shared.downloadTask, <\/strong>\u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u043b\u0435\u0433\u043a\u0438\u0445 \u043f\u0443\u0442\u0435\u0439 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432<strong> <\/strong>\u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0439<strong> dataTask, <\/strong>\u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Apple \u0435\u0433\u043e \u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0424\u0430\u0439\u043b\u044b \u043a \u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f. \u042f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u043e\u043d \u043c\u0430\u043d\u0438\u0442 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u043e\u0439, \u043d\u043e \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u044d\u0442\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e \u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0438\u0436\u0435 \u0432 WebImage.<\/p>\n<h2>PageView<\/h2>\n<p>Apple \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0432 SwiftUI \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0435\u0431\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>UIViewControllerRepresentable<\/strong><\/p>\n<pre><code class=\"swift\">struct PageView: UIViewControllerRepresentable {          @ObservedObject var store: Store      func makeCoordinator() -> Coordinator {         Coordinator(self)     }      func makeUIViewController(context: Context) -> UIPageViewController {         let pageViewController = UIPageViewController(             transitionStyle: .scroll,             navigationOrientation: .horizontal)         pageViewController.dataSource = context.coordinator         pageViewController.delegate = context.coordinator          return pageViewController     }      func updateUIViewController(_ pageViewController: UIPageViewController, context: Context) {         pageViewController.setViewControllers(             [context.coordinator.controllers[store.currentPage]], direction: .forward, animated: true)     }      class Coordinator: NSObject, UIPageViewControllerDataSource, UIPageViewControllerDelegate {         var parent: PageView         var controllers = [UIViewController]()          init(_ pageViewController: PageView) {             parent = pageViewController             controllers = parent.store.arrayPages.map { UIHostingController(rootView: $0) }         }          func pageViewController(             _ pageViewController: UIPageViewController,             viewControllerBefore viewController: UIViewController) -> UIViewController? {             guard let index = controllers.firstIndex(of: viewController) else {                 return nil             }             if index == 0 {                 return controllers.last             }             return controllers[index - 1]         }          func pageViewController(             _ pageViewController: UIPageViewController,             viewControllerAfter viewController: UIViewController) -> UIViewController? {             guard let index = controllers.firstIndex(of: viewController) else {                 return nil             }             if index + 1 == controllers.count {                 return controllers.first             }             return controllers[index + 1]         }          func pageViewController(             _ pageViewController: UIPageViewController,             didFinishAnimating finished: Bool,             previousViewControllers: [UIViewController],             transitionCompleted completed: Bool) {             if completed,                let visibleViewController = pageViewController.viewControllers?.first,                let index = controllers.firstIndex(of: visibleViewController) {                 parent.store.currentPage = index             }         }     } }<\/code><\/pre>\n<p>\u042f \u0434\u0443\u043c\u0430\u044e \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u0430\u043a\u0438\u0445 \u043b\u0438\u0431\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432, \u043a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u043c\u044b \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>@StateObject,<\/strong> <strong>@EnvironmentObject <\/strong>\u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u043b\u044e\u0448\u043a\u0438 SwiftUI, \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/p>\n<pre><code class=\"swift\">struct MyView: View {     @StateObject var store: Store = Store()      var body: some View {         PageView(store: store)     } }  class Store: ObservableObject {     @Published var currentPage: Int = 0     var arrayPages : [Color] {         var result : [Color] = []         for _ in 0...1000 {             result.append(Color.green)             result.append(Color.gray)         }         return result     } }<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439, \u043d\u043e \u0434\u0443\u043c\u0430\u044e \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043f\u043e\u0431\u0430\u043b\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043d\u0435\u0442 \u043d\u0430\u043c\u0435\u043a\u0430 \u043d\u0430 \u043b\u0430\u0433\u0438 \u0434\u0430\u0436\u0435 \u043d\u0430 \u0432\u0438\u043d\u0442\u0430\u0436\u043d\u043e\u043c iPhone 6s. \u041d\u0438\u043a\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0430\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u0433\u0434\u0435 \u043b\u0438\u0431\u043e \u0435\u0449\u0435, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438 \u0442.\u0434. \u0412 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b @StateObject \u0442.\u043a. \u0432 \u043c\u043e\u0435\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e. \u0412 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e.<\/p>\n<h2>WebImage<\/h2>\n<p>SwiftUI \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 (\u043d\u0435 \u0438\u043c\u0435\u043b \u0434\u043e \u0432\u044b\u0445\u043e\u0434\u0430 iOS 15) \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0438 \u043f\u043e \u0441\u0435\u0439 \u0434\u0435\u043d\u044c \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0434\u043b\u044f \u0438\u0445 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c\/\u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c. \u041d\u0438\u0436\u0435 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043a\u0430\u043a \u043a\u0430\u0447\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0437 \u0441\u0435\u0442\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. <strong>\u041f\u041e\u0416\u0410\u041b\u0423\u0419\u0421\u0422\u0410 <\/strong>\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u044d\u0442\u043e \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b (\u043a\u043b\u0430\u0441\u0441\u044b &#8212; \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0439 \u0442\u0438\u043f, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c\u044b\u0439) \u0438 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u041e\u0417\u0423, \u043d\u0435 \u0432\u044b\u043d\u043e\u0441\u0438\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u043f\u043e\u0442\u043e\u043a \u0443\u0442\u0438\u043b\u0438\u0442 \u0438 \u0442.\u0434. \u0441\u043e\u0437\u0434\u0430\u043d \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438 \u0432\u0430\u0448\u0435\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0431\u0430\u043b\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0412\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u0440\u0430\u0437\u0431\u0435\u0440\u0438\u0442\u0435 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043a\u043e\u0434\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e  \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <\/p>\n<pre><code class=\"swift\">struct WebImage: View {          let url: String      var body: some View {         ...     } }<\/code><\/pre>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u043d\u0435\u0435 \u0441\u0441\u044b\u043b\u043a\u0443 <\/p>\n<pre><code class=\"swift\">struct MyView: View {     @StateObject var store: Store = Store()      var body: some View {         WebImage(url: \"https:\/\/mysite.example\/image.jpg\")     } }<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0443 \u0432 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430.<\/p>\n<pre><code class=\"swift\">func urlToNameFile(url: String) -> String {     var result: String     result = url.replacingOccurrences(of: \"http:\/\/\", with: \"domen-\", options: .literal, range: nil)     result = result.replacingOccurrences(of: \"https:\/\/\", with: \"domen-\", options: .literal, range: nil)     result = result.replacingOccurrences(of: \"\/\", with: \"-\", options: .literal, range: nil)     result = result.replacingOccurrences(of: \".ru\", with: \"-\", options: .literal, range: nil)     return result }<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0444\u0430\u0439\u043b\u0430\/\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438<\/p>\n<pre><code class=\"swift\">   func checkPath(url: URL) -> Bool {         let manager = FileManager.default         return manager.fileExists(atPath: url.path)     }<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0435 \u043f\u0443\u0442\u044c \u043a \u043f\u0430\u043f\u043a\u0435 \u0441 \u043a\u044d\u0448\u0435\u043c<\/p>\n<pre><code class=\"swift\">@State private var cacheFolderCell: URL? = nil<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u043f\u0443\u0442\u044c \u043a \u043f\u0430\u043f\u043a\u0435 \u0441 \u043a\u044d\u0448\u0435\u043c<\/p>\n<pre><code class=\"swift\">func getPathCacheFolder() -> URL? {     let manager = FileManager.default     let defaultPathsSearch: URL     do {         defaultPathsSearch = try manager.url(             for: FileManager.SearchPathDirectory.cachesDirectory,                in: FileManager.SearchPathDomainMask.userDomainMask, appropriateFor: nil,                create: true)     }     catch { return nil }          let cacheFolder = defaultPathsSearch.appendingPathComponent(\"image\")          if !checkPath(url: cacheFolder) {         do {             try manager.createDirectory(at: cacheFolder, withIntermediateDirectories: false, attributes: nil)         }         catch {return nil }     }          self.cacheFolderCell = cacheFolder     return cacheFolder }<\/code><\/pre>\n<p>\u0412 \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 .cache, \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 image \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u043d\u0435\u0439 \u0432 \u0432\u0438\u0434\u0435 URL<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0440\u0430\u0448\u043d\u0443\u044e \u0432\u0435\u0449\u044c.<\/p>\n<pre><code class=\"swift\">var cacheFolder: URL {     if let directory = self.cacheFolderCell {         return directory     } else {         return self.getPathCacheFolder()!     } }<\/code><\/pre>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u043b\u0438\u0431\u043e \u043f\u043e\u0439\u0434\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0440\u0430\u0448\u043d\u0435\u0442\u0441\u044f) \u041d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u0430\u043a. \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u044f\u0432\u043d\u043e\u0435 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0438. \u041c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e <strong>\u00ab!\u00bb\u00a0<\/strong>\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438, \u043d\u043e \u0440\u0430\u0437\u0432\u0435 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e? \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c.<\/p>\n<p>\u0417\u0430\u0432\u043e\u0434\u0438\u043c \u0444\u043b\u0430\u0433 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<pre><code class=\"swift\">@State var isLoadedImage: Bool = false<\/code><\/pre>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0437 Data<\/p>\n<pre><code class=\"swift\">func getImage(fileName: String) -> Image? {     let imagePath = cacheFolder.appendingPathComponent(fileName)     guard checkPath(url: imagePath) else {return nil}     guard let nsData = NSData(contentsOfFile: imagePath.path) else { return nil }     let data = Data(referencing: nsData)     guard let uiImage = UIImage(data: data) else { return nil }     return Image(uiImage: uiImage) }<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<pre><code class=\"swift\">@State var image: Image? = nil @State var progressCell: NSKeyValueObservation? = nil @State var progress: Double = 0<\/code><\/pre>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c, \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e &#8212; \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"swift\">func downloadImage(){     if isLoadedImage { return }     let nameImage = self.urlToNameFile(url: self.url)     if let image = getImage(fileName: nameImage) {         self.image = image         self.isLoadedImage = true     } else {         guard let valideUrl = URL(string: url) else { return }         let session = URLSession.shared         let task = session.downloadTask(with: valideUrl){ location, response, error in             progressCell?.invalidate()             if let _ = error {                 \/\/\u0434\u0435\u043b\u0430\u0435\u043c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c                 return             }             guard let localUrl = location else { return }             let fileUrl = cacheFolder.appendingPathComponent(nameImage)             if !checkPath(url: fileUrl) {                 do { try FileManager.default.moveItem(atPath: localUrl.path, toPath: fileUrl.path) }                 catch { return }             }             guard let image = getImage(fileName: nameImage) else { return }             self.image = image             self.isLoadedImage = true         }         self.progressCell = task.progress.observe(\\.fractionCompleted) { progress, _  in             self.progress = progress.fractionCompleted         }     } }<\/code><\/pre>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0432 body \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435<\/p>\n<pre><code class=\"swift\">    var body: some View {         VStack{             if image != nil {                 image!                     .resizable()                     .aspectRatio(contentMode: .fill)             } else {                 Image(systemName: \"photo\")                     .resizable()                     .aspectRatio(contentMode: .fill)             }         }         .onAppear {             self.downloadImage()         }              }<\/code><\/pre>\n<p>\u0412 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 (c \u0432\u0430\u0448\u0435\u0439 \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435)<\/p>\n<pre><code class=\"swift\">struct MyView: View {     @StateObject var store: Store = Store()          var body: some View {         WebImage(url: \"https:\/\/mysite.example\/image.jpg\")     } }  struct WebImage: View {          let url: String          @State private var cacheFolderCell: URL? = nil     var cacheFolder: URL {         if let directory = self.cacheFolderCell {             return directory         } else {             return self.getPathCacheFolder()!         }     }          @State var isLoadedImage: Bool = false     @State var image: Image? = nil          @State var progressCell: NSKeyValueObservation? = nil          @State var progress: Double = 0               var body: some View {         VStack{             if image != nil {                 image!                     .resizable()                     .aspectRatio(contentMode: .fill)             } else {                 Image(systemName: \"photo\")                     .resizable()                     .aspectRatio(contentMode: .fill)             }         }         .onAppear {             self.downloadImage()         }              }          func getImage(fileName: String) -> Image? {         let imagePath = cacheFolder.appendingPathComponent(fileName)         guard checkPath(url: imagePath) else {return nil}         guard let nsData = NSData(contentsOfFile: imagePath.path) else { return nil }         let data = Data(referencing: nsData)         guard let uiImage = UIImage(data: data) else { return nil }         return Image(uiImage: uiImage)     }          func downloadImage(){         if isLoadedImage { return }         let nameImage = self.urlToNameFile(url: self.url)         if let image = getImage(fileName: nameImage) {             self.image = image             self.isLoadedImage = true         } else {             guard let valideUrl = URL(string: url) else { return }             let session = URLSession.shared             let task = session.downloadTask(with: valideUrl){ location, response, error in                 progressCell?.invalidate()                 if let _ = error {                     \/\/\u0434\u0435\u043b\u0430\u0435\u043c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c                     return                 }                 guard let localUrl = location else { return }                 let fileUrl = cacheFolder.appendingPathComponent(nameImage)                 if !checkPath(url: fileUrl) {                     do { try FileManager.default.moveItem(atPath: localUrl.path, toPath: fileUrl.path) }                     catch { return }                 }                 guard let image = getImage(fileName: nameImage) else { return }                 self.image = image                 self.isLoadedImage = true             }             self.progressCell = task.progress.observe(\\.fractionCompleted) { progress, _  in                 self.progress = progress.fractionCompleted             }             task.resume()             session.finishTasksAndInvalidate()         }     }          func urlToNameFile(url: String) -> String {         var result: String         result = url.replacingOccurrences(of: \"http:\/\/\", with: \"domen-\", options: .literal, range: nil)         result = result.replacingOccurrences(of: \"https:\/\/\", with: \"domen-\", options: .literal, range: nil)         result = result.replacingOccurrences(of: \"\/\", with: \"-\", options: .literal, range: nil)         result = result.replacingOccurrences(of: \".ru\", with: \"-\", options: .literal, range: nil)         return result     }                    func checkPath(url: URL) -> Bool {         let manager = FileManager.default         return manager.fileExists(atPath: url.path)     }          func getPathCacheFolder() -> URL? {         let manager = FileManager.default         let defaultPathsSearch: URL         do {             defaultPathsSearch = try manager.url(                 for: FileManager.SearchPathDirectory.cachesDirectory,                    in: FileManager.SearchPathDomainMask.userDomainMask, appropriateFor: nil,                    create: true)         }         catch { return nil }                  let cacheFolder = defaultPathsSearch.appendingPathComponent(\"image\")                  if !checkPath(url: cacheFolder) {             do {                 try manager.createDirectory(at: cacheFolder, withIntermediateDirectories: false, attributes: nil)             }             catch {return nil }         }                  self.cacheFolderCell = cacheFolder         return cacheFolder     }      } <\/code><\/pre>\n<p>\u041d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044e\u0441\u044c, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0432\u0435\u0449\u0438, \u0442\u0430\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f. \u0421\u044e\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0432 NSCache \u0438 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043d\u0435\u0433\u043e (\u043e\u0431 \u044d\u0442\u043e\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e), \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438 \u0442.\u0434. \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a. \u041c\u043e\u044f \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 \u0431\u044b\u043b\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e \u0442\u0435\u043c\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0432\u0441\u0435, \u0447\u0442\u043e \u0445\u043e\u0442\u0435\u043b. \u041f\u043e \u043c\u0435\u0440\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0432\u043d\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0438\u043b\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u2014 \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/591775\/\"> https:\/\/habr.com\/ru\/articles\/591775\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0443 \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e SwiftUI, \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u043d\u0438\u0447\u0435\u0433\u043e \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043e\u0442 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0446\u0438\u0438 Apple &#8212; <a href=\"https:\/\/developer.apple.com\/tutorials\/swiftui\" rel=\"noopener noreferrer nofollow\">\u0432\u043e\u0442 \u043e\u043d<\/a>. \u0415\u0441\u043b\u0438 \u043f\u043b\u043e\u0445\u043e \u0441 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u043c, \u0431\u0440\u0430\u0443\u0437\u0435\u0440 Chrome \u0432 \u043f\u043e\u043c\u043e\u0449\u044c, \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u0430. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0432\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0438 99% \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u0442\u043f\u0430\u0434\u0443\u0442 \u0441\u0430\u043c\u0438 \u0441\u043e\u0431\u043e\u0439. \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d \u043d\u0430 \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0445\u043e\u0442\u044f\u0442 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441\u043e SwiftUI.<\/p>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u043e\u0435\u0433\u043e \u0441\u043a\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043c\u043d\u0435\u043d\u0438\u044f \u043e SwiftUI<\/h2>\n<p>\u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0438 \u043a <strong>Storyboard<\/strong> \u044f \u0431\u043e\u043b\u0435\u0435 \u043d\u0435 \u0432\u0435\u0440\u043d\u0443\u0441\u044c. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c UIKit, \u043d\u043e \u0434\u0443\u043c\u0430\u044e \u0441 \u0442\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044d\u0442\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e\u0439\u0434\u0435\u0442 \u043d\u0430 \u043d\u0435\u0442. \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0430\u043a \u0436\u0435 \u0443\u0434\u0438\u0432\u043b\u044f\u0435\u0442. \u0414\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0438\u043a\u043e\u043c\u0443 \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0443, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u044e\u0434\u0435\u0439, \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0438 \u043c\u043d\u0435\u043d\u0438\u0439, \u043f\u043e\u0436\u0430\u043b\u0443\u0439 \u043d\u0430\u0447\u043d\u0443.<\/p>\n<h2>\u041e \u0447\u0435\u043c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f<\/h2>\n<ul>\n<li>\n<p>\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e SwiftUI<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u044e\u0430\u043d\u0441\u044b \u0440\u0430\u0431\u043e\u0442\u044b SwiftUI<\/p>\n<\/li>\n<li>\n<p>PageView \u043d\u0430 SwiftUI<\/p>\n<\/li>\n<li>\n<p>WebImage \u043d\u0430 SwiftUI (AsyncImage)<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u043c\u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b, \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u0443\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f &#8212; \u043e\u0431\u043e\u0438 \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0441\u0442\u043e\u043b iPhone. \u041a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u0449\u0443\u043f\u0430\u0442\u044c, \u043e\u043d\u043e \u0435\u0441\u0442\u044c \u0432 AppStore  &#8212; <a href=\"https:\/\/apps.apple.com\/ru\/app\/%D0%BE%D0%B1%D0%BE%D0%B8-%D0%B8-%D1%82%D0%B5%D0%BC%D1%8B-%D0%B2-hd-%D0%B8-4k-wallbe\/id1596575218\" rel=\"noopener noreferrer nofollow\">\u0441\u0438\u043b\u044c\u0432\u0443\u043f\u043b\u0435<\/a>. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443\u043c\u0435\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 (Data) \u0432 .cache, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0432 \u0444\u043e\u0442\u043e\u043f\u043b\u0435\u043d\u043a\u0443, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0441\u0435\u0442\u044c\u044e (\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441\u043f\u0438\u0441\u043a\u043e\u0432, \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0442.\u0434.), \u0433\u0440\u0443\u0431\u043e \u0433\u043e\u0432\u043e\u0440\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e. \u041e\u0431 \u044d\u0442\u043e\u043c \u0438 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0442\u0438 \u0440\u0435\u0447\u044c.<\/p>\n<h2>\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e SwiftUI<\/h2>\n<p><strong>@State &#8212; <\/strong>\u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u0430\u044f \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u043e\u043d\u0438 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c.<\/p>\n<pre><code class=\"swift\">struct MyView: View {        @State var text: String = \"\"                var body: some View {         TextField(\"Placeholder\", text: $text)         Text(text)<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c, \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f &#8212; text, \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 <strong><em>String<\/em><\/strong> \u0442.\u0435. \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043f\u043b\u044e\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043e\u0431\u0435\u0440\u0442\u043a\u0435 (<strong><em>Binding&lt;String><\/em><\/strong>). \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0438\u043c\u0435\u043d\u043d\u043e <strong><em>Binding&lt;><\/em>,<\/strong> \u043a\u0430\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <strong><em>TextField()<\/em><\/strong><em> (\u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043f\u043e\u0439\u043c\u0435\u0442\u0435 \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435), <\/em>\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0447\u0435\u0440\u0435\u0437 <strong>$ <\/strong>(\u044d\u0442\u043e \u043d\u0435 \u043e\u0442\u0441\u044b\u043b\u043a\u0430 \u043a php). \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u044d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 (\u0432 SwiftUI, \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c), \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 <strong><em>Text()<\/em><\/strong><em>, <\/em>\u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u043a\u0443 \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u044f<em> <\/em><strong><em>TextField()<\/em><\/strong><em>,<\/em> \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u0443\u0432\u0438\u0434\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 <strong><em>Text()<\/em><\/strong><em>.<\/em> \u041f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u043e\u043b\u0435\u043f\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u043a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043c\u0435\u043d\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443<\/p>\n<pre><code class=\"swift\">struct MyView: View { var myProperty = 0          mutating func myMethod(){         self.myProperty += 1     }          var body: some View {     ...<\/code><\/pre>\n<p>\u043a\u0430\u043a \u0432\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445, \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>mutating, <\/strong>\u0430 \u0432\u043e\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0432 \u043e\u0431\u0435\u0440\u0442\u043a\u0435 <strong><em>Binding&lt;><\/em><\/strong> \u043a\u0430\u043a \u0432\u044b \u0443\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c, \u044d\u0442\u043e \u043d\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f, \u043e\u043d\u0438 \u043f\u043e\u0434\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u043e\u043c\u0443 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e.<\/p>\n<pre><code class=\"swift\">struct MyView: View {     @State var myProperty = 0          func myMethod(){         self.myProperty += 1     }          var body: some View {     ...<\/code><\/pre>\n<p>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <strong><em>Binding&lt;> <\/em><\/strong>\u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u0438 \u0438\u043c \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0441\u0435\u0442\u0442\u0435\u0440\u044b, \u043d\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u0445\u043e\u0434 &#8212; \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <strong><em>onChange<\/em><\/strong><\/p>\n<pre><code class=\"swift\"> \/\/-------- \u0411\u0415\u0417 Binding  struct MyView: View {      var myProperty: Int = 0 {         didSet {             print(\"\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e myProperty \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c\")         }     }     mutating func myMethod(){         self.myProperty += 1     }     var body: some View {         VStack {             Text(String(myProperty))         } ...          \/\/-------- \u0421 Binding  struct MyView: View {      @State var myProperty: Int = 0     func myMethod(){         self.myProperty += 1     }     var body: some View {         VStack {             Text(String(myProperty))         }         .onChange(of: myProperty) { _ in             print(\"\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e myProperty \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c\")         }         ...<\/code><\/pre>\n<p><strong>@Binding &#8212; <\/strong>\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0438\u0437\u0432\u043d\u0435, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u0441 \u043e\u0431\u0435\u0440\u0442\u043a\u043e\u0439<strong> @State<\/strong><\/p>\n<pre><code class=\"swift\">struct MyView: View {      @State var myProperty: String = \"\u0422\u0435\u043a\u0441\u0442\"      var body: some View {         Text(myProperty)         MySecondView(myProperty: $myProperty)     } }          struct MySecondView: View {      @Binding var myProperty: String      var body: some View {         TextField(\"Placeholder\", text: $myProperty)     } }<\/code><\/pre>\n<p>\u0412\u044b\u0448\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c, \u043a\u0430\u043a \u0442\u0435\u043a\u0441\u0442 \u0432 <strong>MyView<\/strong> \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u043f\u043e\u043b\u0435\u043c \u0432\u0432\u043e\u0434\u0430 \u0432 <strong>MySecondView<\/strong>. \u0422\u0435\u043f\u0435\u0440\u044c \u044f \u0434\u0443\u043c\u0430\u044e \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 <strong><em>Binding&lt;> <\/em><\/strong>\u043e\u0431\u0435\u0440\u0442\u043a\u0435. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0438\u0437\u044f\u0449\u043d\u043e\u0435 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439, \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p><strong>@StateObject &#8212; <\/strong>\u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e \u0441\u0443\u0442\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 <strong>@State<\/strong>, \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0441 \u0442\u043e\u0439 \u043b\u0438\u0448\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439, \u0447\u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 <strong>@Binding<\/strong> \u0446\u0435\u043b\u0438\u043a\u043e\u043c (\u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435), \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/p>\n<pre><code class=\"swift\">struct MyView: View {      @StateObject var myObject: MyClass = MyClass()      var body: some View {         Text(myObject.text)         Text(myObject.title)         MySecondView(myProperty: $myObject.text)     } }          struct MySecondView: View {      @Binding var myProperty: String     var body: some View {         TextField(\"Placeholder\", text: $myProperty)     } }  class MyClass: ObservableObject {     @Published var title: String = \"\"     @Published var text: String = \"\" }<\/code><\/pre>\n<p><strong>@ObservedObject &#8212;<\/strong> \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u0438\u043d\u044f\u0442\u044c<strong> @StateObject <\/strong>\u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f (\u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430).<\/p>\n<pre><code class=\"swift\">struct MyView: View {      @StateObject var myObject: MyClass = MyClass()      var body: some View {         Text(myObject.text)         Text(myObject.title)         MySecondView(myObject: myObject)     } }          struct MySecondView: View {          @ObservedObject var myObject : MyClass     var body: some View {         TextField(\"Placeholder\", text: $myObject.text)     } }<\/code><\/pre>\n<p><strong>@EnvironmentObject &#8212; <\/strong>\u044f \u0431\u044b \u043d\u0430\u0437\u0432\u0430\u043b \u044d\u0442\u043e \u0442\u043e\u0447\u043a\u043e\u0439 \u0432\u0445\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0444\u0440\u0435\u0439\u0432\u043e\u0440\u043a\u0430\u043c\u0438, \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0441 Docker \u0438 \u0442.\u0434., \u0432\u0430\u043c \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0444\u0430\u0439\u043b .env (\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f), \u0442\u0430\u043a \u0432\u043e\u0442<strong> @EnvironmentObject <\/strong>\u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 \u0438 \u0435\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043d\u043e \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0442\u0430\u043a \u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b. \u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e.<\/p>\n<pre><code class=\"swift\">@main struct myApp: App {          @StateObject var myObject: MyClass = MyClass()          var body: some Scene {         WindowGroup {             MyView()                 .environmentObject(myObject)         }     } }<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445, \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0432 \u0435\u0433\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435.<\/p>\n<pre><code class=\"swift\">struct MyView: View {          @EnvironmentObject var myObject: MyClass      var body: some View {         Text(myObject.text)         Text(myObject.title)         MySecondView()     } }          struct MySecondView: View {          @EnvironmentObject var myObject: MyClass          var body: some View {         TextField(\"Placeholder\", text: $myObject.text)     } }<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0443\u0434\u043e\u0431\u043d\u043e, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0440\u044f\u0434 \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432 \u0442.\u043a. <strong>@EnvironmentObject<\/strong> (\u0441\u0440\u0435\u0434\u0430) \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c init() \u0443 \u0412\u0430\u0441 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f (\u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430).<\/p>\n<p><strong>.onAppear<\/strong> \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 &#8212; \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0432 init()<\/p>\n<pre><code class=\"swift\">struct MyView: View {      @StateObject var myObject: MyClass = MyClass()      var body: some View {         Text(myObject.text)         Text(myObject.title)         MySecondView(myObject)     } }          struct MySecondView: View {          @ObservedObject var myObject : MyClass          func hello() {         self.myObject.text = \"hello\"     }          init(_ myObject: MyClass){         self.myObject = myObject         self.hello()     }          var body: some View {         TextField(\"Placeholder\", text: $myObject.text)     } }<\/code><\/pre>\n<p>\u043d\u043e \u043a\u0430\u043a \u043c\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438 \u0440\u0430\u043d\u0435\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <strong>@EnvironmentObject <\/strong>\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c, <strong>onAppear <\/strong>\u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0438 \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443<\/p>\n<pre><code class=\"swift\">struct MyView: View {      @StateObject var myObject: MyClass = MyClass()      var body: some View {         Text(myObject.text)         Text(myObject.title)         MySecondView(myObject: myObject)     } }          struct MySecondView: View {          @ObservedObject var myObject : MyClass          func hello() {         self.myObject.text = \"hello\"     }          var body: some View {         TextField(\"Placeholder\", text: $myObject.text)             .onAppear{                 self.hello()             }     } }<\/code><\/pre>\n<p>\u041a\u043e\u0434 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 \u0432 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435, \u0447\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u043d\u0435\u0436\u0435\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0437\u0434\u043e\u0440\u043e\u0432\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0438\u043c\u0435\u043d\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p><strong>.onDisappear<\/strong> \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 &#8212; \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c <strong>onAppear, <\/strong>\u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043a\u0438\u0434\u0430\u0435\u0442 \u044d\u043a\u0440\u0430\u043d.<\/p>\n<p><strong>\u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b<\/strong> &#8212; \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438\/\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f View, \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0441\u043e\u0431\u043e \u043d\u0435\u0447\u0435\u0433\u043e, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0442\u044f\u0436\u0435\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043b\u0438\u0441\u0442\u0438\u043d\u0433<\/p>\n<pre><code class=\"swift\">struct MySecondView: View {          @ObservedObject var myObject : MyClass          func hello() {         self.myObject.text = \"hello\"     }          var body: some View {         TextField(\"Placeholder\", text: $myObject.text)             .onAppear{                 self.myObject                     .clearText()                     .clearTitle(){                         print(\"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u0447\u0438\u0449\u0435\u043d\")                     }             }     } }  class MyClass: ObservableObject {     @Published var title: String = \"cell\"     @Published var text: String = \"cell\"          public func clearText() -> MyClass {         self.text = \"d\"         return self     }          public func clearTitle(_ closure: @escaping () -> Void) -><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-418191","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/418191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=418191"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/418191\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=418191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=418191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=418191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}