{"id":290831,"date":"2018-10-15T20:45:02","date_gmt":"2018-10-15T16:45:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=290831"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2018-10-15T16:45:02","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=290831","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b: \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 iOS Coordinator pattern"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3s\/ap\/0w\/3sap0w70jyzre12wi-c8r9132l4.png\"><br \/>  (<a href=\"http:\/\/vk.com\/phkdesign\"><i>\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f<\/i><\/a>)<\/p>\n<p>  \u041a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432, \u0438 \u043d\u0435\u043c\u0430\u043b\u043e \u0431\u044b\u043b\u043e \u043e\u0431 \u044d\u0442\u043e \u043a\u043e\u043f\u0438\u0439 \u0441\u043b\u043e\u043c\u0430\u043d\u043e. \u0412\u043e\u0442 \u0438 \u043c\u044b \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Umbrella IT \u0432\u0441\u0435\u0433\u0434\u0430 \u0445\u043e\u0442\u0435\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0433\u0438\u0431\u043a\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u0447\u0435\u043c-\u0442\u043e \u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u044b\u043c, \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438, mock-\u0444\u0430\u0439\u043b\u043e\u0432, \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0438 \u0431\u044b\u0442\u044c \u0447\u0435\u043c-\u0442\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u044b\u043c, \u0447\u0435\u043c-\u0442\u043e \u0442\u0430\u043a\u0438\u043c, \u0447\u0442\u043e \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u043d\u0430\u0432\u0438\u0441\u0430\u0435\u0442 \u043d\u0430\u0434 \u0440\u0430\u0437\u0440\u043e\u0441\u0448\u0438\u043c\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0440\u0435\u0447\u044c \u043d\u0435 \u0438\u0434\u0435\u0442 \u043e \u043d\u043e\u0432\u043e\u0439 \u00ab\u044d\u043a\u0441\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u043e\u0439\u00bb \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0441 \u0432\u044b\u0447\u0443\u0440\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c-\u0430\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0442\u0443\u0440\u043e\u0439. \u041d\u0430\u0434\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b (MVP, MVVM, VIPER, Clean-swift) \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438, \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043b\u0438\u0448\u044c \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u0438\u043d\u044f\u0442\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u0435\u0445 \u0441\u0430\u043c\u044b\u0445, \u043f\u043e\u0447\u0442\u0438 \u043c\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439: \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c, \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c, \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c, \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435.<a name=\"habracut\"><\/a><\/p>\n<p>  \u0411\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u044b\u0432\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043b\u0438\u0448\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0440\u0430\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u043e \u043d\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445 \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438. \u0412\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 segue-\u0441\u0432\u044f\u0437\u044f\u043c\u0438, \u043f\u0440\u0438\u043f\u0440\u0430\u0432\u0438\u0432 \u0432\u0441\u0435 \u044d\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u043c \u0434\u043e\u0431\u0440\u044b\u043c MVC\/MVP. \u0418 \u0445\u043e\u0442\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u0441\u043d\u043e\u0431\u0438\u0437\u043c \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u043e\u0434\u043e\u043b\u0435\u0432\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430, \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0441\u043e\u0438\u0437\u043c\u0435\u0440\u0438\u043c\u0430 \u0446\u0435\u043b\u044f\u043c \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0418 \u0432\u043e\u0442, \u0435\u0441\u043b\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f, \u0440\u0435\u0436\u0438\u043c \u0413\u043e\u0441\u0442\u044f, \u043e\u0444\u043b\u0430\u0439\u043d, \u0440\u043e\u043b\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0442.\u0434.), \u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043d\u0435\u043f\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441\u044b\u0433\u0440\u0430\u0435\u0442 \u0437\u043b\u0443\u044e \u0448\u0443\u0442\u043a\u0443: \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439 \u0438 \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u043f\u0435\u0440\u0435\u0431\u0440\u043e\u0441 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u044d\u043a\u0440\u0430\u043d\u0430\u043c\u0438 \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0435\u0439 \u0438 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u0438 \u0443 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u043c\u0435\u0440\u0442\u0432\u043e \u0432\u043f\u043b\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u044d\u043a\u0440\u0430\u043d \u0410 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u044d\u043a\u0440\u0430\u043d B. \u041f\u043e\u043f\u044b\u0442\u043a\u0438 \u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443\u0442 \u043a \u043c\u0443\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430\u043c, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0430\u043a \u043b\u0435\u0433\u043a\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u043b\u043e\u043c\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u0440\u0430\u043d\u044c\u0448\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435 \u043c\u044b \u043e\u043f\u0438\u0448\u0435\u043c \u0433\u0438\u0431\u043a\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f: \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d \u0438 \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d \u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043d\u0435\u043a\u0438\u0439 Main-\u044d\u043a\u0440\u0430\u043d.<\/p>\n<p>  <b><\/p>\n<h1>1. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432<\/h1>\n<p><\/b><br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u0443. \u0412\u0441\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 Coordinatable, Presentable, Routable:<\/p>\n<pre><code>protocol Coordinatable: class {     func start()     }   protocol Presentable {     var toPresent: UIViewController? { get } }   extension UIViewController: Presentable {     var toPresent: UIViewController? {         return self     }          func showAlert(title: String, message: String? = nil) {         UIAlertController.showAlert(title: title,                                     message: message,                                     inViewController: self,                                     actionBlock: nil)     } }<\/code><\/pre>\n<p>  <i>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 showAlert \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 UIViewController.<\/i><\/p>\n<pre><code>protocol Routable: Presentable {          func present(_ module: Presentable?)     func present(_ module: Presentable?, animated: Bool)          func push(_ module: Presentable?)     func push(_ module: Presentable?, animated: Bool)     func push(_ module: Presentable?, animated: Bool, completion: CompletionBlock?)          func popModule()     func popModule(animated: Bool)          func dismissModule()     func dismissModule(animated: Bool, completion: CompletionBlock?)          func setRootModule(_ module: Presentable?)     func setRootModule(_ module: Presentable?, hideBar: Bool)          func popToRootModule(animated: Bool) }<\/code><\/pre>\n<p>  <b><\/p>\n<h1>2. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430<\/h1>\n<p><\/b><br \/>  \u0412\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0441\u043b\u043e\u0439 \u0431\u0435\u0437 downcast\u2019a, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u0435\u0437 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u044f SOLID-\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432.<\/p>\n<p>  \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/iw\/og\/ya\/iwogyacswjrawufbwtijmp9mbp0.jpeg\"><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u044b\u0437\u0432\u0430\u043d \u043c\u0435\u0442\u043e\u0434 AppCoordinator\u2019\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043a\u0430\u043a\u043e\u0439 flow \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d, \u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c flow \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430 \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e flow \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b MainCoordinator \u0438 AuthorizationCoordinator. \u041c\u044b \u043e\u043f\u0438\u0448\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0432\u0441\u0435 \u043f\u0440\u043e\u0447\u0438\u0435 \u044d\u043a\u0440\u0430\u043d\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c output \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0443, \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0442 \u043c\u043e\u0433 \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u044f\u0437\u044c \u0441 \u0432\u044b\u0448\u0435\u0441\u0442\u043e\u044f\u0449\u0438\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u043c (AppCoordinator):<\/p>\n<pre><code>protocol AuthorizationCoordinatorOutput: class {     var finishFlow: CompletionBlock? { get set } }   final class AuthorizationCoordinator: BaseCoordinator, AuthorizationCoordinatorOutput {        var finishFlow: CompletionBlock?          fileprivate let factory: AuthorizationFactoryProtocol     fileprivate let router : Routable          init(router: Routable, factory: AuthorizationFactoryProtocol) {         self.router  = router         self.factory = factory     } }   \/\/ MARK:- Coordinatable extension AuthorizationCoordinator: Coordinatable {     func start() {         performFlow()     } }   \/\/ MARK:- Private methods private extension AuthorizationCoordinator {     func performFlow() {        \/\/:- Will implement later     } }<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dd\/gt\/fj\/ddgtfjhqknwgahfd2dtbpffvice.jpeg\"><br \/>  \u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c Authorization \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440 \u0441 \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u043c \u0438 \u0444\u0430\u0431\u0440\u0438\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u041d\u043e \u043a\u0442\u043e \u0438 \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 start()?<br \/>  \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c AppCoordinator.<\/p>\n<pre><code>final class AppCoordinator: BaseCoordinator {          fileprivate let factory: CoordinatorFactoryProtocol     fileprivate let router : Routable          fileprivate let gateway = Gateway()          init(router: Routable, factory: CoordinatorFactory) {         self.router  = router         self.factory = factory     } }   \/\/ MARK:- Coordinatable extension AppCoordinator: Coordinatable {     func start() {         self.gateway.getState { [unowned self] (state) in             switch state {             case .authorization:                 self.performAuthorizationFlow()             case .main:                 self.performMainFlow()            }         }     } }   \/\/ MARK:- Private methods     func performAuthorizationFlow() {         let coordinator = factory.makeAuthorizationCoordinator(with: router)         coordinator.finishFlow = { [weak self, weak coordinator] in             guard                 let `self` = self,                 let `coordinator` = coordinator             else { return }             self.removeDependency(coordinator)             self.start()         }         addDependency(coordinator)         coordinator.start()     }   func performMainFlow() { \/\/ MARK:- main flow logic } <\/code><\/pre>\n<p>  \u0418\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0443 AppCoordinator\u2019a \u0435\u0441\u0442\u044c \u0440\u043e\u0443\u0442\u0435\u0440, \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0442\u043e\u0447\u043a\u0438 \u0432\u0445\u043e\u0434\u0430 \u0434\u043b\u044f AppCoordinator\u2019a, \u0440\u043e\u043b\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0440\u0442\u0430 flow \u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>final class CoordinatorFactory {     fileprivate let modulesFactory = ModulesFactory() }   extension CoordinatorFactory: CoordinatorFactoryProtocol {     func makeAuthorizationCoordinator(with router: Routable) -&gt; Coordinatable &amp; AuthorizationCoordinatorOutput {         return AuthorizationCoordinator(router: router, factory: modulesFactory)     } }<\/code><\/pre>\n<p>  <b><\/p>\n<h1>3. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432<\/h1>\n<p><\/b><br \/>  \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u043c \u0438 \u0444\u0430\u0431\u0440\u0438\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u043e\u0432 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430:<\/p>\n<pre><code>class BaseCoordinator {          var childCoordinators: [Coordinatable] = []              \/\/ Add only unique object          func addDependency(_ coordinator: Coordinatable) {                 for element in childCoordinators {             if element === coordinator { return }         }         childCoordinators.append(coordinator)     }          func removeDependency(_ coordinator: Coordinatable?) {         guard             childCoordinators.isEmpty == false,             let coordinator = coordinator             else { return }                  for (index, element) in childCoordinators.enumerated() {             if element === coordinator {                 childCoordinators.remove(at: index)                 break             }         }     } }<\/code><\/pre>\n<p>  BaseCoordinator \u2014 \u043a\u043b\u0430\u0441\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \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 \u0438 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430: \u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0438 \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>  <b><\/p>\n<h1>4. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 AppDelegate<\/h1>\n<p><\/b><br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 <b>UIApplicationMain:<\/b><\/p>\n<pre><code>@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate {          var window: UIWindow?          var rootController: UINavigationController {         window?.rootViewController = UINavigationController()         window?.rootViewController?.view.backgroundColor = .white         return window?.rootViewController as! UINavigationController     }       fileprivate lazy var coordinator: Coordinatable = self.makeCoordinator()   func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {         coordinator.start()         return true     } }   \/\/ MARK:- Private methods private extension AppDelegate {     func makeCoordinator() -&gt; Coordinatable {         return AppCoordinator(router: Router(rootController: rootController),                               factory: CoordinatorFactory())     } }<\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0430 didFinishLaunchingWithOptions \u2014 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 start() \u0443 AppCoordinator\u2019\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  <b><\/p>\n<h1>5. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u044d\u043a\u0440\u0430\u043d\u0430<\/h1>\n<p><\/b><br \/>  \u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u0430\u043b\u044c\u0448\u0435, \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043d\u0430\u0437\u0430\u0434 \u043a AuthorizationCoordinator \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434 performFlow().<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 AuthorizationFactoryProtocol \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 ModulesFactory:<\/p>\n<pre><code>final class ModulesFactory {}   \/\/ MARK:- AuthorizationFactoryProtocol   extension ModulesFactory: AuthorizationFactoryProtocol {      func makeEnterView() -&gt; EnterViewProtocol {           let view: EnterViewController =  EnterViewController.controllerFromStoryboard(.authorization)           EnterAssembly.assembly(with: view)          return view<\/code><\/pre>\n<p>  \u041f\u043e\u0434 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u043b\u044e\u0431\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0443 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f ViewController\u2019a \u0438\u0437 \u0441\u0442\u043e\u0440\u0438\u0431\u043e\u0440\u0434\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b (MVP, MVVM, CleanSwift).<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 performFlow() \u0443 AuthorizationCoordinator\u2019\u0430. <br \/>  \u0421\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u043c \u044d\u043a\u0440\u0430\u043d\u043e\u043c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f EnterView.<br \/>  \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 performFlow() \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430, \u0434\u0430\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0432 \u0442\u043e\u0442 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u0448 view controller, \u0437\u0430\u0442\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443 \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u043a\u043e\u0440\u043d\u0435\u043c \u0432 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0441\u0442\u0435\u043a\u0435 \u044d\u043a\u0440\u0430\u043d\u043e\u0432:<\/p>\n<pre><code>private extension AuthorizationCoordinator {       func performFlow() {         let enterView = factory.makeEnterView()           finishFlow =  enterView.onCompleteAuthorization           enterView.output?.onAlert = { [unowned self] (message: String) in             self.router.toPresent?.showAlert(message: message)           }          router.setRootModule(enterView) } }<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/j-\/og\/t9\/j-ogt9bti0cndmozt4znuly95sk.jpeg\"><\/p>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043a\u0430\u0436\u0443\u0449\u0443\u044e\u0441\u044f \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 mock-\u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430\u0441 \u043e\u0442 UIKit, \u0447\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0442\u0435\u0441\u0442\u0430\u043c\u0438. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0435\u043c, Coordinator \u043d\u0435 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u0438\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u0443\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u0442\u043e\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438.<\/p>\n<p>  <a href=\"https:\/\/github.com\/MaksimKazachkov\/iOS-Clean-Architecture-with-Coordinator-pattern\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 github<\/a>, \u0433\u0434\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0434\u0435\u043c\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Clean \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 Xcode Template \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0441\u043b\u043e\u0435\u0432.<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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\/post\/426507\/\"> https:\/\/habr.com\/post\/426507\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3s\/ap\/0w\/3sap0w70jyzre12wi-c8r9132l4.png\"><br \/>  (<a href=\"http:\/\/vk.com\/phkdesign\"><i>\u0418\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f<\/i><\/a>)<\/p>\n<p>  \u041a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432, \u0438 \u043d\u0435\u043c\u0430\u043b\u043e \u0431\u044b\u043b\u043e \u043e\u0431 \u044d\u0442\u043e \u043a\u043e\u043f\u0438\u0439 \u0441\u043b\u043e\u043c\u0430\u043d\u043e. \u0412\u043e\u0442 \u0438 \u043c\u044b \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Umbrella IT \u0432\u0441\u0435\u0433\u0434\u0430 \u0445\u043e\u0442\u0435\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0433\u0438\u0431\u043a\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u0447\u0435\u043c-\u0442\u043e \u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u044b\u043c, \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438, mock-\u0444\u0430\u0439\u043b\u043e\u0432, \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0438 \u0431\u044b\u0442\u044c \u0447\u0435\u043c-\u0442\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u044b\u043c, \u0447\u0435\u043c-\u0442\u043e \u0442\u0430\u043a\u0438\u043c, \u0447\u0442\u043e \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u043d\u0430\u0432\u0438\u0441\u0430\u0435\u0442 \u043d\u0430\u0434 \u0440\u0430\u0437\u0440\u043e\u0441\u0448\u0438\u043c\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0440\u0435\u0447\u044c \u043d\u0435 \u0438\u0434\u0435\u0442 \u043e \u043d\u043e\u0432\u043e\u0439 \u00ab\u044d\u043a\u0441\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u043e\u0439\u00bb \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0441 \u0432\u044b\u0447\u0443\u0440\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c-\u0430\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0442\u0443\u0440\u043e\u0439. \u041d\u0430\u0434\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b (MVP, MVVM, VIPER, Clean-swift) \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438, \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043b\u0438\u0448\u044c \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u0438\u043d\u044f\u0442\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u0435\u0445 \u0441\u0430\u043c\u044b\u0445, \u043f\u043e\u0447\u0442\u0438 \u043c\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439: \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c, \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c, \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c, \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\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-290831","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/290831","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=290831"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/290831\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=290831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=290831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=290831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}