{"id":327426,"date":"2022-01-10T08:53:23","date_gmt":"2022-01-10T08:53:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=327426"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=327426","title":{"rendered":"<span>Responder Chain, \u0438\u043b\u0438 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\" class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0434 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0442 <a href=\"https:\/\/www.youtube.com\/watch?v=z3u1qDao_d8&amp;t=909s\">\u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u0415\u0432\u0433\u0435\u043d\u0438\u044f \u0420\u0442\u0438\u0449\u0435\u0432\u0430<\/a> (@katleta) \u043d\u0430 \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0438 Mobius. \u0422\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0432 \u0435\u0433\u043e \u0434\u043e\u043a\u043b\u0430\u0434\u0435, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u0434\u0437\u0430\u0431\u044b\u0442\u044b\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 iOS, \u0431\u0435\u0437 \u0442\u0440\u0443\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438 \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>\u042f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0439 \u2014 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c Responder Chain.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/2f7\/b46\/36f\/2f7b4636f459d634274e97f5a4da9571.jpeg\" width=\"1280\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2f7\/b46\/36f\/2f7b4636f459d634274e97f5a4da9571.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/github.com\/ws233\/ResponderChain\">\u0442\u0443\u0442<\/a>.<\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Responder Chain<\/h2>\n<p>\u041d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a \u0442\u0435\u0440\u043c\u0438\u043d \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043a\u0430\u043a \u00ab\u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u043e\u0432\u00bb. <\/p>\n<p>\u0421\u0430\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0432 1988 \u0433\u043e\u0434\u0443 \u0438 \u0441\u0442\u0430\u043b \u0432\u044b\u0434\u0430\u044e\u0449\u0438\u043c\u0441\u044f \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043e\u0434\u043d\u043e\u0439 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0432 macOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 c \u0435\u0433\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u043c\u0435\u043d\u044e \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u0437 \u043b\u044e\u0431\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e\u0442 \u0436\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0431\u044b\u043b \u043f\u0440\u0438\u043d\u0435\u0441\u0451\u043d \u043d\u0430 iOS \u0438 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0448\u0451\u043b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0438 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0435\u043c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0439 (UITabBarController, UINavigationController, UISplitController, \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0438\u043f\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438).<\/p>\n<p>\u041f\u0440\u043e \u0441\u0430\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/developer.apple.com\/documentation\/uikit\/touches_presses_and_gestures\/using_responders_and_the_responder_chain_to_handle_events\">\u043f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0435<\/a>. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043d\u0430\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043f\u043e \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u043e\u0432 Responder Chain \u0443 Apple \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u0430\u0431\u0437\u0430\u0446, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u043d\u0430 \u0444\u043e\u043d\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430:<\/p>\n<blockquote>\n<p><em>Controls communicate directly with their associated target object using action messages. When the user interacts with a control, the control sends an action message to its target object. Action messages are not events, but they may still take advantage of the responder chain. When the target object of a control is nil, UIKit starts from the target object and traverses the responder chain until it finds an object that implements the appropriate action method. For example, the UIKit editing menu uses this behavior to search for responder objects that implement methods with names like cut(_:), copy(_:), or paste(_:). <\/em><\/p>\n<\/blockquote>\n<details class=\"spoiler\">\n<summary>\u041f\u0435\u0440\u0435\u0432\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441 \u0446\u0435\u043b\u0435\u0432\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0442\u043e\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438, \u043d\u043e \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u043e\u0432. \u041a\u043e\u0433\u0434\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0430\u0432\u0435\u043d nil, \u0442\u043e UIKit, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u043e\u0432, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0451\u0442 \u043e\u0431\u044a\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0435\u043d\u044e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f UIKit \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438, \u043a\u0430\u043a <\/em><strong><em>cut(_ \ud83d\ude42<\/em><\/strong><em>, <\/em><strong><em>copy(_ \ud83d\ude42<\/em><\/strong><em> \u0438\u043b\u0438 <\/em><strong><em>paste(_ \ud83d\ude42<\/em><\/strong><em>.<\/em><\/p>\n<\/div>\n<\/details>\n<p>\u0412\u0438\u0434\u0438\u043c\u043e, \u044d\u0442\u0438\u043c \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0442\u0430\u043a\u0430\u044f \u043c\u0430\u043b\u0430\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 iOS-\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b\u0430 <a href=\"https:\/\/habr.com\/ru\/post\/464463\/\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a>, \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u043f\u0440\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432. \u041c\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u0439.<\/p>\n<p>\u041c\u044b \u0436\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u044e \u043c\u043e\u0449\u044c, \u0441\u0438\u043b\u0443, \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0438 \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<h2>\u041e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 URL-\u0441\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>\u041a\u0430\u0436\u0434\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u044d\u043a\u0440\u0430\u043d \u0441 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u041e\u0431\u044b\u0447\u043d\u043e \u043d\u0430 \u0442\u0430\u043a\u043e\u043c \u044d\u043a\u0440\u0430\u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u043f\u0440\u0430\u0432\u043e\u0432\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439. \u0418\u043d\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u044d\u043a\u0440\u0430\u043d\u0430\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 splash-\u0441\u043a\u0440\u0438\u043d\u0435 \u0438 \u044d\u043a\u0440\u0430\u043d\u0435 \u00ab\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435\u00bb. \u041a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438? \u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0435\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c. <\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" height=\"242\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/81e\/100\/588\/81e100588cc7497c8e7793165bc89620.png\" data-width=\"962\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, 2 \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043e\u0431\u0449\u0430\u044e\u0442\u0441\u044f \u0441 \u043d\u0435\u043a\u0438\u043c \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u043c, \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u043c \u0432 \u0441\u0435\u0431\u0435 \u0432\u0435\u0441\u044c \u043a\u043e\u0434, \u043f\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044e \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e URL. \u0414\u0430\u043d\u043d\u044b\u0439 \u0440\u043e\u0443\u0442\u0435\u0440 \u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u0441 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f UIApplication, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <strong>open(_:options:completionHandler:)<\/strong>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438. \u0415\u0441\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0430\u043d\u0430\u0442\u043e\u043c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 VIPER, \u0447\u0430\u0441\u0442\u043e <a href=\"https:\/\/habr.com\/ru\/post\/358412\/#chapter0\">\u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043d\u0430 \u0425\u0430\u0431\u0440\u0435<\/a>, \u0442\u043e \u043e\u043d \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0435\u0449\u0451 \u043f\u043e 2 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0430 \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0438 \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u043c. \u0410 \u0435\u0441\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u2014 \u0441\u0435\u043d\u044c\u043e\u0440, \u0442\u043e \u043e\u043d \u0432\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f DI-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0441\u0435\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0441\u0445\u0435\u043c\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0451 \u0441\u0430\u043c.<\/p>\n<p>\u00ab\u0427\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0441 \u044d\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439?\u00bb \u2014 \u0441\u043f\u0440\u043e\u0441\u0438\u0442 \u043c\u0435\u043d\u044f \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c. <\/p>\n<p>\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Responder Chain.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443:<\/p>\n<ol start=\"1\">\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u043c\u0435\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u043f\u0443\u0441\u0442\u043e\u0433\u043e  \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u2014 UITabBarController.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043e\u0431\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u043f\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0435, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0438\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0435\u0438\u043d\u0442\u044b \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u00ab\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0425\u0430\u0431\u0440!\u00bb.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 UIApplication:<\/p>\n<pre><code>import UIKit  \/\/ MARK: - Actions extension UIApplication {     @IBAction func openHabr() {         guard let url = URL(string: \"https:\/\/habr.com\/ru\/feed\/\") else { return }         open(url, options: [:])     } }<\/code><\/pre>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"\/img\/image-loader.svg\" height=\"591\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/86b\/dfe\/f39\/86bdfef395b531430b12a9ec8c7556b1.png\" data-width=\"1531\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 Interface Builder \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 <strong>Touch Up Inside<\/strong> \u043e\u0431\u0435\u0438\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e (action) openHabr \u0447\u0435\u0440\u0435\u0437 \u0438\u043a\u043e\u043d\u043a\u0443 First Responder.   <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043a\u043b\u0438\u043a\u0430\u0435\u043c \u043f\u043e \u043e\u0431\u0435\u0438\u043c \u043a\u043d\u043e\u043f\u043a\u0430\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>\u0414\u0430-\u0434\u0430! \u0412\u0441\u0451 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e!<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f, \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u043a\u0440\u0430\u0448\u0430 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 (\u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430 \u0443 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c Responder Chain \u043a\u0440\u0430\u0448\u0430 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442).<\/p>\n<blockquote>\n<p>\u041e\u0431\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e:<\/p>\n<p>1. \u041a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0432 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0435, \u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0451\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0430. \u042d\u0442\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443, \u0447\u0442\u043e UIApplication \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u043c UIResponder \u0438 \u0432\u043a\u043b\u044e\u0447\u0451\u043d \u0432 Responder Chain.<\/p>\n<p>2. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u0432 \u0442\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b. \u041b\u0443\u0447\u0448\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u0445 \u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0447\u0435\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u0430\u043c \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0410 \u0432\u044b\u0437\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 Responder Chain. \u0422\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0437\u0430\u0432\u043e\u0434\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u0441\u0432\u044f\u0437\u0438, \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u043e \u0438\u0445 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u0446\u0438\u043a\u043b\u043e\u0432 \u0441\u0438\u043b\u044c\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a. \u0412 \u043e\u0431\u0449\u0435\u043c,      \u0441\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u044c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 <a href=\"https:\/\/habr.com\/ru\/post\/589489\/\">\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f<\/a>.<\/p>\n<p>3. \u041e\u0442 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0439 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0449\u0438\u0449\u0430\u0442\u044c\u0441\u044f \u0442\u0435\u0441\u0442\u0430\u043c\u0438 (\u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438, end-to-end).<\/p>\n<\/blockquote>\n<h2>\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u043a\u043b\u0430\u0434\u043e\u043a<\/h2>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u0441\u0451 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043d\u0430 UITabBarController:<\/p>\n<pre><code>import UIKit  extension UITabBarController {     @IBAction func openItem1() {         selectedIndex = 0     }          @IBAction func openItem2() {         selectedIndex = 1     } }<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u043a\u043d\u043e\u043f\u043a\u0443 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u00ab\u041e\u0442\u043a\u0440\u044b\u0442\u044c Item2\u00bb, \u0430 \u043d\u0430 \u0432\u0442\u043e\u0440\u0443\u044e \u2014 \u00ab\u041e\u0442\u043a\u0440\u044b\u0442\u044c Item1\u00bb. \u041a\u043d\u043e\u043f\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0442\u0430\u0431\u0431\u0430\u0440-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443. \u0420\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u043c \u0438\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0435\u0438\u043d\u0442\u044b. \u041f\u0440\u0438\u0432\u044f\u0436\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 Touch Up Inside \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u0438\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u0431\u0430\u0440-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u041d\u043e \u043d\u0430 \u0441\u0435\u0439 \u0440\u0430\u0437 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p>\u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u043d\u0430\u0441 Xcode\u2019\u043e\u043c ViewController \u0438 \u043f\u0440\u043e\u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u0446\u0438\u0444\u0440\u0430\u043c\u0438 1 \u0438 2, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c. \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0430\u0443\u0442\u043b\u0435\u0442 (outlet) \u0434\u043b\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043a\u043d\u043e\u043f\u043a\u0438, \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u0441 \u044d\u0442\u0438\u043c \u0430\u0443\u0442\u043b\u0435\u0442\u043e\u043c. \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0432 \u0441\u0442\u043e\u0440\u0438\u0431\u043e\u0440\u0434\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0418 \u0434\u0430\u043b\u044c\u0448\u0435 \u0432\u043e `viewDidLoad()` \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code>class ViewController1: UIViewController {      @IBOutlet public weak var buttonOpenItem2: UIButton!          override func viewDidLoad() {         super.viewDidLoad()         \/\/ Do any additional setup after loading the view.         buttonOpenItem2.addTarget(nil, action: #selector(UITabBarController.openItem2), for: .touchUpInside)     }  }<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c: \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u00ab\u041e\u0442\u043a\u0440\u044b\u0442\u044c ItemX\u00bb \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443.<\/p>\n<blockquote>\n<p>\u041e\u0431\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 (\u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430) \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043c\u043d\u043e\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432 Interface Builder.<\/p>\n<\/blockquote>\n<h2>Responder Chain \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438<\/h2>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Segue-\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432<\/h4>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u044f\u0447\u0435\u0439\u043a\u0443 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438\u0437 <a href=\"https:\/\/habr.com\/ru\/company\/psb\/blog\/588332\/\">\u0446\u0438\u043a\u043b\u0430<\/a>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043a \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u0430\u044f \u0432 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c\u043e\u043c \u043e\u043a\u043d\u0435, \u0434\u043e\u043b\u0436\u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u043d\u043e\u043f\u043a\u0430 \u043a\u0430\u043a\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u043d\u0430\u0436\u0430\u0442\u0430.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0421\u043d\u043e\u0432\u0430 \u043d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438:<\/p>\n<ol start=\"1\">\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0442\u0440\u0435\u0442\u044c\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u0442\u0430\u0431\u0431\u0430\u0440\u0430 UINavigationController \u0441 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c      UITableViewController. \u041d\u0430\u0437\u043e\u0432\u0451\u043c \u044d\u0442\u0443 \u0432\u043a\u043b\u0430\u0434\u043a\u0443 Item3.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u043e\u0435 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u0442\u0440\u0435\u043c\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438: \u00ab\u042f\u0447\u0435\u0439\u043a\u04301\u00bb, \u00ab\u042f\u0447\u0435\u0439\u043a\u04302\u00bb, \u00ab\u042f\u0447\u0435\u0439\u043a\u04303\u00bb. \u0412 \u043a\u0430\u0436\u0434\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043a\u043d\u043e\u043f\u043a\u0430 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u00abOpen Modal\u00bb. \u041f\u0440\u043e\u0441\u044c\u0431\u0430 \u043d\u0435 \u043f\u0440\u0435\u0434\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u0432\u044b\u0448\u0435\u043d\u043d\u044b\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 \u043d\u0430\u0448\u0435\u043c <a href=\"https:\/\/habr.com\/ru\/company\/psb\/blog\/588332\/\">\u0446\u0438\u043a\u043b\u0435 \u0441\u0442\u0430\u0442\u0435\u0439<\/a>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0441\u0442\u043e\u0440\u0438\u0431\u043e\u0440\u0434\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 UIViewController \u0438 \u0441 \u043a\u043d\u043e\u043f\u043a\u0438 Open Modal \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 (segue) \u043d\u0430 \u0432\u043d\u043e\u0432\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u2014 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e. \u041d\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u044f\u0447\u0435\u0439\u043a\u0435 \u0438 \u043d\u0430\u0436\u0430\u0442\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0435, \u0432 \u043d\u0435\u0433\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0438 \u0432 \u043d\u0451\u043c \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 TableViewController \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>class TableViewController: UITableViewController {     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {         setData(in: segue.destination, for: sender)     } }  \/\/ MARK: - Data setter extension TableViewController {          func setData(in controller: UIViewController, for sender: Any?) {         guard             let view = sender as? UIView,             let item = viewModel(for: view)         else { return }                  let navigationController = controller as? UINavigationController         navigationController?.topViewController?.title = item     } }  \/\/ MARK: - List extension TableViewController: List { }<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f prepareForSender \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e\u00a0<strong>setData(in controller: UIViewController, for sender: Any?)<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0435\u0449\u0451 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c. \u0410 \u043f\u043e\u043a\u0430 \u043e\u043f\u0438\u0448\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<ol>\n<li>\n<p>\u0423\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u0442\u043e\u0440 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 sender \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044c\u044e\u0448\u043a\u043e\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u0442 ViewModel, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e sender\u2019\u0443 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432\u044c\u044e\u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 TableViewController, \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 List.   <\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c.   <\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<blockquote>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>setData(in controller: UIViewController, for sender: Any?)<\/strong> \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u0442\u0430\u043a \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0439, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b List \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0435 \u0432\u043e \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438.<\/p>\n<\/blockquote>\n<p>\u0421\u0430\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b List \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u044c\u044e\u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>viewModel(for view: UIView) -> ViewModel?<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u044c\u044e\u043c\u043e\u0434\u0435\u043b\u044c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0432\u044c\u044e\u0445\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0432\u044c\u044e\u043c\u043e\u0434\u0435\u043b\u044c \u0438\u043b\u0438 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u044c\u044e\u043c\u043e\u0434\u0435\u043b\u0435\u0439.<\/p>\n<pre><code>protocol List {     associatedtype ViewModel     var viewModels: [ViewModel] { get }     func viewModel(for view: UIView) -> ViewModel? }  extension List where Self: UITableViewController {          \/\/\/ \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u044c\u044e\u043c\u043e\u0434\u0435\u043b\u044c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e sender'\u0443 \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u0438\u0448\u0451\u043b action.     \/\/\/ \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 Apple \u0441\u043f\u043e\u0441\u043e\u0431.     \/\/\/ - Parameter view: sender \u044d\u043a\u0448\u0435\u043d\u0430     \/\/\/ - Returns: \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0443\u044e\u0449\u0430\u044f sender'\u0443 \u0432\u044c\u044e\u043c\u043e\u0434\u0435\u043b\u044c \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 viewModels.     func viewModel(for view: UIView) -> ViewModel? {         let point = tableView.convert(view.center, from: view)         guard let indexPath = tableView.indexPathForRow(at: point) else { return nil }         return viewModels[indexPath.row]     }          }<\/code><\/pre>\n<blockquote>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0438\u043d\u0434\u0435\u043a\u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0432\u044c\u044e\u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u0438\u043c\u0435\u044f \u043b\u0438\u0448\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u2014 \u0438\u043d\u0438\u0446\u0438\u0430\u0442\u043e\u0440 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435 \u044f\u0447\u0435\u0439\u043a\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u0436\u0430\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u0430\u0448\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446, \u043d\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044f \u0435\u0433\u043e \u0438\u0437 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440. \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u044b\u043c Apple \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f indexPath \u044f\u0447\u0435\u0439\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0438\u043b\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438.<\/p>\n<\/blockquote>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 present<\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u0431\u0435\u0437 Segue, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>present(_, animated:, completion:)<\/strong>.<\/p>\n<p>\u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443, \u043a\u0430\u043a \u0432 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437: \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u043d\u0430 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u0443\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u0442\u0430\u0431\u0431\u0430\u0440\u0430 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0441 \u0442\u0435\u043c\u0438 \u0436\u0435 \u0442\u0440\u0435\u043c\u044f \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438.<\/p>\n<p>\u0410 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0435\u043c\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0437\u0430\u0434\u0430\u0434\u0438\u043c Storyboard ID = ModalNavigationController. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u043e \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0430 \u043f\u0440\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0443\u0436\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0439\u0441\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043e\u0442 \u043a\u043d\u043e\u043f\u043a\u0438 \u0432 \u044f\u0447\u0435\u0439\u043a\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 TableViewController: <\/p>\n<pre><code>\/\/ MARK: - Actions extension TableViewController {     @IBAction func openModal(sender: Any) {                  guard let navigationController = makeModalViewController() as? UINavigationController else { \/\/ factory             return         }         setData(in: navigationController, for: sender)                      present(navigationController, animated: true) \/\/ routing     }      }  \/\/ MARK: - Factory extension TableViewController {     func makeModalViewController() -> UIViewController {         let storyboard = UIStoryboard(name: \"Main\", bundle: nil)         let controller = storyboard.instantiateViewController(withIdentifier: \"ModalNavigationController\")         return controller     } }<\/code><\/pre>\n<p>\u0421\u0432\u044f\u0436\u0435\u043c \u0434\u0430\u043d\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u2014 \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u0430\u043a \u043c\u044b \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u0438.<\/p>\n<p>\u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u043a\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u043c \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>prepareForSender()<\/strong>. \u0420\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b:<\/p>\n<ol>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043a\u043e\u0434 \u0431\u0438\u043b\u0434\u0435\u0440\u0430, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0435\u0433\u043e \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u2014 \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0435\u0433\u043e \u0432 \u0441\u0442\u043e\u0440\u0438\u0431\u043e\u0440\u0434\u0435.   <\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043a\u043e\u0434 \u0440\u043e\u0443\u0442\u0435\u0440\u0430, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0442\u043e\u0440\u0438\u0431\u043e\u0440\u0434.   <\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p>\u0421\u0442\u043e\u0440\u0438\u0431\u043e\u0440\u0434 \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0440\u043e\u0443\u0442\u0438\u043d\u0433\u0430 \u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<\/blockquote>\n<h2>Menu \u0432 iOS<\/h2>\n<p>\u0421\u0442\u0430\u0442\u044c\u044e \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438 \u0441\u043e \u0441\u043b\u043e\u0432, \u0447\u0442\u043e Responder Chain \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u043c\u0435\u043d\u044e \u0432 macOS. \u041d\u043e \u0432\u0435\u0434\u044c \u0441\u0432\u043e\u0451 \u043c\u0435\u043d\u044e \u0435\u0441\u0442\u044c \u0438 \u0432 iOS: <a href=\"https:\/\/developer.apple.com\/documentation\/uikit\/uimenucontroller\">UIMenuController<\/a>. \u041f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u044b\u043c \u043c\u0435\u043d\u044e \u0432 iOS.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0440\u0430\u043d\u0435\u0435 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443 TableViewController \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0432 \u043d\u0451\u043c \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0434\u0435\u043b\u0435\u0433\u0430\u0442. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434, \u043c\u044b \u0435\u0449\u0451 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e <a href=\"https:\/\/habr.com\/ru\/company\/psb\/blog\/588332\/\">\u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439<\/a>. \u0410 \u043f\u043e\u043a\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"swift\">    \/\/ MARK: - Table view delegate          override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {         guard let cell = tableView.cellForRow(at: indexPath) else { return }                  let selector = #selector(UIViewController.showMenu(sender:))         let target = cell.target(forAction: selector, withSender: cell) as? UIResponder         target?.perform(selector, with: cell)     }<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<ol start=\"1\">\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u044f\u0447\u0435\u0439\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0449\u0435\u0442 \u0442\u0430\u0440\u0433\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440 <strong>UIViewController.showMenu(sender:)<\/strong>, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043c\u0435\u043d\u044e \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u043e\u0432.      <\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u043e\u0442 \u0442\u0430\u0440\u0433\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440 \u0441 \u044f\u0447\u0435\u0439\u043a\u043e\u0439, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u043c\u0435\u043d\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b 3 \u0432\u0435\u0449\u0438:<\/p>\n<ol start=\"1\">\n<li>\n<p>\u041e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043c\u0435\u043d\u044e \u0438 \u0441\u0442\u0430\u043d\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u043e\u043c (first responder\u2019\u043e\u043c), \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u043c UIResponder (\u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044c\u044e\u0448\u043a\u0430).<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e canBecomeFirstResponder, \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u0443 \u043d\u0435\u0433\u043e \u0435\u0449\u0451 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool<\/strong>. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043b\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u0435\u043d\u044e. \u0422.\u00a0\u0435. \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e      \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <strong>@IBAction  open override func copy(_ sender: Any?)<\/strong>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440 \u043f\u043e\u043a\u0430\u0437\u0430 \u043c\u0435\u043d\u044e:<\/p>\n<pre><code>class TableViewController: UITableViewController {     \/\/ MARK: - Menu implementation     override var canBecomeFirstResponder: Bool {         return true     } }<\/code><\/pre>\n<pre><code>extension UIViewController {     @IBAction func showMenu(sender: Any?) {         guard             let sender = sender as? UIView,             becomeFirstResponder()         else { return }                  let menu = UIMenuController.shared         let rect = view.convert(sender.bounds, from: sender)         menu.showMenu(from: view, rect: rect)     }          @IBAction open override func copy(_ sender: Any?) {         let description = sender ?? \"nil\"         print(\"copy from \\(description)\")     } }<\/code><\/pre>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u043b\u0438\u0448\u044c \u043a\u0430\u043a \u043f\u0435\u0447\u0430\u0442\u044c \u043b\u043e\u0433\u043e\u0432 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u2014 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0442\u0438\u043f\u0430 \u00abcopy from Optional(&lt;UIMenuController: 0x6000037d4640>)\u00bb.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 Interface Builder \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0430\u0431\u0431\u0430\u0440\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u043a\u043d\u043e\u043f\u043a\u0443 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u00ab\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c Menu\u00bb. \u041f\u0440\u0438\u0432\u044f\u0436\u0435\u043c \u0435\u0451 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043a \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0443 <strong>showMenu(sender:)<\/strong>.<\/p>\n<p>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e 3 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u043c\u0435\u043d\u044e. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e canBecomeFirstResponder \u0443\u0436\u0435 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430:<\/p>\n<pre><code>class ViewController1: UIViewController {     \/\/ MARK: - Menu implementation     override var canBecomeFirstResponder: Bool {         return true     } }<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c: \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u043d\u044e, \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043f\u0443\u043d\u043a\u0442\u0430 copy \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u043d\u0430\u0434\u043f\u0438\u0441\u044c.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043c\u0435\u043d\u044e \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430.<\/p>\n<blockquote>\n<p>\u041e\u0431\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u044b:<\/p>\n<p>1. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u0430.<\/p>\n<p>2. \u041f\u043e\u0438\u0441\u043a\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u043e\u0432, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u043d\u0430\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435.<\/p>\n<p>3. \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430.<\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u0438\u0445 \u0442\u0440\u0451\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438\u0437 \u043a\u043e\u0434\u0430 \u043b\u044e\u0431\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432 \u0434\u0435\u0440\u0435\u0432\u0435 \u043d\u0430\u0448\u0438\u0445 UI-\u043a\u043b\u0430\u0441\u0441\u043e\u0432: \u0432\u044c\u044e\u0445, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432, \u043e\u043a\u043e\u043d (UIWindow), \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (UIApplication). \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u043e\u0447\u0435\u0440\u0451\u0434\u043d\u043e.<\/p>\n<\/blockquote>\n<blockquote>\n<p>\u041e\u0431\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u044d\u043a\u0448\u0435\u043d\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e, \u0442.\u00a0\u043a. \u043e\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043e\u0431\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0441\u0442 UI \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0442\u043e\u0438\u0442 \u0438\u043c\u0435\u0442\u044c \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u0443 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 <strong>copy(:)<\/strong> \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u0432\u0430\u0448\u0435\u0433\u043e UI. <\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u0443 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <strong>pushDetail(:)<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0443\u0448\u0438\u0442\u044c \u0432 \u0441\u0442\u0435\u043a \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440. \u0418 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u044f\u0447\u0435\u0439\u043a\u0438. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435\u0432\u0430\u0436\u043d\u043e, \u0438\u0437 \u043a\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u044f\u0447\u0435\u0439\u043a\u0438 \u044d\u0442\u0430 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430 \u0432\u044b\u0437\u0432\u0430\u043b\u0430\u0441\u044c. \u0414\u0430\u043d\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u044b \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430 \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438 \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0451 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<\/blockquote>\n<h2>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 Responder Chain<\/h2>\n<ol start=\"1\">\n<li>\n<p>\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441 \u043b\u044e\u0431\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0438 \u0442\u0438\u043f\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u044d\u043a\u0448\u0435\u043d\u043e\u0432, \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043f\u043e Responder Chain, \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0441\u0442\u0440\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0432\u0438\u0434. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 \u043c\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e Apple \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u0451 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 API, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0435 \u043d\u0430\u0439\u0442\u0438 \u043f\u043e \u0432\u044c\u044e\u0448\u043a\u0435, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0439 \u0432 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 \u043c\u0435\u0442\u043e\u0434\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<\/li>\n<li>\n<p>Responder Chain \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c\u0438 UIResponder. \u041d\u043e \u044d\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043b\u044e\u0441\u043e\u043c, \u043d\u0435\u0436\u0435\u043b\u0438 \u043c\u0438\u043d\u0443\u0441\u043e\u043c, \u0442.\u00a0\u043a. \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0435\u043c \u0432\u044c\u044e \u0438 \u043d\u0435 \u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0438\u0436\u0435. \u0415\u0441\u043b\u0438 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u044b \u0433\u0434\u0435-\u0442\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u0435 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435. \u0421\u0442\u043e\u0438\u0442 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e, \u0438 \u0442\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Responder Chain.<\/p>\n<\/li>\n<li>\n<p>Responder Chain \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u0435\u044f\u0432\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u044c. \u041c\u044b \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0430\u0440\u0433\u0435\u0442, \u0430 \u043b\u0438\u0448\u044c \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440 \u0432 \u043d\u0435\u043a\u0443\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u043e\u0432. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0430\u043c \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0438 \u043c\u043e\u0433\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u0445\u043e\u0434\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c. \u0421\u0430\u043c\u043e\u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u043a\u043e\u0434 \u2014 \u0432 \u0438\u0434\u0435\u0430\u043b\u0435 \u044d\u0442\u043e \u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u043d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0434\u043a\u043e \u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u043e. \u0415\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0438\u043d\u0443\u0441. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 E2E-\u0442\u0435\u0441\u0442\u044b, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0438\u0435      \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u0430 \u0432\u044c\u044e\u0448\u0435\u043a, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0438 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u043e\u0432, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u044d\u0442\u043e\u043c\u0443 \u0434\u0435\u0440\u0435\u0432\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u043c\u0435\u044e\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u0432\u0438\u0434\u043d\u044b \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0438\u0437 \u043b\u044e\u0431\u043e\u0439 \u0435\u0433\u043e \u0442\u043e\u0447\u043a\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0431\u0435\u0437\u0434\u0443\u043c\u043d\u043e, \u0442\u043e \u0441\u043a\u043e\u0440\u043e \u0438\u0445 \u0441\u0442\u0430\u043d\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0438 \u0432 \u043d\u0438\u0445 \u0432\u0441\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0443\u0442\u0430\u0442\u044c\u0441\u044f.   <\/p>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043e\u0441\u0442\u0440\u0430 \u0432 Interface Builder, \u0433\u0434\u0435 \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u044e\u0449\u0435\u043c\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u0435. \u041d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043b\u0435\u0433\u043a\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0432\u044b\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u044f\u0441\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f. \u041a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0447\u0451\u0442\u043a\u0438\u043c \u0438 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u043c, \u0430 \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u2014 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c, \u043a\u0430\u043a \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043c\u0435\u043d\u044e. \u0412\u0435\u0434\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u044d\u0442\u043e\u0442 \u0432\u044b\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u0435\u043d\u044e \u0432 macOS. \u0423 \u0432\u0430\u0441 \u0436\u0435 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b Print \u0441 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u043a\u043e\u043d \u0434\u0435\u0441\u043a\u0442\u043e\u043f-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f? \u041f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u0436\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 iOS. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0437\u0430\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u0438\u043f\u0430 <strong>pushUserDetail<\/strong> \u0438\u043b\u0438 <strong>pushAccountDetail<\/strong>. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0432 \u043e\u0431\u043e\u0438\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u0434\u043d\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 <strong>pushDetail<\/strong>. \u041e\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043e\u043a\u043d\u043e \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0435\u043c\u0443 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0412\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0439 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 generic-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430\u043c\u0438. <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u0437\u0430 \u0441\u0447\u0451\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435.<\/p>\n<\/li>\n<\/ol>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0441\u0430\u043c\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f Responder Chain \u0432 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 iOS-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445:<\/p>\n<ol start=\"1\">\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f) \u043e\u0442 \u0432\u044c\u044e\u0448\u0435\u043a \u0434\u043e \u0440\u0443\u0442\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0431\u0435\u0437 \u0435\u0434\u0438\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043b\u044e\u0431\u044b\u043c \u0438\u0437 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438\u043b\u0438 \u0432\u044c\u044e\u0448\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0438\u0441\u043a \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 (\u043c\u0430\u0441\u0441\u0438\u0432\u0435) \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0432\u044c\u044e\u0448\u043a\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.<\/p>\n<\/li>\n<li>\n<p> \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Responder Chain \u043a\u0430\u043a \u0438\u0437 Interface Builder, \u0442\u0430\u043a \u0438 \u0438\u0437 \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0445 \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, Responder \u0421hain \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 <a href=\"https:\/\/refactoring.guru\/ru\/design-patterns\/observer\">\u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u00ab\u041d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u0435\u043b\u044c\u00bb<\/a>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u0430\u043c \u0432\u0441\u044f\u043a\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0443\u044e \u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043b\u044e\u0431\u043e\u043c\u0443 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044e.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043e\u043d \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0438 \u043c\u043d\u043e\u0433\u0438\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e \u2014 \u0437\u0430\u0434\u0430\u0447, \u0433\u0434\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0432\u044c\u044e\u0448\u0435\u043a \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043a \u0432\u044c\u044e\u0448\u043a\u0430\u043c \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. \u0412 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 UIApplication \u0438\u043b\u0438 UIApplicationDelegate. \u0415\u0441\u043b\u0438 \u0432\u044b \u0432 \u0441\u0432\u043e\u0451\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 2 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430, \u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, Responder Chain \u0432\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0438\u043c\u0438 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435.<\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0430\u0445 (\u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b) \u0432\u0435\u0434\u0443\u0442 \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043d\u0435\u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c\u0443 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044e \u0441\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u0438 \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044e \u0437\u0430\u0446\u0435\u043f\u043b\u0435\u043d\u0438\u044f. \u0414\u0430, \u0434\u0430, <a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/505852\/\">\u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430 code review \u043e\u0442\u0440\u044b\u0432\u0430\u044e\u0442 \u0440\u0443\u043a\u0438, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438 \u0433\u043e\u043b\u043e\u0432\u044b<\/a>. Responder Chain \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0433\u0440\u0430\u0444 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043e\u0432 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c, \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u043a\u0440\u043e\u0441\u0441-\u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0439 \u0438 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0432\u044f\u0437\u0435\u0439.<\/p>\n<p>\u041c\u044b \u043d\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b\u0438, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u043b\u0438 \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c Responder Chain. \u0415\u0441\u043b\u0438 \u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u043a \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435, \u0442\u043e \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u0441\u0442\u0430\u0442\u044c\u044e.<\/p>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0437\u044b\u0432\u0430\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u0430 \u043d\u0435 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0438\u0441\u043a\u0430\u0442\u044c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u0434 \u0432\u0441\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0436\u0438\u0437\u043d\u0438. <\/p>\n<\/div>\n<\/div>\n<p> <!----> <\/p>\n<div class=\"tm-article-poll\">\n<div class=\"tm-notice tm-article-poll__notice tm-notice_positive\"><!----> <\/p>\n<div class=\"tm-notice__inner\"><!----> <\/p>\n<div class=\"tm-notice__content\"><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/company\/psb\/blog\/597759\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__header\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043b\u0438 \u0432\u044b Responder Chain?<\/div>\n<div class=\"tm-article-poll__answers\">\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">             53.33%           <\/span> <span class=\"tm-article-poll__answer-label\">\u041d\u0435\u0442 \u0438 \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e<\/span> <span class=\"tm-article-poll__answer-votes\">             8           <\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width:53.33%;\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">             20%           <\/span> <span class=\"tm-article-poll__answer-label\">\u041d\u0435\u0442, \u043d\u043e \u0441\u0442\u0430\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c<\/span> <span class=\"tm-article-poll__answer-votes\">             3           <\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width:20%;\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">             26.67%           <\/span> <span class=\"tm-article-poll__answer-label\">\u0414\u0430, \u043b\u044e\u0431\u043b\u044e \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442<\/span> <span class=\"tm-article-poll__answer-votes\">             4           <\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width:26.67%;\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__stats\">        \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 15 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.          \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0438\u0441\u044c 2 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.      <\/div>\n<\/div>\n<p> \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\/company\/psb\/blog\/597759\/\"> https:\/\/habr.com\/ru\/company\/psb\/blog\/597759\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\" class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0434 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0442 <a href=\"https:\/\/www.youtube.com\/watch?v=z3u1qDao_d8&amp;t=909s\">\u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u0415\u0432\u0433\u0435\u043d\u0438\u044f \u0420\u0442\u0438\u0449\u0435\u0432\u0430<\/a> (@katleta) \u043d\u0430 \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0438 Mobius. \u0422\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0432 \u0435\u0433\u043e \u0434\u043e\u043a\u043b\u0430\u0434\u0435, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u0434\u0437\u0430\u0431\u044b\u0442\u044b\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 iOS, \u0431\u0435\u0437 \u0442\u0440\u0443\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438 \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>\u042f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0439 \u2014 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c Responder Chain.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/github.com\/ws233\/ResponderChain\">\u0442\u0443\u0442<\/a>.<\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Responder Chain<\/h2>\n<p>\u041d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a \u0442\u0435\u0440\u043c\u0438\u043d \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043a\u0430\u043a \u00ab\u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u043e\u0432\u00bb. <\/p>\n<p>\u0421\u0430\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0432 1988 \u0433\u043e\u0434\u0443 \u0438 \u0441\u0442\u0430\u043b \u0432\u044b\u0434\u0430\u044e\u0449\u0438\u043c\u0441\u044f \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043e\u0434\u043d\u043e\u0439 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0432 macOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 c \u0435\u0433\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u043c\u0435\u043d\u044e \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u0437 \u043b\u044e\u0431\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e\u0442 \u0436\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0431\u044b\u043b \u043f\u0440\u0438\u043d\u0435\u0441\u0451\u043d \u043d\u0430 iOS \u0438 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0448\u0451\u043b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0438 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0435\u043c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0439 (UITabBarController, UINavigationController, UISplitController, \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0438\u043f\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438).<\/p>\n<p>\u041f\u0440\u043e \u0441\u0430\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/developer.apple.com\/documentation\/uikit\/touches_presses_and_gestures\/using_responders_and_the_responder_chain_to_handle_events\">\u043f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0435<\/a>. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043d\u0430\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043f\u043e \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u043e\u0432 Responder Chain \u0443 Apple \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u0430\u0431\u0437\u0430\u0446, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u043d\u0430 \u0444\u043e\u043d\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430:<\/p>\n<blockquote>\n<p><em>Controls communicate directly with their associated target object using action messages. When the user interacts with a control, the control sends an action message to its target object. Action messages are not events, but they may still take advantage of the responder chain. When the target object of a control is nil, UIKit starts from the target object and traverses the responder chain until it finds an object that implements the appropriate action method. For example, the UIKit editing menu uses this behavior to search for responder objects that implement methods with names like cut(_:), copy(_:), or paste(_:). <\/em><\/p>\n<\/blockquote>\n<details class=\"spoiler\">\n<summary>\u041f\u0435\u0440\u0435\u0432\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441 \u0446\u0435\u043b\u0435\u0432\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0442\u043e\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438, \u043d\u043e \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u043e\u0432. \u041a\u043e\u0433\u0434\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0430\u0432\u0435\u043d nil, \u0442\u043e UIKit, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u043e\u0432, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0451\u0442 \u043e\u0431\u044a\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0435\u043d\u044e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f UIKit \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438, \u043a\u0430\u043a <\/em><strong><em>cut(_ \ud83d\ude42<\/em><\/strong><em>, <\/em><strong><em>copy(_ \ud83d\ude42<\/em><\/strong><em> \u0438\u043b\u0438 <\/em><strong><em>paste(_ \ud83d\ude42<\/em><\/strong><em>.<\/em><\/p>\n<\/div>\n<\/details>\n<p>\u0412\u0438\u0434\u0438\u043c\u043e, \u044d\u0442\u0438\u043c \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0442\u0430\u043a\u0430\u044f \u043c\u0430\u043b\u0430\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 iOS-\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b\u0430 <a href=\"https:\/\/habr.com\/ru\/post\/464463\/\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a>, \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u043f\u0440\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432. \u041c\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u0439.<\/p>\n<p>\u041c\u044b \u0436\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u044e \u043c\u043e\u0449\u044c, \u0441\u0438\u043b\u0443, \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0438 \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<h2>\u041e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 URL-\u0441\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>\u041a\u0430\u0436\u0434\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u044d\u043a\u0440\u0430\u043d \u0441 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u041e\u0431\u044b\u0447\u043d\u043e \u043d\u0430 \u0442\u0430\u043a\u043e\u043c \u044d\u043a\u0440\u0430\u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u043f\u0440\u0430\u0432\u043e\u0432\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439. \u0418\u043d\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u044d\u043a\u0440\u0430\u043d\u0430\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 splash-\u0441\u043a\u0440\u0438\u043d\u0435 \u0438 \u044d\u043a\u0440\u0430\u043d\u0435 \u00ab\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435\u00bb. \u041a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438? \u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0435\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c. <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, 2 \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043e\u0431\u0449\u0430\u044e\u0442\u0441\u044f \u0441 \u043d\u0435\u043a\u0438\u043c \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u043c, \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u043c \u0432 \u0441\u0435\u0431\u0435 \u0432\u0435\u0441\u044c \u043a\u043e\u0434, \u043f\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044e \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e URL. \u0414\u0430\u043d\u043d\u044b\u0439 \u0440\u043e\u0443\u0442\u0435\u0440 \u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u0441 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f UIApplication, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <strong>open(_:options:completionHandler:)<\/strong>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438. \u0415\u0441\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0430\u043d\u0430\u0442\u043e\u043c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 VIPER, \u0447\u0430\u0441\u0442\u043e <a href=\"https:\/\/habr.com\/ru\/post\/358412\/#chapter0\">\u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043d\u0430 \u0425\u0430\u0431\u0440\u0435<\/a>, \u0442\u043e \u043e\u043d \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0435\u0449\u0451 \u043f\u043e 2 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0430 \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0438 \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u043c. \u0410 \u0435\u0441\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u2014 \u0441\u0435\u043d\u044c\u043e\u0440, \u0442\u043e \u043e\u043d \u0432\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f DI-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0441\u0435\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0441\u0445\u0435\u043c\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0451 \u0441\u0430\u043c.<\/p>\n<p>\u00ab\u0427\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0441 \u044d\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439?\u00bb \u2014 \u0441\u043f\u0440\u043e\u0441\u0438\u0442 \u043c\u0435\u043d\u044f \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c. <\/p>\n<p>\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Responder Chain.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443:<\/p>\n<ol start=\"1\">\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u043c\u0435\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u043f\u0443\u0441\u0442\u043e\u0433\u043e  \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u2014 UITabBarController.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043e\u0431\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u043f\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0435, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0438\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0435\u0438\u043d\u0442\u044b \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u00ab\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0425\u0430\u0431\u0440!\u00bb.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 UIApplication:<\/p>\n<pre><code>import UIKit  \/\/ MARK: - Actions extension UIApplication {     @IBAction func openHabr() {         guard let url = URL(string: \"https:\/\/habr.com\/ru\/feed\/\") else { return }         open(url, options: [:])     } }<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 Interface Builder \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 <strong>Touch Up Inside<\/strong> \u043e\u0431\u0435\u0438\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e (action) openHabr \u0447\u0435\u0440\u0435\u0437 \u0438\u043a\u043e\u043d\u043a\u0443 First Responder.   <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043a\u043b\u0438\u043a\u0430\u0435\u043c \u043f\u043e \u043e\u0431\u0435\u0438\u043c \u043a\u043d\u043e\u043f\u043a\u0430\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>\u0414\u0430-\u0434\u0430! \u0412\u0441\u0451 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e!<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f, \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u043a\u0440\u0430\u0448\u0430 \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 (\u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430 \u0443 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0430\u0440\u0433\u0435\u0442\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c Responder Chain \u043a\u0440\u0430\u0448\u0430 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442).<\/p>\n<blockquote>\n<p>\u041e\u0431\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e:<\/p>\n<p>1. \u041a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0432 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0435, \u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0451\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0430. \u042d\u0442\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443, \u0447\u0442\u043e UIApplication \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u043c UIResponder \u0438 \u0432\u043a\u043b\u044e\u0447\u0451\u043d \u0432 Responder Chain.<\/p>\n<p>2. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u0432 \u0442\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b. \u041b\u0443\u0447\u0448\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u0445 \u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0447\u0435\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u0430\u043c \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0410 \u0432\u044b\u0437\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 Responder Chain. \u0422\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0437\u0430\u0432\u043e\u0434\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u0441\u0432\u044f\u0437\u0438, \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u043e \u0438\u0445 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u0446\u0438\u043a\u043b\u043e\u0432 \u0441\u0438\u043b\u044c\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a. \u0412 \u043e\u0431\u0449\u0435\u043c,      \u0441\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u044c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 <a href=\"https:\/\/habr.com\/ru\/post\/589489\/\">\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f<\/a>.<\/p>\n<p>3. \u041e\u0442 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0439 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0449\u0438\u0449\u0430\u0442\u044c\u0441\u044f \u0442\u0435\u0441\u0442\u0430\u043c\u0438 (\u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438, end-to-end).<\/p>\n<\/blockquote>\n<h2>\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u043a\u043b\u0430\u0434\u043e\u043a<\/h2>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u0441\u0451 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043d\u0430 UITabBarController:<\/p>\n<pre><code>import UIKit  extension UITabBarController {     @IBAction func openItem1() {         selectedIndex = 0     }          @IBAction func openItem2() {         selectedIndex = 1     } }<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u043a\u043d\u043e\u043f\u043a\u0443 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u00ab\u041e\u0442\u043a\u0440\u044b\u0442\u044c Item2\u00bb, \u0430 \u043d\u0430 \u0432\u0442\u043e\u0440\u0443\u044e \u2014 \u00ab\u041e\u0442\u043a\u0440\u044b\u0442\u044c Item1\u00bb. \u041a\u043d\u043e\u043f\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0442\u0430\u0431\u0431\u0430\u0440-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443. \u0420\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u043c \u0438\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0435\u0438\u043d\u0442\u044b. \u041f\u0440\u0438\u0432\u044f\u0436\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 Touch Up Inside \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u0438\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u0431\u0430\u0440-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u041d\u043e \u043d\u0430 \u0441\u0435\u0439 \u0440\u0430\u0437 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p>\u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u043d\u0430\u0441 Xcode\u2019\u043e\u043c ViewController \u0438 \u043f\u0440\u043e\u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u043a\u043e\u043f\u0438\u044e \u0446\u0438\u0444\u0440\u0430\u043c\u0438 1 \u0438 2, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c. \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0430\u0443\u0442\u043b\u0435\u0442 (outlet) \u0434\u043b\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043a\u043d\u043e\u043f\u043a\u0438, \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u0441 \u044d\u0442\u0438\u043c \u0430\u0443\u0442\u043b\u0435\u0442\u043e\u043c. \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0432 \u0441\u0442\u043e\u0440\u0438\u0431\u043e\u0440\u0434\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0418 \u0434\u0430\u043b\u044c\u0448\u0435 \u0432\u043e `viewDidLoad()` \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code>class ViewController1: UIViewController {      @IBOutlet public weak var buttonOpenItem2: UIButton!          override func viewDidLoad() {         super.viewDidLoad()         \/\/ Do any additional setup after loading the view.         buttonOpenItem2.addTarget(nil, action: #selector(UITabBarController.openItem2), for: .touchUpInside)     }  }<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c: \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0438 \u00ab\u041e\u0442\u043a\u0440\u044b\u0442\u044c ItemX\u00bb \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443.<\/p>\n<blockquote>\n<p>\u041e\u0431\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 (\u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430) \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043c\u043d\u043e\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432 Interface Builder.<\/p>\n<\/blockquote>\n<h2>Responder Chain \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438<\/h2>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Segue-\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432<\/h4>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u044f\u0447\u0435\u0439\u043a\u0443 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438\u0437 <a href=\"https:\/\/habr.com\/ru\/company\/psb\/blog\/588332\/\">\u0446\u0438\u043a\u043b\u0430<\/a>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043a \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u0430\u044f \u0432 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c\u043e\u043c \u043e\u043a\u043d\u0435, \u0434\u043e\u043b\u0436\u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u043d\u043e\u043f\u043a\u0430 \u043a\u0430\u043a\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u043d\u0430\u0436\u0430\u0442\u0430.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0421\u043d\u043e\u0432\u0430 \u043d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438:<\/p>\n<ol start=\"1\">\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0442\u0440\u0435\u0442\u044c\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u0442\u0430\u0431\u0431\u0430\u0440\u0430 UINavigationController \u0441 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c      UITableViewController. \u041d\u0430\u0437\u043e\u0432\u0451\u043c \u044d\u0442\u0443 \u0432\u043a\u043b\u0430\u0434\u043a\u0443 Item3.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u043e\u0435 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u0442\u0440\u0435\u043c\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438: \u00ab\u042f\u0447\u0435\u0439\u043a\u04301\u00bb, \u00ab\u042f\u0447\u0435\u0439\u043a\u04302\u00bb, \u00ab\u042f\u0447\u0435\u0439\u043a\u04303\u00bb. \u0412 \u043a\u0430\u0436\u0434\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043a\u043d\u043e\u043f\u043a\u0430 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u00abOpen Modal\u00bb. \u041f\u0440\u043e\u0441\u044c\u0431\u0430 \u043d\u0435 \u043f\u0440\u0435\u0434\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u0432\u044b\u0448\u0435\u043d\u043d\u044b\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 \u043d\u0430\u0448\u0435\u043c <a href=\"https:\/\/habr.com\/ru\/company\/psb\/blog\/588332\/\">\u0446\u0438\u043a\u043b\u0435 \u0441\u0442\u0430\u0442\u0435\u0439<\/a>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0441\u0442\u043e\u0440\u0438\u0431\u043e\u0440\u0434\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 UIViewController \u0438 \u0441 \u043a\u043d\u043e\u043f\u043a\u0438 Open Modal \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 (segue) \u043d\u0430 \u0432\u043d\u043e\u0432\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u2014 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e. \u041d\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u044f\u0447\u0435\u0439\u043a\u0435 \u0438 \u043d\u0430\u0436\u0430\u0442\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0435, \u0432 \u043d\u0435\u0433\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0438 \u0432 \u043d\u0451\u043c \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 TableViewController \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>class TableViewController: UITableViewController {     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {         setData(in: segue.destination, for: sender)     } }  \/\/ MARK: - Data setter extension TableViewController {          func setData(in controller: UIViewController, for sender: Any?) {         guard             let view = sender as? UIView,             let item = viewModel(for: view)         else { return }                  let navigationController = controller as? UINavigationController         navigationController?.topViewController?.title = item     } }  \/\/ MARK: - List extension TableViewController: List { }<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f prepareForSender \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e\u00a0<strong>setData(in controller: UIViewController, for sender: Any?)<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b<\/p>\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-327426","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/327426","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=327426"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/327426\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=327426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=327426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=327426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}