{"id":14180,"date":"2021-07-11T06:20:37","date_gmt":"2021-07-11T06:20:37","guid":{"rendered":"https:\/\/bestkora.com\/IosDeveloper\/?p=14180"},"modified":"2021-08-18T08:21:25","modified_gmt":"2021-08-18T08:21:25","slug":"lektsiya-4-bolshe-o-mvvm-enum-optional-cs193p-spring-2021","status":"publish","type":"post","link":"https:\/\/bestkora.com\/IosDeveloper\/lektsiya-4-bolshe-o-mvvm-enum-optional-cs193p-spring-2021\/","title":{"rendered":"\u041b\u0435\u043a\u0446\u0438\u044f 4. \u0411\u043e\u043b\u044c\u0448\u0435 \u043e MVVM enum Optional.  CS193P Spring 2021."},"content":{"rendered":"<p><span style=\"font-weight: 400;\"><a href=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-19.17.55.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14206 size-full\" src=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-19.17.55.png\" alt=\"\" width=\"1252\" height=\"414\" srcset=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-19.17.55.png 1252w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-19.17.55-300x99.png 300w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-19.17.55-1024x339.png 1024w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-19.17.55-768x254.png 768w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-19.17.55-500x165.png 500w\" sizes=\"auto, (max-width: 1252px) 100vw, 1252px\" \/><\/a>\u042d\u0442\u043e \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0430\u044f \u041b\u0435\u043a\u0446\u0438\u044f \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/cs193p.sites.stanford.edu\/\">Stanford CS193p, \u0432\u0435\u0441\u043d\u0430 2021 \u0433\u043e\u0434\u0430, <\/a>\u0438 \u043e\u043d\u0430 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u041b\u0435\u043a\u0446\u0438\u0438 3, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u0438 \u0441\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043c\u043e\u0434\u0435\u043b\u044c <strong><span style=\"color: #0000ff;\">Model <\/span><\/strong>\u0438 <strong>ViewModel<\/strong> \u0434\u043b\u044f\u00a0\u043a\u0430\u0440\u0442\u043e\u0447\u043d\u043e\u0439 \u0438\u0433\u0440\u044b &#171;\u043d\u0430 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435&#187; <strong>Memorize<\/strong>.\u00a0 <span style=\"color: #680da1;\"><strong>View<\/strong><\/span>\u00a0 (\u0442\u043e \u0435\u0441\u0442\u044c <strong>UI<\/strong>) \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u0430 \u041b\u0435\u043a\u0446\u0438\u044f\u0445 1\u0438 2. \u041d\u0430 \u044d\u0442\u043e\u0439 \u041b\u0435\u043a\u0446\u0438\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 <strong>MVVM<\/strong> \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0439 \u0441\u0432\u043e\u0435\u0439 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043c\u043e\u0449\u0438.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a <strong>MVVM<\/strong> \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u043e\u0440 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u0441\u043b\u0430\u0439\u0434\u0430\u043c, \u0447\u0442\u043e\u0431\u044b \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u0434\u0432\u0443\u0445 \u0432\u0435\u0449\u0430\u0445. \u041f\u0435\u0440\u0432\u0430\u044f\u00a0 \u2014 \u044d\u0442\u043e \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0422\u0418\u041f <\/span><strong>Swift<\/strong><span style=\"font-weight: 400;\">, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435\u043c <\/span><span style=\"color: #d80a77;\"><strong>enum<\/strong><\/span><span style=\"font-weight: 400;\">, \u0430 \u0432\u0442\u043e\u0440\u0430\u044f \u2014 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <strong><span style=\"color: #d80a77;\">enum<\/span><\/strong>, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f <\/span><strong><span style=\"color: #680da1;\">Optional<\/span><\/strong><span style=\"font-weight: 400;\">. \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u044d\u0442\u043e \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 <\/span><strong><span style=\"color: #d80a77;\">enum<\/span><\/strong><span style=\"font-weight: 400;\">, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 <strong><span style=\"color: #d80a77;\">enum<\/span><\/strong> \u0432\u043e \u0432\u0441\u0435\u043c <\/span><strong>Swift<\/strong><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><!--more--><\/p>\n<h2><b>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b MVVM<\/b><b>.<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">\u041d\u0430 \u044d\u0442\u043e\u0439 \u041b\u0435\u043a\u0446\u0438\u0438 4 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 <\/span><strong><span style=\"color: #0000ff;\">Model<\/span><\/strong><span style=\"font-weight: 400;\">, \u043a\u0430\u043a \u044d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u0433\u0440\u044b <strong>Memorize<\/strong>:<\/span><\/p>\n<p><a href=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.32.21.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14186 size-full\" src=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.32.21.png\" alt=\"\" width=\"1340\" height=\"1342\" srcset=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.32.21.png 1340w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.32.21-300x300.png 300w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.32.21-1022x1024.png 1022w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.32.21-150x150.png 150w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.32.21-768x769.png 768w\" sizes=\"auto, (max-width: 1340px) 100vw, 1340px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">\u041c\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u044d\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 <\/span><strong><span style=\"color: #0000ff;\">Model <\/span><\/strong><span style=\"font-weight: 400;\">\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 <strong>UI<\/strong>. \u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e <\/span><strong><span style=\"color: #680da1;\">Foundation<\/span><\/strong><span style=\"font-weight: 400;\"> \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0432 \u043a\u043e\u0434\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 <\/span><strong><span style=\"color: #0000ff;\">Model <\/span><\/strong><span style=\"font-weight: 400;\">\u043d\u0435\u0442 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u0447\u0442\u043e-\u043b\u0438\u0431\u043e \u0432 <\/span><strong><span style=\"color: #680da1;\">Views<\/span><\/strong><span style=\"font-weight: 400;\"> \u0438\u043b\u0438 <\/span><strong>ViewModel<\/strong><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u041d\u0430\u0448\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 <\/span><strong><span style=\"color: #0000ff;\">Model <\/span><\/strong><span style=\"font-weight: 400;\">\u0438\u043c\u0435\u044e\u0442 \u0414\u0430\u043d\u043d\u044b\u0435 (<\/span><strong>Data<\/strong><span style=\"font-weight: 400;\">) \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u043d\u0430\u0448\u0438\u0445 \u043a\u0430\u0440\u0442 <\/span><strong><span style=\"color: #680da1;\">cards<\/span><\/strong><span style=\"font-weight: 400;\"> \u0438 \u043b\u043e\u0433\u0438\u043a\u0443 (<\/span><strong>Logic<\/strong><span style=\"font-weight: 400;\">), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <\/span><strong><span style=\"color: #680da1;\">choose (_ card: Card)<\/span><\/strong><span style=\"font-weight: 400;\">, \u0432\u044b\u0431\u043e\u0440\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043a\u0430\u0440\u0442\u044b <strong><span style=\"color: #680da1;\">card<\/span><\/strong> \u0438 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0440\u0442 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0421\u041e\u0412\u041f\u0410\u0414\u0415\u041d\u0418\u042f.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0443\u0437\u043d\u0430\u043b\u0438, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c <\/span><strong><span style=\"color: #0000ff;\">Model<\/span><\/strong><span style=\"font-weight: 400;\"> \u2014 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0418\u0421\u0422\u0418\u041d\u042b. \u0412\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043a\u0430\u0440\u0442\u0430\u0445 <\/span><strong><span style=\"color: #680da1;\">cards<\/span><\/strong><span style=\"font-weight: 400;\">, \u043b\u0435\u0436\u0430\u0442 \u043b\u0438 \u043e\u043d\u0438 \u201c\u043b\u0438\u0446\u043e\u043c\u201d \u0432\u0432\u0435\u0440\u0445, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u043b\u0438 \u043e\u043d\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435, \u0432\u0441\u0435 \u044d\u0442\u043e \u0437\u0434\u0435\u0441\u044c, \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 <\/span><strong><span style=\"color: #0000ff;\">Model<\/span><\/strong><span style=\"font-weight: 400;\">. \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0433\u0434\u0435 \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u041c\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u043b\u0438 \u0438\u0437 \u041b\u0435\u043a\u0446\u0438\u0438 1, \u0447\u0442\u043e \u0446\u0435\u043b\u044c \u043d\u0430\u0448\u0435\u0433\u043e <\/span><strong><span style=\"color: #680da1;\">View<\/span><\/strong><span style=\"font-weight: 400;\">, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0442\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u043b\u0438, \u2014 \u043e\u0442\u0440\u0430\u0436\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c <\/span><strong><span style=\"color: #0000ff;\">Model<\/span><\/strong><span style=\"font-weight: 400;\">. <\/span><\/p>\n<p><a href=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.39.39.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14187 size-full\" src=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.39.39.png\" alt=\"\" width=\"1414\" height=\"870\" srcset=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.39.39.png 1414w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.39.39-300x185.png 300w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.39.39-1024x630.png 1024w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.39.39-768x473.png 768w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.39.39-488x300.png 488w\" sizes=\"auto, (max-width: 1414px) 100vw, 1414px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">\u041d\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u043e\u0434\u043d\u043e \u0438\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/span> <strong><span style=\"color: #d80a77;\">var<\/span> <span style=\"color: #137107;\">body<\/span><\/strong><span style=\"font-weight: 400;\"><span style=\"color: #680da1;\"><span style=\"color: #000000;\"> \u043b\u044e\u0431\u043e\u0433\u043e<\/span> <strong>View<\/strong><\/span>\u2014 \u044d\u0442\u043e &#171;\u0434\u0430\u0439 \u043c\u043d\u0435 <\/span><span style=\"font-weight: 400;\"><strong>UI<\/strong>,<\/span><span style=\"font-weight: 400;\"> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 <\/span><strong><span style=\"color: #0000ff;\">Model<\/span><\/strong><span style=\"font-weight: 400;\">&#171;.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u041c\u044b \u0443\u0437\u043d\u0430\u043b\u0438 \u043e\u0434\u043d\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0449\u044c \u043e \u043d\u0430\u0448\u0438\u0445 <\/span><strong><span style=\"color: #680da1;\">Views<\/span><\/strong><span style=\"font-weight: 400;\">, \u043e\u043d\u0438 \u2014 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b:<\/span><\/p>\n<ul>\n<li><strong><span style=\"color: #680da1;\">ScrollView<\/span><\/strong><span style=\"font-weight: 400;\"> \u2014\u00a0 \u0432\u043e\u0442 \u043e\u043d \u043d\u0430 <\/span><strong>UI<\/strong><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li><strong><span style=\"color: #680da1;\">LazyVGrid<\/span><\/strong><span style=\"font-weight: 400;\">\u00a0 \u2014\u00a0 \u0432\u043e\u0442 \u043e\u043d\u0430 \u043d\u0430 <\/span><strong>UI<\/strong><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">\u041a\u0430\u0440\u0442\u044b <\/span><span style=\"font-weight: 400;\"><strong><span style=\"color: #680da1;\">cards<\/span><\/strong> \u2014 <\/span><span style=\"font-weight: 400;\">\u00a0\u0432\u043e\u0442 \u043e\u043d\u0438 \u043d\u0430 <\/span><strong>UI<\/strong><span style=\"font-weight: 400;\">.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">\u041f\u043e \u043c\u0435\u0440\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043d\u0430\u0448 <\/span><strong><span style=\"color: #680da1;\">View<\/span><\/strong><span style=\"font-weight: 400;\">. \u0412\u0441\u0451, \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u043c \u0432 \u043a\u043e\u0434\u0435, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <\/span><span style=\"font-weight: 400;\">UI<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><a href=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.52.32.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14188 size-full\" src=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.52.32.png\" alt=\"\" width=\"1414\" height=\"1122\" srcset=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.52.32.png 1414w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.52.32-300x238.png 300w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.52.32-1024x813.png 1024w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.52.32-768x609.png 768w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-11.52.32-378x300.png 378w\" sizes=\"auto, (max-width: 1414px) 100vw, 1414px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">\u0422\u043e \u0447\u0442\u043e \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043d\u0430 <\/span><strong>UI<\/strong><span style=\"font-weight: 400;\"> \u2014 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0420\u0415\u0410\u041a\u0422\u0418\u0412\u041d\u041e\u00a0 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 <\/span><strong><span style=\"color: #0000ff;\">Model<\/span><\/strong><span style=\"font-weight: 400;\">. \u0418 \u043c\u044b \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u043c \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0448\u0435\u0439 <\/span><strong>ViewModel<\/strong><span style=\"font-weight: 400;\">, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 <\/span><strong><span style=\"color: #680da1;\">View<\/span><\/strong><span style=\"font-weight: 400;\"> \u043a \u043c\u043e\u0434\u0435\u043b\u0438 <\/span><strong><span style=\"color: #0000ff;\">Model<\/span><\/strong><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><a href=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-12.00.40.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14189 size-full\" src=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-12.00.40.png\" alt=\"\" width=\"1260\" height=\"956\" srcset=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-12.00.40.png 1260w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-12.00.40-300x228.png 300w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-12.00.40-1024x777.png 1024w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-12.00.40-768x583.png 768w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-12.00.40-395x300.png 395w\" sizes=\"auto, (max-width: 1260px) 100vw, 1260px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">\u042d\u0442\u0430 <\/span><strong>ViewModel<\/strong><span style=\"font-weight: 400;\"> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <strong>\u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u043e\u043c<\/strong> (<\/span><span style=\"font-weight: 400;\">interpreter<\/span><span style=\"font-weight: 400;\">).\u00a0<\/span><\/p>\n<p><strong>ViewModel<\/strong><span style=\"font-weight: 400;\"> \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f &#171;\u043f\u0440\u0438\u0432\u0440\u0430\u0442\u043d\u0438\u043a\u043e\u043c&#187; \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u044c <\/span><strong><span style=\"color: #0000ff;\">Model<\/span><\/strong><span style=\"font-weight: 400;\"> \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a <\/span><span style=\"color: #680da1;\"><strong>View<\/strong><\/span><span style=\"font-weight: 400;\">. \u041e\u043d\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c <\/span><strong><span style=\"color: #680da1;\">model<\/span> <span style=\"color: #d80a77;\">private <\/span><\/strong><span style=\"font-weight: 400;\">\u0438 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 <\/span><strong><span style=\"color: #680da1;\">Views<\/span><\/strong><span style=\"font-weight: 400;\"> \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0443<\/span> <span style=\"font-weight: 400;\">\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430.<\/span><\/p>\n<p><strong>ViewModel<\/strong><span style=\"font-weight: 400;\"> \u0442\u0430\u043a\u0436\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0432 \u043f\u043e\u043b\u043d\u043e\u043c \u043e\u0431\u044a\u0435\u043c\u0435 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 <\/span><strong><span style=\"color: #680da1;\">model<\/span><\/strong><span style=\"font-weight: 400;\"> \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443, \u0447\u0442\u043e <strong>Swift<\/strong> \u0443\u043c\u0435\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 <strong><span style=\"color: #d80a77;\">struct<\/span><\/strong>, \u0430 <strong><span style=\"color: #680da1;\">model<\/span><\/strong> &#8212; \u044d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 <strong><span style=\"color: #d80a77;\">struct <span style=\"color: #680da1;\">MemoryGame<\/span><\/span><\/strong>. <strong>Swift<\/strong> \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 <strong><span style=\"color: #d80a77;\">class<\/span><\/strong>, \u043d\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 <strong><span style=\"color: #d80a77;\">struct<\/span><\/strong>. \u0412\u043e\u0442 \u043e\u0442\u043a\u0443\u0434\u0430 \u043d\u0430\u0448\u0430 <strong>ViewModel<\/strong> \u0437\u043d\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e-\u0442\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 <strong><span style=\"color: #680da1;\">model<\/span><\/strong>, \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442 \u201c\u0427\u0442\u043e-\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c\u2026\u201d. <strong>ViewModel<\/strong> \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u201c\u0432\u0435\u0434\u0435\u0442 \u0441\u0435\u0431\u044f\u201d \u043a\u0430\u043a <strong><span style=\"color: #680da1;\">ObservableObject<\/span><\/strong>,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c <\/span><strong><span style=\"color: #680da1;\">@Published<\/span><\/strong><span style=\"font-weight: 400;\"> \u043d\u0430\u0448\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <\/span><strong><span style=\"color: #d80a77;\">var<\/span><\/strong> <span style=\"font-weight: 400;\"><strong><span style=\"color: #680da1;\">model<\/span><\/strong>, \u0438 \u0435\u0441\u043b\u0438 \u0432 \u043d\u0435\u0439 \u0447\u0442\u043e-\u0442\u043e <\/span><span style=\"font-weight: 400;\">\u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f, \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0441\u043a\u0440\u044b\u0442\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <span style=\"color: #d80a77;\"><strong>var<\/strong><\/span> <span style=\"color: #680da1;\"><strong>objectWillChange<\/strong><\/span> \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c <\/span><span style=\"font-weight: 400;\"><span style=\"color: #680da1;\"><strong>send()<\/strong><\/span>,<\/span><span style=\"font-weight: 400;\"> \u0438 \u043f\u0443\u0441\u0442\u044c \u041c\u0438\u0440 \u0443\u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0432 \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 <\/span><strong><span style=\"color: #680da1;\">model<\/span><\/strong><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0448 <\/span><strong><span style=\"color: #680da1;\">View<\/span><\/strong><span style=\"font-weight: 400;\">, \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u043c\u0435\u0442\u0438\u043b \u0441\u0432\u043e\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <\/span><strong><span style=\"color: #d80a77;\">var<\/span><span style=\"color: #680da1;\"> viewModel <\/span><\/strong><span style=\"font-weight: 400;\">\u043a\u0430\u043a <\/span><strong><span style=\"color: #680da1;\">@ObservedObject<\/span><\/strong><span style=\"font-weight: 400;\">, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 &#171;\u0441\u043b\u0443\u0448\u0430\u0442\u044c&#187; \u044d\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 <strong><span style=\"color: #680da1;\">model<\/span><\/strong> \u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <\/span><span style=\"color: #d80a77;\"><strong>var<\/strong><\/span><strong><span style=\"color: #680da1;\"> body<\/span><\/strong><span style=\"font-weight: 400;\"> \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 <\/span><strong><span style=\"color: #680da1;\">viewModel.model<\/span><\/strong><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><a href=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-15.20.26.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14191 size-full\" src=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-15.20.26.png\" alt=\"\" width=\"1310\" height=\"846\" srcset=\"https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-15.20.26.png 1310w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-15.20.26-300x194.png 300w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-15.20.26-1024x661.png 1024w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-15.20.26-768x496.png 768w, https:\/\/bestkora.com\/IosDeveloper\/wp-content\/uploads\/2021\/07\/Screenshot-2021-07-11-at-15.20.26-465x300.png 465w\" sizes=\"auto, (max-width: 1310px) 100vw, 1310px\" \/><\/a><\/p>\n<p><strong>SwiftUI<\/strong><span style=\"font-weight: 400;\"> \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u044d\u0442\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0418 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e. \u0422\u043e\u043b\u044c\u043a\u043e \u0442\u0435 <\/span><strong><span style=\"color: #680da1;\">View<\/span><\/strong><span style=\"font-weight: 400;\"><strong><span style=\"color: #680da1;\">s<\/span><\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c, \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442 \u0441\u0432\u043e\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <\/span><strong><span style=\"color: #d80a77;\">var<\/span> <span style=\"color: #680da1;\">body<\/span><\/strong><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u0418\u0442\u0430\u043a, <\/span><span style=\"color: #680da1;\"><strong>@ObservedObject <\/strong><\/span><span style=\"font-weight: 400;\">\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u041c\u044b \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <\/span><span style=\"color: #d80a77;\"><strong>var<\/strong><\/span><span style=\"font-weight: 400; color: #137107;\"> body<\/span><span style=\"font-weight: 400;\">, \u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0445\u043e\u0434\u0438\u0442, &#171;\u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430&#187; <strong><span style=\"color: #680da1;\">ScrollView<\/span><\/strong>, &#171;\u0441\u0435\u0442\u043a\u0430&#187; <strong><span style=\"color: #680da1;\">LazyVGrid<\/span><\/strong> \u0438 \u044d\u0442\u0438 \u043a\u0430\u0440\u0442\u044b <strong><span style=\"color: #680da1;\">CardViews<\/span><\/strong> \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0432\u043e\u0438 <\/span><strong><span style=\"color: #d80a77;\">var<\/span><span style=\"color: #137107;\"> body<\/span><\/strong><span style=\"font-weight: 400;\"> \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 <\/span><span style=\"font-weight: 400;\">\u043e\u0442 \u0442\u043e\u0433\u043e, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438 \u043e\u043d\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c. \u042d\u0442\u043e \u043e\u0434\u0438\u043d &#171;\u043a\u043e\u043d\u0442\u0443\u0440&#187; \u0440\u0430\u0431\u043e\u0442\u044b <strong>MVVM<\/strong>.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u0414\u0440\u0443\u0433\u043e\u0439 &#171;\u043a\u043e\u043d\u0442\u0443\u0440&#187; \u0440\u0430\u0431\u043e\u0442\u044b <strong>MVVM<\/strong> \u0441\u0432\u044f\u0437\u0430\u043d \u0441\u00a0\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0436\u0435\u0441\u0442 <\/span><span style=\"font-weight: 400;\"><strong>Tap<\/strong> \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043c\u0443\u043b\u044c\u0442\u0438\u0442\u0430\u0447 (multi touch) \u0436\u0435\u0441\u0442\u0430 \u0438 <\/span><span style=\"font-weight: 400;\">\u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong><span style=\"color: #d80a77;\">func<\/span><\/strong> \u0432 \u043d\u0430\u0448\u0435\u0439 <\/span><strong>ViewModel<\/strong><span style=\"font-weight: 400;\"> \u043a\u0430\u043a \u041d\u0410\u041c\u0415\u0420\u0415\u041d\u0418\u0415 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0448\u0430 <\/span><strong>ViewModel<\/strong><span style=\"font-weight: 400;\"> \u0432\u044b\u044f\u0441\u043d\u044f\u0435\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 <strong><span style=\"color: #0000ff;\">Model<\/span><\/strong>.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u042d\u0442\u043e \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0445 \u0432\u0441\u0435 \u043e <\/span><span style=\"font-weight: 400;\"><strong>MVVM<\/strong>, \u0432 \u041b\u0435\u043a\u0446\u0438\u0438 4 \u0432\u0441\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e.<\/span><\/p>\n<h2><b>\u0422\u0418\u041f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 <\/b><span style=\"color: #d80a77;\"><b>enum<\/b><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">\u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <\/span><strong><span style=\"color: #d80a77;\">enum<\/span><\/strong><span style=\"font-weight: 400;\"> \u2014 \u044d\u0442\u043e \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u0422\u0418\u041f\u043e\u0432 \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <\/span><strong><span style=\"color: #d80a77;\">struct<\/span><\/strong><span style=\"font-weight: 400;\"> \u0438\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 <\/span><strong><span style=\"color: #d80a77;\">class<\/span><\/strong><span style=\"font-weight: 400;\">, \u0432\u0441\u0435 \u043e\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u0431\u043b\u043e\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <\/span><strong><span style=\"color: #d80a77;\">enum<\/span><\/strong><span style=\"font-weight: 400;\"> \u0432\u0441\u0435 \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u2014 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044e <strong><span style=\"color: #d80a77;\">enum<\/span><\/strong> \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u043e\u0440\u00a0 \u0443\u0434\u0435\u043b\u044f\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f.<\/span><\/p>\n<h2><b>\u0422\u0418\u041f <\/b><span style=\"color: #680da1;\"><b>Optional<\/b><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">\u042d\u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u0412\u0410\u0416\u041d\u041e\u0415 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 <\/span><strong><span style=\"color: #d80a77;\">enum <\/span><\/strong><span style=\"font-weight: 400;\">\u0432\u043e \u0432\u0441\u0435\u043c <\/span><strong>Swift<\/strong><span style=\"font-weight: 400;\">, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <\/span><strong><span style=\"color: #680da1;\">Optional<\/span><\/strong><span style=\"font-weight: 400;\">. <\/span><span style=\"font-weight: 400;\"><strong><span style=\"color: #680da1;\">Optional<\/span><\/strong> \u2014 <\/span><span style=\"font-weight: 400;\">\u044d\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u0432\u0435\u043b\u0438\u043a\u043e\u0433\u043e \u0443\u0436\u0430\u0441\u0430 \u0434\u043b\u044f \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432, \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0438\u0437\u0443\u0447\u0430\u044e\u0449\u0438\u0445 <\/span><strong>Swift<\/strong><span style=\"font-weight: 400;\">, \u043d\u043e <\/span><span style=\"font-weight: 400;\"><strong><span style=\"color: #680da1;\">Optional<\/span><\/strong> \u2014 <\/span><span style=\"font-weight: 400;\">\u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 <\/span><strong><span style=\"color: #d80a77;\">enum<\/span><\/strong><span style=\"font-weight: 400;\">, \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong><span style=\"color: #680da1;\"> Optional<\/span><\/strong> \u043d\u0430 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u0447\u0430\u0441\u0442\u043e, \u0447\u0442\u043e <\/span><strong>Swift<\/strong><span style=\"font-weight: 400;\"> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u201c\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0430\u0445\u0430\u0440\u0430\u201d, \u0430 \u043f\u043e \u0441\u0443\u0442\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <\/span><strong><span style=\"color: #d80a77;\">enum<\/span> <span style=\"color: #680da1;\">Optional<\/span><\/strong><span style=\"font-weight: 400;\">. \u0412\u043e\u0441\u043a\u043b\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 <strong><span style=\"color: #680da1;\">!<\/span> <\/strong>\u0437\u043d\u0430\u043a, \u0432\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 <strong><span style=\"color: #680da1;\">?<\/span><\/strong> \u0437\u043d\u0430\u043a, \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 <strong><span style=\"color: #680da1;\">??<\/span> <\/strong>\u0437\u043d\u0430\u043a,\u00a0 <strong><span style=\"color: #d80a77;\">nil<\/span><\/strong>, <strong><span style=\"color: #d80a77;\">if let<\/span><\/strong> &#8212; \u0432\u0441\u0435 \u044d\u0442\u043e \u201c\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0445\u0430\u0440\u201d \u0434\u043b\u044f <strong><span style=\"color: #680da1;\">Optional<\/span><\/strong>, \u0438 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u043e\u0440 \u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u044e \u044d\u0442\u043e\u043c\u0443 \u201c\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0441\u0430\u0445\u0430\u0440\u0443\u201d \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430\u0434 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c\u0438 <strong><span style=\"color: #d80a77;\">enum<\/span><\/strong>.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u041a\u043e\u0434 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0434\u043b\u044f \u041b\u0435\u043a\u0446\u0438\u0438 4 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430<a href=\"https:\/\/github.com\/BestKora\/Demo-Winter-2017\"><strong>\u00a0<\/strong><\/a><a href=\"https:\/\/github.com\/BestKora\/CS193P-Spring-2021-iOS14\"><strong>Github<\/strong><\/a>\u00a0\u0434\u043b\u044f <strong>iOS 14<\/strong>\u00a0\u0432 \u043f\u0430\u043f\u043a\u0435 Memorize\u00a0<strong>L4<\/strong>.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u0420\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0439 \u043d\u0435\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u043f\u0435\u043a\u0442 \u041b\u0435\u043a\u0446\u0438\u0438 4, \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439, \u0445\u0440\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u0432\u0438\u0434\u0435 <strong>PDF<\/strong>-\u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c offline, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435\u00a0<strong>Google Doc<\/strong>\u00a0\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430<strong>\u00a0<a title=\"\u0414\u043e\u0441\u0442\u0443\u043f \u043a 1-\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 (\u043b\u0435\u043a\u0446\u0438\u0438 1-5) iOS 14\" href=\"https:\/\/bestkora.com\/IosDeveloper\/dostup-k-1-oj-chasti-ios-14\/\">\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u0435<\/a>.<\/strong><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u042d\u0442\u043e \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0430\u044f \u041b\u0435\u043a\u0446\u0438\u044f \u043a\u0443\u0440\u0441\u0430 Stanford CS193p, \u0432\u0435\u0441\u043d\u0430 2021 \u0433\u043e\u0434\u0430, \u0438 \u043e\u043d\u0430 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u041b\u0435\u043a\u0446\u0438\u0438 3, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b\u0438 \u0441\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043c\u043e\u0434\u0435\u043b\u044c Model \u0438 ViewModel \u0434\u043b\u044f\u00a0\u043a\u0430\u0440\u0442\u043e\u0447\u043d\u043e\u0439 \u0438\u0433\u0440\u044b &#171;\u043d\u0430 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435&#187; Memorize.\u00a0 View\u00a0 (\u0442\u043e \u0435\u0441\u0442\u044c UI) \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u0430 &hellip; <a href=\"https:\/\/bestkora.com\/IosDeveloper\/lektsiya-4-bolshe-o-mvvm-enum-optional-cs193p-spring-2021\/\">\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71,9,72,62,54],"tags":[70,77,73,74,56],"class_list":["post-14180","post","type-post","status-publish","format-standard","hentry","category-ios-14","category-lecture","category-stanford-cs-193p-ios-14","category-swift-5","category-swiftui","tag-ios-14","tag-lecture-4","tag-stanford-cs193p-spring-2021","tag-swift-5-4","tag-swiftui"],"aioseo_notices":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/posts\/14180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/comments?post=14180"}],"version-history":[{"count":4,"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/posts\/14180\/revisions"}],"predecessor-version":[{"id":14208,"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/posts\/14180\/revisions\/14208"}],"wp:attachment":[{"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/media?parent=14180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/categories?post=14180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bestkora.com\/IosDeveloper\/wp-json\/wp\/v2\/tags?post=14180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}