{"id":331557,"date":"2022-04-05T21:00:22","date_gmt":"2022-04-05T21:00:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=331557"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=331557","title":{"rendered":"<span>\u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0435\u0439 \u0432 iOS-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445. \u041f\u0430\u0442\u0442\u0435\u0440\u043d \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 \u043e\u0442 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442\u0430<\/span>"},"content":{"rendered":"<div><img loading=\"lazy\" decoding=\"async\" height=\"1\" src=\"https:\/\/www.facebook.com\/tr?id=958377731767214&amp;ev=sm_blog&amp;noscript=1\" width=\"1\" style=\"display: none;\"><img loading=\"lazy\" decoding=\"async\" height=\"1\" src=\"https:\/\/www.facebook.com\/tr?id=958377731767214&amp;ev=ios_dev&amp;noscript=1\" width=\"1\" style=\"display: none;\"><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/45c\/d7b\/039\/45cd7b039929aa2a777b9b2ee4a89bed.png\" width=\"1480\" height=\"834\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/45c\/d7b\/039\/45cd7b039929aa2a777b9b2ee4a89bed.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0432 iOS-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 UIViewController. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u044d\u043a\u0440\u0430\u043d\u044b \u0438\u043b\u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u043c\u0438. \u0421\u043b\u043e\u0436\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043b\u0443\u0447\u0448\u0435 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p>\u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043a\u0430\u043a \u0438 \u0437\u0430\u0447\u0435\u043c \u043c\u044b \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 Coordinator.  <\/p>\n<blockquote>\n<p><em>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u0424\u0438\u043b\u0438\u043f\u043f\u0430 \u041a\u0440\u0430\u0441\u043d\u043e\u0432\u0438\u0434\u0430 \u043d\u0430 <\/em><a href=\"https:\/\/www.youtube.com\/watch?v=1PyaRtMwEws\" rel=\"noopener noreferrer nofollow\"><em><u>iOS Meetup \u043e\u0442 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442 Tech<\/u><\/em><\/a><em><u>.<\/u><\/em><u> <\/u><\/p>\n<\/blockquote>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u044b<\/h2>\n<p>\u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 \u2014 \u044d\u0442\u043e \u043e\u0441\u043e\u0431\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u044d\u043a\u0440\u0430\u043d\u0430\u043c\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0418\u0434\u0435\u044e \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 <a href=\"https:\/\/khanlou.com\/2015\/01\/the-coordinator\/\" rel=\"noopener noreferrer nofollow\"><u>\u043e\u043f\u0438\u0441\u0430\u043b \u0421\u043e\u0440\u0443\u0448 \u0425\u0430\u043d\u043b\u043e\u0443 \u0432 2015 \u0433\u043e\u0434\u0443.<\/u><\/a>\u00a0<\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0437\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0432 iOS \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 UIViewController. \u041e\u043d \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u044d\u043a\u0440\u0430\u043d\u044b, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0438 \u043e\u0442\u043a\u043b\u0438\u043a \u043d\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412 \u043a\u043b\u0430\u0441\u0441\u0435 \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u043a\u0440\u0430\u043d\u044b \u0438 \u043f\u043e\u0442\u043e\u043a\u0438 (segues) \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0432 \u0444\u0430\u0439\u043b Storyboard, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043d\u0443\u0436\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u043a\u043e\u0434\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 UINavigationController;<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u043a\u0440\u0430\u043d \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 present(_:animated:completion:).<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e, \u043f\u043e\u043a\u0430 \u043c\u044b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u044d\u043a\u0440\u0430\u043d\u044b \u0432 \u0441\u0442\u0440\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u044d\u043a\u0440\u0430\u043d\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439.\u00a0<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0441\u0430\u043c\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 UIViewController. \u0412\u0441\u0435 \u0432\u044b\u0437\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u044d\u043a\u0440\u0430\u043d\u044b \u0436\u0451\u0441\u0442\u043a\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c. \u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u043a\u0440\u0430\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u043d\u0430\u0442\u044c \u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u0442\u0438\u043f\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/company\/oleg-bunin\/blog\/423299\/\" rel=\"noopener noreferrer nofollow\"><u>\u0432 \u0440\u0430\u0437\u0431\u043e\u0440\u0435 \u041f\u0430\u0432\u043b\u0430 \u0413\u0443\u0440\u043e\u0432\u0430<\/u><\/a>.<\/p>\n<p>\u0420\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0438\u0437 UIViewController.\u00a0 \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u0441\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u044d\u043a\u0440\u0430\u043d\u043e\u0432, \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043a\u0438 \u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b. \u0410 \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0432 \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 Coordinator, \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0437\u0430 \u0432\u044b\u0437\u043e\u0432\u044b \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0422\u043e\u0433\u0434\u0430 \u044d\u043a\u0440\u0430\u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u00ab\u0437\u043d\u0430\u0442\u044c\u00bb, \u0432 \u043a\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043e\u043d\u0438 \u0438\u0434\u0443\u0442 \u0438 \u043a\u043e\u043c\u0443 \u043a\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/934\/302\/6b2\/9343026b2bea010ffbd6f66a37460021.png\" alt=\"\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 LoginCoordinator \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0438\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 LoginCoordinator \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0438\" width=\"1560\" height=\"501\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/934\/302\/6b2\/9343026b2bea010ffbd6f66a37460021.png\"\/><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 LoginCoordinator \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0438<\/figcaption><\/figure>\n<p>\u041c\u044b \u043c\u043e\u0433\u043b\u0438 \u0432\u0437\u044f\u0442\u044c <a href=\"https:\/\/github.com\/search?q=coordinator+ios\" rel=\"noopener noreferrer nofollow\"><u>\u043e\u0434\u043d\u0443 \u0438\u0437 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439<\/u><\/a> \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u043b\u0438\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e.<\/p>\n<h2>\u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432<\/h2>\n<p>\u041d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c:\u00a0<\/p>\n<p><strong>\u0418\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442-\u043a\u043e\u0434\u0430.<\/strong> \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0443\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u043a\u0443\u0441\u043a\u0438 \u043a\u043e\u0434\u0430 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0435\u0435. \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0447\u0443\u0436\u0438\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442-\u0443\u0447\u0430\u0441\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b.<\/p>\n<p><strong>\u041f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/strong> \u041d\u0430\u043c \u043d\u0430\u0434\u043e\u0435\u043b\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u044d\u043a\u0440\u0430\u043d\u043e\u0432. \u041d\u0430\u043c\u043d\u043e\u0433\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0443.<\/p>\n<p><strong>\u0423\u0431\u0440\u0430\u0442\u044c \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0430\u043a\u0442\u043e\u0440.<\/strong> \u0412\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u043e\u0448\u0438\u0431\u0430\u044e\u0442\u0441\u044f. \u041c\u044b \u0445\u043e\u0442\u0435\u043b\u0438, \u0447\u0442\u043e\u0431\u044b \u0443 \u043d\u0430\u0441 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a.\u00a0<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u0432\u043e\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430.<\/p>\n<h2>\u0427\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442\u0430 \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439<\/h2>\n<p>\u041c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435.\u00a0<\/p>\n<p><strong>Transition \u2014<\/strong> \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b<strong> <\/strong>\u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u043d\u0438\u043c\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0432 NavigationController \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u044d\u043a\u0440\u0430\u043d\u0430\u043c\u0438 \u0438 \u0432\u043a\u043b\u0430\u0434\u043a\u0430\u043c\u0438.<\/p>\n<p><strong>LyfeCycleListener \u2014 <\/strong>\u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043d\u0451\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 NavigationController:<\/p>\n<ul>\n<li>\n<p>increment \u0438 decrement \u2014 \u0430\u043d\u0430\u043b\u043e\u0433\u0438 pop \u0438 push;<\/p>\n<\/li>\n<li>\n<p>startNotify \u2014 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432 \u0441\u0442\u0435\u043a\u0435 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>dismissNotify \u2014 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043b\u044e\u0431\u043e\u0433\u043e \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430;<\/p>\n<\/li>\n<li>\n<p>toRootNotify \u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f pop-to-root, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0432 \u0441\u0442\u0435\u043a\u0435.<\/p>\n<\/li>\n<\/ul>\n<p><strong>SystemNavigation<\/strong> \u2014 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0438\u0437 UIkit.<\/p>\n<pre><code class=\"swift\">\/\/\/ \u0410\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u043e\u0442 UIKit'a public protocol Transition: AnyObject {     var transitioning: UIViewControllerAnimatedTransitioning { get } }<\/code><\/pre>\n<pre><code class=\"swift\">\/\/\/ \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u044e\u043d\u0438\u0442\u043e\u0432 \u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430\u0445 public protocol LifeCycleListener: AnyObject {     func increment()     func decrement()     func startNotify()     func dismissNotify(event: ApplicationRouter.RouterEvent)      func toRootNofity(in router: Routable) }<\/code><\/pre>\n<pre><code class=\"swift\">\/\/\/ \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 UINavigationController \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 public protocol SystemNavigation: UINavigationController {     var popToRootHandler: (() -> Void)? { get set }     var popHandler: (() -> Void)? { get set } }<\/code><\/pre>\n<p><em>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 Transition, LifeCycleListener \u0438 SystemNavigation<\/em><\/p>\n<p>\u0414\u043b\u044f \u0441\u0432\u043e\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b\u0438 \u0434\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0430: BaseCoordinator \u0438 ApplicationRouter.<\/p>\n<p><strong>BaseCoordinator<\/strong> \u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u044d\u043a\u0440\u0430\u043d\u0430\u043c\u0438. \u0412 \u043d\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b: \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n<pre><code class=\"swift\">\/\/\/ \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430 open class BaseCoordinator {     public let router: Routable     private weak var parentCoordinator: BaseCoordinator?     private let listener = DefaultLifeCycleListener()     private var childCoordinators: [BaseCoordinator] = []        public private(set) var countUnits: Int = 0 {         didSet {             assert(countUnits >= 0, \"\u0427\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a!\")             if countUnits == 0 { parentCoordinator?.removeChild(self) }         }     }        public init(router: Routable, parent: BaseCoordinator? = nil) {         self.parentCoordinator = parent         self.router = router         self.router.subscribe(listener)         self.listener.recieveEvent = { ... }         }     } }  <\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 BaseCoordinator.\u00a0<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a countUnits. \u041e\u043d \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044e\u043d\u0438\u0442\u043e\u0432 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u0421\u044e\u0434\u0430 \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e parentCoordinator \u2014 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440. \u041e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c.\u00a0<\/p>\n<p>\u041f\u043e\u043b\u0435 listener \u2014 \u0432\u044b\u0437\u043e\u0432 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 LyfeCycleListener, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0442 \u0440\u043e\u0443\u0442\u0435\u0440\u0430.\u00a0<\/p>\n<p><strong>ApplicationRouter<\/strong> \u2014 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u043c. \u0420\u043e\u0443\u0442\u0435\u0440 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0438 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e \u043d\u0438\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0443. ApplicationRouter \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0440\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430:\u00a0<\/p>\n<ul>\n<li>\n<p>Routable,<\/p>\n<\/li>\n<li>\n<p>UINavigationControllerDelegate,<\/p>\n<\/li>\n<li>\n<p>UIAdaptivePresentationControllerDelegate.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b Routable \u043c\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043c<strong> subscribe<\/strong>. \u041e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"swift\">\/\/\/ \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0440\u043e\u0443\u0442\u0435\u0440 \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432 public protocol Routable: AnyObject {     func pushModule(_ module: Presentable, transition: Transition?, ....)     func setRootModule(_ module: Presentable, transition: Transition?, ...)     func popModule(transition: Transition?, animated: Bool, comletion: (() -> Void)?)     func popToRootModule(animated: Bool, completion: (() -> Void)?)        func presentModule(_ module: Presentable, ....)     func dismissModule(animated: Bool, completion: (() -> Void)?)     func closeModule(animated: Bool, transition transitionIfCan: Transition?, ...)        func subscribe(_ listener: LifeCycleListener) }<\/code><\/pre>\n<p>UINavigationControllerDelegate \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u044d\u043a\u0440\u0430\u043d\u0430\u043c\u0438. \u041e\u043d \u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 swipe-to-back, \u0442\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u0432\u0430\u0439\u043f \u0441 \u043a\u0440\u0430\u044f \u044d\u043a\u0440\u0430\u043d\u0430.<\/p>\n<p>UIAdaptivePresentationControllerDelegate \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0442 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u043d\u0430 \u0432\u0435\u0441\u044c \u044d\u043a\u0440\u0430\u043d.\u00a0<\/p>\n<h2>\u041a\u0430\u043a \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u044b<\/h2>\n<p>\u0421\u0445\u0435\u043c\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442 \u0432 \u0446\u0435\u043b\u043e\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0dc\/f98\/d9b\/0dcf98d9b3576a6e713a6a3731f6a278.png\" width=\"1600\" height=\"768\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0dc\/f98\/d9b\/0dcf98d9b3576a6e713a6a3731f6a278.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 ApplicationCoordinator, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0440\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438: \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e, \u0438\u0441\u0442\u043e\u0440\u0438\u044e, \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e \u043a \u0440\u0430\u0431\u043e\u0442\u0435, \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 TabBarCoordinator. \u041e\u043d \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u043f\u044f\u0442\u0438 \u0432\u043a\u043b\u0430\u0434\u043e\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:\u00a0<\/p>\n<ul>\n<li>\n<p>MainTabCoordinator (\u0413\u043b\u0430\u0432\u043d\u043e\u0435),<\/p>\n<\/li>\n<li>\n<p>CatalogTabCoordinator (\u041a\u0430\u0442\u0430\u043b\u043e\u0433),<\/p>\n<\/li>\n<li>\n<p>CartTabCoordinator (\u041a\u043e\u0440\u0437\u0438\u043d\u0430),<\/p>\n<\/li>\n<li>\n<p>FavoritesTabCoordinator (\u041b\u044e\u0431\u0438\u043c\u043e\u0435),<\/p>\n<\/li>\n<li>\n<p>ProfileTabCoordinator (\u041f\u0440\u043e\u0444\u0438\u043b\u044c).\u00a0<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/201\/370\/812\/201370812f69d4c80def88a0ebeccee4.png\" alt=\"\u0412\u043a\u043b\u0430\u0434\u043a\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442\" title=\"\u0412\u043a\u043b\u0430\u0434\u043a\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442\" width=\"389\" height=\"757\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/201\/370\/812\/201370812f69d4c80def88a0ebeccee4.png\"\/><figcaption>\u0412\u043a\u043b\u0430\u0434\u043a\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442<\/figcaption><\/figure>\n<p>\u0412 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u044d\u043a\u0440\u0430\u043d\u044b, \u0442\u0430\u043c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0442\u043e\u0436\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043d\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445, \u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e \u043d\u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430\u043c \u043c\u044b \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043c \u043a\u043e\u0434\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0432 2\u20134 \u0440\u0430\u0437\u0430.<\/p>\n<pre><code class=\"swift\">func openLoginFlow() {     let (coordinator, presentable) = coordinatorsFactory.makeLoginCoordinator()        coordinator.output = LoginCoordinatorOutput(onFinish: { [weak self, weak coordinator] reason in         guard             let strongCoordinator = coordinator,             let self = self         else { return }                  switch reason {         case .close: break         case .success, .closeConfirmationPhoneFlow:             self.didSuccessAuthorization()         }                                                                        self.router.dismissModule(animated: true)         self.removeDependency(strongCoordinator)     })        addDependency(coordinator)     router.present(presentable, animated: true)     coordinator.start(with: .login(source: .favouriteList), animated: false) }<\/code><\/pre>\n<p><em>\u0411\u044b\u043b\u043e: \u043a\u043e\u0434 \u043f\u043e\u043a\u0430\u0437\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430 \u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439<\/em><\/p>\n<pre><code class=\"swift\">func openLoginFlow() {   let unit = coordinatorsFactory.makeLoginCoordinator(output: self)     unit.coordinator.start(with: .login(source: .favouriteList))     router.presentModule(unit.view) }<\/code><\/pre>\n<p><em>\u0421\u0442\u0430\u043b\u043e: \u0442\u043e\u0442 \u0436\u0435 \u0432\u044b\u0437\u043e\u0432, \u043d\u043e \u0432 \u043d\u043e\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/em><\/p>\n<p>\u0414\u043e \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u0441\u0442\u0430\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432, \u0432 \u043a\u043e\u0434\u0435 \u0431\u044b\u043b \u043a\u0430\u043f\u0447\u0435\u0440-\u043b\u0438\u0441\u0442, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u041f\u043e\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u0438 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e.<\/p>\n<p>\u0421 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0441\u0442\u0430\u043b\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u0440\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0412 \u0440\u0435\u0434\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c 4\u20135 \u0441\u0442\u0440\u043e\u043a, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430 \u043c\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430. \u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/67c\/f01\/62b\/67cf0162b302db2120c3aa9360d14ea4.png\" alt=\"\u0416\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 UINavigationController-\u0441\u0442\u0435\u043a\u0430\" title=\"\u0416\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 UINavigationController-\u0441\u0442\u0435\u043a\u0430\" width=\"635\" height=\"297\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/67c\/f01\/62b\/67cf0162b302db2120c3aa9360d14ea4.png\"\/><figcaption>\u0416\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 UINavigationController-\u0441\u0442\u0435\u043a\u0430<\/figcaption><\/figure>\n<ol>\n<li>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 subscribe() \u2014 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 \u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 \u0440\u043e\u0443\u0442\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440, \u0432\u044b\u0437\u0432\u0430\u0432 \u043c\u0435\u0442\u043e\u0434 start.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 start() \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435. \u041f\u0443\u0448\u0438\u043c \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u043c pushModule \u0443 \u0440\u043e\u0443\u0442\u0435\u0440\u0430.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0420\u043e\u0443\u0442\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435-increment \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0443.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0442 \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 countUnits. countUnits == 0. \u0412 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 addChild() \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0421\u0447\u0435\u0442\u0447\u0438\u043a countUnits, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u043b \u0440\u0430\u0432\u0435\u043d 0, \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0432\u0435\u043d 1.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0415\u0449\u0435 \u0440\u0430\u0437 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0438 \u043f\u0443\u0448\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 pushModule.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0420\u043e\u0443\u0442\u0435\u0440 \u0441\u043d\u043e\u0432\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 increment \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0443.\u00a0<\/p>\n<\/li>\n<li>\n<p>countUnits \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0432\u0435\u043d 2.\u00a0<\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u043b\u0438 \u0432\u0441\u0451, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0443\u0436\u043d\u043e, \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 pop.<\/p>\n<ol start=\"11\">\n<li>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c, \u2014 \u043e\u043d \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0432 \u0441\u0442\u0435\u043a\u0435 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0420\u043e\u0443\u0442\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 decrement \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0443.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 countUnits \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0435\u0449\u0451 \u0440\u0430\u0437: \u043c\u0435\u0442\u043e\u0434 pop \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u0441\u0442\u0435\u043a\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0420\u043e\u0443\u0442\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 decrement.\u00a0<\/p>\n<\/li>\n<li>\n<p>countUnits == 0, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0441\u0435\u0431\u044f \u0438\u0437 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041d\u043e\u0432\u044b\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u0440\u0436\u0438\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u0434\u0435\u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f.\u00a0<\/p>\n<\/li>\n<\/ol>\n<p>\u0413\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u0443\u0431\u0440\u0430\u043b\u0438 \u043b\u0438\u0448\u043d\u0438\u0439 \u043a\u043e\u0434 \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043f\u0447\u0435\u0440-\u043b\u0438\u0441\u0442\u044b, \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442-\u043a\u043e\u0434;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u043c \u0446\u0438\u043a\u043b\u043e\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u0441\u0430\u043c \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u0441\u0432\u0430\u0439\u043f\u043e\u0432 \u043f\u043e \u044d\u043a\u0440\u0430\u043d\u0443 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443.\u00a0<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0451 \u0432\u043c\u0435\u0441\u0442\u0435 \u044d\u0442\u043e \u0434\u0430\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043a\u043e\u0434\u0435 \u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043b\u043e \u0436\u0438\u0437\u043d\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432.<\/p>\n<blockquote>\n<p><em>\u041c\u044b \u0437\u0430\u0432\u0435\u043b\u0438 \u0441\u043e\u0446\u0441\u0435\u0442\u0438 \u0441 \u043d\u043e\u0432\u043e\u0441\u0442\u044f\u043c\u0438 \u0438 \u0430\u043d\u043e\u043d\u0441\u0430\u043c\u0438 Tech-\u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e e-commerce, \u0441\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u043d\u0430\u043c\u0438 \u0442\u0430\u043c, \u0433\u0434\u0435 \u0432\u0430\u043c \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e: <\/em><a href=\"https:\/\/t.me\/sbermarket_tech\" rel=\"noopener noreferrer nofollow\"><em><u>Telegram<\/u><\/em><\/a><em>, <\/em><a href=\"https:\/\/vk.com\/sbermarket_tech\" rel=\"noopener noreferrer nofollow\"><em><u>VK<\/u><\/em><\/a><em>.<\/em><\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/654339\/\"> https:\/\/habr.com\/ru\/post\/654339\/<\/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_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0432 iOS-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 UIViewController. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u044d\u043a\u0440\u0430\u043d\u044b \u0438\u043b\u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u043c\u0438. \u0421\u043b\u043e\u0436\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043b\u0443\u0447\u0448\u0435 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p>\u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043a\u0430\u043a \u0438 \u0437\u0430\u0447\u0435\u043c \u043c\u044b \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 Coordinator.  <\/p>\n<blockquote>\n<p><em>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u0424\u0438\u043b\u0438\u043f\u043f\u0430 \u041a\u0440\u0430\u0441\u043d\u043e\u0432\u0438\u0434\u0430 \u043d\u0430 <\/em><a href=\"https:\/\/www.youtube.com\/watch?v=1PyaRtMwEws\" rel=\"noopener noreferrer nofollow\"><em><u>iOS Meetup \u043e\u0442 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442 Tech<\/u><\/em><\/a><em><u>.<\/u><\/em><u> <\/u><\/p>\n<\/blockquote>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u044b<\/h2>\n<p>\u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 \u2014 \u044d\u0442\u043e \u043e\u0441\u043e\u0431\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u044d\u043a\u0440\u0430\u043d\u0430\u043c\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0418\u0434\u0435\u044e \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 <a href=\"https:\/\/khanlou.com\/2015\/01\/the-coordinator\/\" rel=\"noopener noreferrer nofollow\"><u>\u043e\u043f\u0438\u0441\u0430\u043b \u0421\u043e\u0440\u0443\u0448 \u0425\u0430\u043d\u043b\u043e\u0443 \u0432 2015 \u0433\u043e\u0434\u0443.<\/u><\/a>\u00a0<\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0437\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0432 iOS \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 UIViewController. \u041e\u043d \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u044d\u043a\u0440\u0430\u043d\u044b, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0438 \u043e\u0442\u043a\u043b\u0438\u043a \u043d\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412 \u043a\u043b\u0430\u0441\u0441\u0435 \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u043a\u0440\u0430\u043d\u044b \u0438 \u043f\u043e\u0442\u043e\u043a\u0438 (segues) \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0432 \u0444\u0430\u0439\u043b Storyboard, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043d\u0443\u0436\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u043a\u043e\u0434\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 UINavigationController;<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u043a\u0440\u0430\u043d \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 present(_:animated:completion:).<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e, \u043f\u043e\u043a\u0430 \u043c\u044b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u044d\u043a\u0440\u0430\u043d\u044b \u0432 \u0441\u0442\u0440\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u044d\u043a\u0440\u0430\u043d\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439.\u00a0<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0441\u0430\u043c\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 UIViewController. \u0412\u0441\u0435 \u0432\u044b\u0437\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u044d\u043a\u0440\u0430\u043d\u044b \u0436\u0451\u0441\u0442\u043a\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c. \u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u043a\u0440\u0430\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u043d\u0430\u0442\u044c \u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u0442\u0438\u043f\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/company\/oleg-bunin\/blog\/423299\/\" rel=\"noopener noreferrer nofollow\"><u>\u0432 \u0440\u0430\u0437\u0431\u043e\u0440\u0435 \u041f\u0430\u0432\u043b\u0430 \u0413\u0443\u0440\u043e\u0432\u0430<\/u><\/a>.<\/p>\n<p>\u0420\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0438\u0437 UIViewController.\u00a0 \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u0441\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u044d\u043a\u0440\u0430\u043d\u043e\u0432, \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043a\u0438 \u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b. \u0410 \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0432 \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 Coordinator, \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0437\u0430 \u0432\u044b\u0437\u043e\u0432\u044b \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0422\u043e\u0433\u0434\u0430 \u044d\u043a\u0440\u0430\u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u00ab\u0437\u043d\u0430\u0442\u044c\u00bb, \u0432 \u043a\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043e\u043d\u0438 \u0438\u0434\u0443\u0442 \u0438 \u043a\u043e\u043c\u0443 \u043a\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442.<\/p>\n<figure class=\"full-width\"><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 LoginCoordinator \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0438<\/figcaption><\/figure>\n<p>\u041c\u044b \u043c\u043e\u0433\u043b\u0438 \u0432\u0437\u044f\u0442\u044c <a href=\"https:\/\/github.com\/search?q=coordinator+ios\" rel=\"noopener noreferrer nofollow\"><u>\u043e\u0434\u043d\u0443 \u0438\u0437 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439<\/u><\/a> \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u043b\u0438\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e.<\/p>\n<h2>\u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432<\/h2>\n<p>\u041d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c:\u00a0<\/p>\n<p><strong>\u0418\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442-\u043a\u043e\u0434\u0430.<\/strong> \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0443\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u043a\u0443\u0441\u043a\u0438 \u043a\u043e\u0434\u0430 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0435\u0435. \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0447\u0443\u0436\u0438\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442-\u0443\u0447\u0430\u0441\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b.<\/p>\n<p><strong>\u041f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/strong> \u041d\u0430\u043c \u043d\u0430\u0434\u043e\u0435\u043b\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u044d\u043a\u0440\u0430\u043d\u043e\u0432. \u041d\u0430\u043c\u043d\u043e\u0433\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0443.<\/p>\n<p><strong>\u0423\u0431\u0440\u0430\u0442\u044c \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0430\u043a\u0442\u043e\u0440.<\/strong> \u0412\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u043e\u0448\u0438\u0431\u0430\u044e\u0442\u0441\u044f. \u041c\u044b \u0445\u043e\u0442\u0435\u043b\u0438, \u0447\u0442\u043e\u0431\u044b \u0443 \u043d\u0430\u0441 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a.\u00a0<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u0432\u043e\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430.<\/p>\n<h2>\u0427\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442\u0430 \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439<\/h2>\n<p>\u041c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435.\u00a0<\/p>\n<p><strong>Transition \u2014<\/strong> \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b<strong> <\/strong>\u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u043d\u0438\u043c\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0432 NavigationController \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u044d\u043a\u0440\u0430\u043d\u0430\u043c\u0438 \u0438 \u0432\u043a\u043b\u0430\u0434\u043a\u0430\u043c\u0438.<\/p>\n<p><strong>LyfeCycleListener \u2014 <\/strong>\u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043d\u0451\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 NavigationController:<\/p>\n<ul>\n<li>\n<p>increment \u0438 decrement \u2014 \u0430\u043d\u0430\u043b\u043e\u0433\u0438 pop \u0438 push;<\/p>\n<\/li>\n<li>\n<p>startNotify \u2014 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432 \u0441\u0442\u0435\u043a\u0435 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438;<\/p>\n<\/li>\n<li>\n<p>dismissNotify \u2014 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043b\u044e\u0431\u043e\u0433\u043e \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430;<\/p>\n<\/li>\n<li>\n<p>toRootNotify \u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f pop-to-root, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0432 \u0441\u0442\u0435\u043a\u0435.<\/p>\n<\/li>\n<\/ul>\n<p><strong>SystemNavigation<\/strong> \u2014 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0438\u0437 UIkit.<\/p>\n<pre><code class=\"swift\">\/\/\/ \u0410\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u043e\u0442 UIKit'a public protocol Transition: AnyObject {     var transitioning: UIViewControllerAnimatedTransitioning { get } }<\/code><\/pre>\n<pre><code class=\"swift\">\/\/\/ \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u044e\u043d\u0438\u0442\u043e\u0432 \u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430\u0445 public protocol LifeCycleListener: AnyObject {     func increment()     func decrement()     func startNotify()     func dismissNotify(event: ApplicationRouter.RouterEvent)      func toRootNofity(in router: Routable) }<\/code><\/pre>\n<pre><code class=\"swift\">\/\/\/ \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 UINavigationController \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 public protocol SystemNavigation: UINavigationController {     var popToRootHandler: (() -> Void)? { get set }     var popHandler: (() -> Void)? { get set } }<\/code><\/pre>\n<p><em>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 Transition, LifeCycleListener \u0438 SystemNavigation<\/em><\/p>\n<p>\u0414\u043b\u044f \u0441\u0432\u043e\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b\u0438 \u0434\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0430: BaseCoordinator \u0438 ApplicationRouter.<\/p>\n<p><strong>BaseCoordinator<\/strong> \u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u044d\u043a\u0440\u0430\u043d\u0430\u043c\u0438. \u0412 \u043d\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b: \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n<pre><code class=\"swift\">\/\/\/ \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430 open class BaseCoordinator {     public let router: Routable     private weak var parentCoordinator: BaseCoordinator?     private let listener = DefaultLifeCycleListener()     private var childCoordinators: [BaseCoordinator] = []        public private(set) var countUnits: Int = 0 {         didSet {             assert(countUnits >= 0, \"\u0427\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a!\")             if countUnits == 0 { parentCoordinator?.removeChild(self) }         }     }        public init(router: Routable, parent: BaseCoordinator? = nil) {         self.parentCoordinator = parent         self.router = router         self.router.subscribe(listener)         self.listener.recieveEvent = { ... }         }     } }  <\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 BaseCoordinator.\u00a0<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a countUnits. \u041e\u043d \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044e\u043d\u0438\u0442\u043e\u0432 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u0421\u044e\u0434\u0430 \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e parentCoordinator \u2014 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440. \u041e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c.\u00a0<\/p>\n<p>\u041f\u043e\u043b\u0435 listener \u2014 \u0432\u044b\u0437\u043e\u0432 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 LyfeCycleListener, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0442 \u0440\u043e\u0443\u0442\u0435\u0440\u0430.\u00a0<\/p>\n<p><strong>ApplicationRouter<\/strong> \u2014 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u043c. \u0420\u043e\u0443\u0442\u0435\u0440 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0438 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e \u043d\u0438\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0443. ApplicationRouter \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0440\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430:\u00a0<\/p>\n<ul>\n<li>\n<p>Routable,<\/p>\n<\/li>\n<li>\n<p>UINavigationControllerDelegate,<\/p>\n<\/li>\n<li>\n<p>UIAdaptivePresentationControllerDelegate.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b Routable \u043c\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043c<strong> subscribe<\/strong>. \u041e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"swift\">\/\/\/ \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0440\u043e\u0443\u0442\u0435\u0440 \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432 public protocol Routable: AnyObject {     func pushModule(_ module: Presentable, transition: Transition?, ....)     func setRootModule(_ module: Presentable, transition: Transition?, ...)     func popModule(transition: Transition?, animated: Bool, comletion: (() -> Void)?)     func popToRootModule(animated: Bool, completion: (() -> Void)?)        func presentModule(_ module: Presentable, ....)     func dismissModule(animated: Bool, completion: (() -> Void)?)     func closeModule(animated: Bool, transition transitionIfCan: Transition?, ...)        func subscribe(_ listener: LifeCycleListener) }<\/code><\/pre>\n<p>UINavigationControllerDelegate \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u044d\u043a\u0440\u0430\u043d\u0430\u043c\u0438. \u041e\u043d \u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 swipe-to-back, \u0442\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u0432\u0430\u0439\u043f \u0441 \u043a\u0440\u0430\u044f \u044d\u043a\u0440\u0430\u043d\u0430.<\/p>\n<p>UIAdaptivePresentationControllerDelegate \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0442 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u043d\u0430 \u0432\u0435\u0441\u044c \u044d\u043a\u0440\u0430\u043d.\u00a0<\/p>\n<h2>\u041a\u0430\u043a \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u044b<\/h2>\n<p>\u0421\u0445\u0435\u043c\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442 \u0432 \u0446\u0435\u043b\u043e\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 ApplicationCoordinator, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0440\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438: \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e, \u0438\u0441\u0442\u043e\u0440\u0438\u044e, \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e \u043a \u0440\u0430\u0431\u043e\u0442\u0435, \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 TabBarCoordinator. \u041e\u043d \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u043f\u044f\u0442\u0438 \u0432\u043a\u043b\u0430\u0434\u043e\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:\u00a0<\/p>\n<ul>\n<li>\n<p>MainTabCoordinator (\u0413\u043b\u0430\u0432\u043d\u043e\u0435),<\/p>\n<\/li>\n<li>\n<p>CatalogTabCoordinator (\u041a\u0430\u0442\u0430\u043b\u043e\u0433),<\/p>\n<\/li>\n<li>\n<p>CartTabCoordinator (\u041a\u043e\u0440\u0437\u0438\u043d\u0430),<\/p>\n<\/li>\n<li>\n<p>FavoritesTabCoordinator (\u041b\u044e\u0431\u0438\u043c\u043e\u0435),<\/p>\n<\/li>\n<li>\n<p>ProfileTabCoordinator (\u041f\u0440\u043e\u0444\u0438\u043b\u044c).\u00a0<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><figcaption>\u0412\u043a\u043b\u0430\u0434\u043a\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442<\/figcaption><\/figure>\n<p>\u0412 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u044d\u043a\u0440\u0430\u043d\u044b, \u0442\u0430\u043c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0442\u043e\u0436\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043d\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445, \u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e \u043d\u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430\u043c \u043c\u044b \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043c \u043a\u043e\u0434\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0432 2\u20134 \u0440\u0430\u0437\u0430.<\/p>\n<pre><code class=\"swift\">func openLoginFlow() {     let (coordinator, presentable) = coordinatorsFactory.makeLoginCoordinator()        coordinator.output = LoginCoordinatorOutput(onFinish: { [weak self, weak coordinator] reason in         guard             let strongCoordinator = coordinator,             let self = self         else { return }                  switch reason {         case .close: break         case .success, .closeConfirmationPhoneFlow:             self.didSuccessAuthorization()         }                                                                        self.router.dismissModule(animated: true)         self.removeDependency(strongCoordinator)     })        addDependency(coordinator)     router.present(presentable, animated: true)     coordinator.start(with: .login(source: .favouriteList), animated: false) }<\/code><\/pre>\n<p><em>\u0411\u044b\u043b\u043e: \u043a\u043e\u0434 \u043f\u043e\u043a\u0430\u0437\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430 \u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439<\/em><\/p>\n<pre><code class=\"swift\">func openLoginFlow() {   let unit = coordinatorsFactory.makeLoginCoordinator(output: self)     unit.coordinator.start(with: .login(source: .favouriteList))     router.presentModule(unit.view) }<\/code><\/pre>\n<p><em>\u0421\u0442\u0430\u043b\u043e: \u0442\u043e\u0442 \u0436\u0435 \u0432\u044b\u0437\u043e\u0432, \u043d\u043e \u0432 \u043d\u043e\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/em><\/p>\n<p>\u0414\u043e \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u0441\u0442\u0430\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432, \u0432 \u043a\u043e\u0434\u0435 \u0431\u044b\u043b \u043a\u0430\u043f\u0447\u0435\u0440-\u043b\u0438\u0441\u0442, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u041f\u043e\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u0438 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e.<\/p>\n<p>\u0421 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0441\u0442\u0430\u043b\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u0440\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0412 \u0440\u0435\u0434\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c 4\u20135 \u0441\u0442\u0440\u043e\u043a, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430 \u043c\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430. \u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435.\u00a0<\/p>\n<figure class=\"full-width\"><figcaption>\u0416\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 UINavigationController-\u0441\u0442\u0435\u043a\u0430<\/figcaption><\/figure>\n<ol>\n<li>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 subscribe() \u2014 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 \u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 \u0440\u043e\u0443\u0442\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440, \u0432\u044b\u0437\u0432\u0430\u0432 \u043c\u0435\u0442\u043e\u0434 start.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 start() \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435. \u041f\u0443\u0448\u0438\u043c \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u043c pushModule \u0443 \u0440\u043e\u0443\u0442\u0435\u0440\u0430.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0420\u043e\u0443\u0442\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435-increment \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0443.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0442 \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 countUnits. countUnits == 0. \u0412 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 addChild() \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0421\u0447\u0435\u0442\u0447\u0438\u043a countUnits,<\/p>\n<\/li>\n<\/ol>\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-331557","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/331557","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=331557"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/331557\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=331557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=331557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=331557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}