{"id":328956,"date":"2022-02-02T15:00:49","date_gmt":"2022-02-02T15:00:49","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=328956"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=328956","title":{"rendered":"<span>Swift TableManager<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u043e, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 UITableView \u043d\u0430 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438. <\/p>\n<p>\u041a \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0434\u0445\u043e\u0434\u0443 \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438. <\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435, \u0447\u0435\u043c \u043d\u0430\u0447\u0430\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 \u0432\u0441\u0435 \u043a\u0435\u0439\u0441\u044b \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0438 \u0432 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0430\u0436\u0435 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438. <\/p>\n<h3>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0431\u044b\u0447\u043d\u043e?<\/h3>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0437\u043d\u0430\u044e\u0442 \u0435\u0449\u0435 \u0441 \u043f\u0435\u0440\u0432\u044b\u0445 \u0443\u0440\u043e\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434 iOS \u0442\u0430\u043a\u043e\u0439 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043a\u0430\u043a UITableView. <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"swift\">class SomeScreen: UIViewController {    @IBOutlet weak var tableView: UITableView!      private var someDataToDisplay: [SomeModel] = []    override func viewDidLoad() {  super.viewDidLoad()   self.tableView.delegate = self     self.tableView.dataSource = self   }    }  extension SomeScreen: UITableViewDelegate, UITableViewDataSource {      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {     return someDataToDisplay.count   }      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {     guard let cell = tableView.dequeueReusableCell(withIdentifier: \"myCell\",                                                         for: indexPath) as? MyCellClass else {           return }     cell.name = someDataToDisplay[indexPath.row]    cell.someData = someDataToDisplay[indexPath.row]     return cell   }    }<\/code><\/pre>\n<p>\u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0441 \u0442\u0430\u043a\u0438\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c,  \u043a\u043e\u0442\u043e\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0445 \u0436\u0435 \u0443\u0440\u043e\u043a\u0430\u0445 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e iOS \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c UIKit \u0437\u043d\u0430\u043a\u043e\u043c\u044b, \u0432 \u0442\u043e\u043c \u0438\u043b\u0438 \u0438\u043d\u043e\u043c \u0432\u0438\u0434\u0435, \u0431\u0435\u0437 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0432\u0441\u0435.  \u0418 \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0434\u0430\u0436\u0435\u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u0442\u0430\u043a\u0438\u0445 \u0441\u0443\u043f\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043a\u0435\u0439\u0441\u0430\u0445. <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044f\u0447\u0435\u0435\u043a, \u043c\u0435\u0442\u043e\u0434 <\/p>\n<p><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableView<\/code><\/p>\n<p>\u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"swift\">  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {     {       switch indexPath.row {       case 0:          guard let cell = tableView.dequeueReusableCell(withIdentifier: \"myCell\",                                                         for: indexPath) as? MyCellClass else {           return }    cell.name = someDataToDisplay[indexPath.row]    cell.someData = someDataToDisplay[indexPath.row]     return cell       case 1: ........          \/\/ \u0434\u0430\u043b\u0435\u0435 \u0438\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0432\u0438\u0434\u043e\u0432 \u044f\u0447\u0435\u0435\u043a        }            } <\/code><\/pre>\n<h3>\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439: <\/h3>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u044d\u043a\u0440\u0430\u043d \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 API \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0438\u0441\u043a \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044f\u0447\u0435\u0439\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u044f\u0447\u0435\u0439\u043a\u0438 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u043d\u044c\u0448\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u043b\u0438\u0441\u044c \u0441 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c \u043f\u043e \u043a\u043b\u0438\u043a\u0443 \u043d\u0430 \u0442\u043e\u0432\u0430\u0440;<\/p>\n<\/li>\n<li>\n<p>\u044f\u0447\u0435\u0439\u043a\u0430 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u043e\u0432\u0430\u0440\u0430, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0441 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c \u043f\u043e \u043a\u043b\u0438\u043a\u0443 \u043d\u0430 \u0442\u043e\u0432\u0430\u0440;<\/p>\n<\/li>\n<li>\n<p>\u044f\u0447\u0435\u0439\u043a\u0430 \u0434\u043b\u044f \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043a \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0442\u043e\u0432\u0430\u0440\u043e\u0432;<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u044f\u0447\u0435\u0435\u043a \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043d\u044b\u0435. \u0412 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c VIPER, \u043d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0441\u0435\u0439\u0447\u0430\u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e TableManager, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043d\u0435\u0433\u043e \u043c\u044b \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 &#8212; \u044d\u0442\u043e \u0440\u043e\u043b\u0438 \u043d\u0435 \u0441\u044b\u0433\u0440\u0430\u0435\u0442. <\/p>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0440\u043e\u043b\u0438.<\/p>\n<p>Configurator &#8212; \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u0435\u0431\u0435 \u0438\u043d\u043a\u0430\u043f\u0443\u0441\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<p>TableManager &#8212; \u043a\u043b\u0430\u0441\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u043e\u0442 \u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u043a \u0431\u043e\u043b\u044c\u0448\u0435\u043c\u0443 \u0438 \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u044b, \u043a\u0430\u043a\u0443\u044e \u0440\u043e\u043b\u044c \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0433\u0440\u0430\u0442\u044c \u0438 \u0437\u0430\u0447\u0435\u043c \u043e\u043d\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0430\u043c \u0442\u0443\u0442 \u043d\u0443\u0436\u043d\u044b.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 &#8212; \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u044b.<\/p>\n<pre><code class=\"swift\">enum CatalogCellType {   \/\/ \u044f\u0447\u0435\u0439\u043a\u0430 \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0438\u0437 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u0438\u0441\u043a\u0430   case historyCell   \/\/ \u044f\u0447\u0435\u0439\u043a\u0430 \u0441 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u043c, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435   case productCell   \/\/ \u044f\u0447\u0435\u0439\u043a\u0430 \u0441 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0435\u0439   case categoryCell }  protocol Configurator {   \/\/ \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u044f\u0447\u0435\u0439\u043a\u0438 \u0441 reuse id  var reuseId: String { get }   \/\/ \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u044f\u0447\u0435\u0439\u043a\u0443   var cellType: CatalogCellType { get }   \/\/ \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u044f\u0447\u0435\u0439\u043a\u0438 func setupCell(_ cell: UIView) }<\/code><\/pre>\n<p> \u0422\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0432\u0432\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 &#8212; \u0438\u043c\u0435\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 <\/p>\n<pre><code class=\"swift\">struct SearchResponseModel: Codable {   \/\/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0438 \u043f\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c   let searchProductsResponse: [SearchProductModel]   \/\/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0438 \u043f\u043e \u0441\u0435\u043a\u0446\u0438\u044f\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430   let searchSectionResponse: [CatalogSectionModel] }  struct CatalogSectionModel: Codable {     let sectionId: String     let sectionName: String     let sectionIconURL: String? }  struct SearchProductModel: Codable {     let productId: String     let productName: String     let productIconURL: String? }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u044f\u0447\u0435\u0435\u043a: <\/p>\n<pre><code class=\"swift\">\/\/ \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u044f\u0447\u0435\u0435\u043a \u0441 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0435\u0439 \u043f\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c final class SearchProductConfigurator: Configurator {      \/\/ reuse id \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044f\u0447\u0435\u0439\u043a\u0435 var reuseId: String { String(describing: SearchProductCell.self) }   \/\/ \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f var cellType: CatalogCellType { .productCell }   \/\/ \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u044f\u0447\u0435\u0439\u043a\u0435   var model: SearchProductModel?      \/\/ \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f\u0447\u0435\u0439\u043a\u0438   func setupCell(_ cell: UIView) {     guard let cell = cell as? SearchProductCellProtocol,      let productModel = model else { return }     \/\/ \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438, \u0447\u0442\u043e \u0432 \u044f\u0447\u0435\u0439\u043a\u0435     \/\/ \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u043e\u0442\u043e\u0431\u043e\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043d\u0435\u0439.     cell.displayData(productModel: productModel)   }  }  \/\/ \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u044f\u0447\u0435\u0435\u043a \u0441 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0435\u0439 \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 final class SearchSectionConfigurator: Configurator {      \/\/ reuse id \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044f\u0447\u0435\u0439\u043a\u0435 var reuseId: String { String(describing: SearchSectionCell.self) }   \/\/ \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f var cellType: CatalogCellType { .categoryCell }   \/\/ \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u044f\u0447\u0435\u0439\u043a\u0435   var model: CatalogSectionModel?      \/\/ \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f\u0447\u0435\u0439\u043a\u0438   func setupCell(_ cell: UIView) {     guard let cell = cell as? SearchSectionCellCellProtocol,      let sectionModel = model else { return }     \/\/ \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438, \u0447\u0442\u043e \u0432 \u044f\u0447\u0435\u0439\u043a\u0435     \/\/ \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u043e\u0442\u043e\u0431\u043e\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043d\u0435\u0439.     cell.displayData(sectionModel: sectionModel)   }  }  \/\/ \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u044f\u0447\u0435\u0435\u043a \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0435\u0439  final class SearchPreviousRequestConfigurator: Configurator {      \/\/ reuse id \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044f\u0447\u0435\u0439\u043a\u0435 var reuseId: String { String(describing: SearchPreviousCell.self) }   \/\/ \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f var cellType: CatalogCellType { .historyCell }   \/\/ \u0442\u0435\u043a\u0441\u0442 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u044f\u0447\u0435\u0439\u043a\u0435   var model: String?      \/\/ \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f\u0447\u0435\u0439\u043a\u0438   func setupCell(_ cell: UIView) {     guard let cell = cell as? SearchPreviousCellProtocol,      let searchModel = model else { return }     \/\/ \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438, \u0447\u0442\u043e \u0432 \u044f\u0447\u0435\u0439\u043a\u0435     \/\/ \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u043e\u0442\u043e\u0431\u043e\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043d\u0435\u0439.     cell.displayData(searchModel: searchModel)   }  }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u044b &#8212; \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a TableManager. \u041d\u0430\u0434\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c &#171;\u0441\u043d\u0430\u0440\u0443\u0436\u0438&#187;. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u044d\u0442\u043e \u0432 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0435<\/p>\n<pre><code class=\"swift\">protocol SearchTableManagerProtocol: AnyObject {   \/\/ \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440   func attachTable(_ tableView: UITableView)   \/\/ \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432   func displayPreviousRequests(requests: [String])   \/\/ \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0438   func displaySearchResult(_ results: SearchResponseModel)      \/\/ \u043a\u043e\u043b\u0431\u0435\u043a\u0438 \u043d\u0430 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u044f\u0447\u0435\u0435\u043a   var didProductTapped((SearchProductModel) -> Void)? { get set }   var didCategoryTapped((CatalogSectionModel) -> Void)? { get set }   var didPreviousSearchTapped((String) -> Void)? { get set } }<\/code><\/pre>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 VIPER \u043c\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c TableManager \u0432 \u0441\u043b\u043e\u0435 Interactor, \u043a\u0443\u0434\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u0437 ViewController \u0447\u0435\u0440\u0435\u0437 Presenter \u0438 Interactor \u0430\u0442\u0442\u0430\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e TableManager<\/p>\n<pre><code class=\"swift\">final class SearchTableManager: NSObject, SearchTableManagerProtocol {      \/\/ MARK: - Private properties      \/\/ MARK: - Callbacks      var didProductTapped((SearchProductModel?) -> Void)?    var didCategoryTapped((CatalogSectionModel?) -> Void)?   var didPreviousSearchTapped((String?) -> Void)?      \/\/ MARK: - Public functions      func attachTable(_ tableView: UITableView) {        }      func displayPreviousRequests(requests: [String]) {        }      func displaySearchResult(_ results: SearchResponseModel) {        }      \/\/ MARK: - Private functions    }<\/code><\/pre>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<blockquote>\n<p>func attachTable(_ tableView: UITableView)<\/p>\n<\/blockquote>\n<p>\u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"swift\">private var table: UITableView?   func attachTable(_ tableView: UITableView) { self.table = tableView   table.dataSource = self   table.delegate = self   \/\/ \u0434\u0430\u043b\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044f\u0447\u0435\u0439\u043a\u0438   \/\/ \u043d\u043e, \u0447\u0442\u043e \u0435\u0449\u0435 \u043b\u0443\u0447\u0448\u0435, \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430\u0448\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 TableManager \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u0435\u0435 \u043f\u0435\u0440\u0432\u043e\u043d\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e. \u0422\u0430\u043a \u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u043d\u0435\u0433\u043e \u043a \u043d\u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0439\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0448 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c delegate , datasource. \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c. <\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0443 \u043d\u0430\u0441 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435. \u041d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u044f\u0447\u0435\u0435\u043a. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438, \u043d\u043e \u0432\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0430 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b Configurator.  <\/p>\n<pre><code class=\"swift\">private var configuratorsDataSource: [Configurator] = []<\/code><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u0443\u043d\u043a\u0442\u0435. \u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044f\u0447\u0435\u0439\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0435.<\/p>\n<p>\u0422.\u0435. \u0434\u043b\u044f 1 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a configuratorsDataSource[0], \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. <\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0435\u043a\u0446\u0438\u0439<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0435\u043a\u0446\u0438\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c configuratorsDataSource: [[Configurator]], \u0433\u0434\u0435 \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0435\u0440\u0432\u043e\u043c\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e configuratorsDataSource[1][0]. <\/p>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b. <\/p>\n<pre><code class=\"swift\">extension SearchTableManager: UITableViewDelegate, UITableViewDataSource {   \/\/ \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044f\u0447\u0435\u0435\u043a \u0432 \u0441\u0435\u043a\u0446\u0438\u0438     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {         configuratorsDataSource.count     }     \/\/ \u043a\u043e\u043d\u0444\u0438\u043d\u0443\u0440\u0430\u0446\u0438\u044f \u044f\u0447\u0435\u0435\u043a, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u044f\u0447\u0435\u0435\u043a     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {         let configurator = configuratorsDataSource[indexPath.row]         let cell = tableView.dequeueReusableCell(withIdentifier: configurator.reuseId, for: indexPath)         configurator.setupCell(cell)         return cell     }      \/\/ \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u044f\u0447\u0435\u0439\u043a\u0438   func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {     let currentConfigurator = configuratorsDataSource[indexPath.row]       switch currentConfigurator.cellType {         case .historyCell:            self.didPreviousSearchTapped?(currentConfigurator.model)         case .categoryCell:            self.didCategoryTapped?(currentConfigurator.model)          case .productCell:          self.didProductTapped?(currentConfigurator.model)         }     }   }<\/code><\/pre>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0448 UITableViewDataSource \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u043c \u0438 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u044f\u0447\u0435\u0435\u043a. <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u0438 \u0434\u043e\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0435\u0445 \u0441\u0430\u043c\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0435. <\/p>\n<pre><code class=\"swift\">\/\/ \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u044f\u0447\u0435\u0439\u043a\u0438 \u0441 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u043c  private func createProductResponseConfigurator(with model: SearchProductModel) -> Configurator {           let configurator = SearchProductConfigurator()   configurator.model = model   return configurator  }  \/\/ \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u044f\u0447\u0435\u0439\u043a\u0438 \u0441 \u0441\u0435\u043a\u0446\u0438\u0435\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430  private func createSectionResponseConfigurator(with model: SearchProductModel) -> Configurator {           let configurator = SearchSectionConfigurator()   configurator.model = model   return configurator  }  \/\/ \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u044f\u0447\u0435\u0439\u043a\u0438 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 private func createPreviouseRequestConfigurator(_ model: String) -> Configurator {           let configurator = SearchPreviousRequestConfigurator()   configurator.model = model   return configurator  }<\/code><\/pre>\n<p>\u0418\u0442\u0430\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0432\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"swift\">func displayPreviousRequests(requests: [String]) {   var output: [Configurator]= requsts.compactMap { createPreviouseRequestConfigurator($0) }   self.configuratorsDataSource = output   table?.reloadData() }  func displaySearchResult(_ results: SearchResponseModel) { var output: [Configurator] = []   output += results.searchProductsResponse.compactMap { createProductResponseConfigurator($0) }   output += results.searchSectionResponse.compactMap { createSectionResponseConfigurator($0) } self.configuratorsDataSource = output   table?.reloadData() } <\/code><\/pre>\n<p> \u041d\u0443, \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435. \u0422\u0443\u0442 \u043c\u044b \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u0443\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u043e, \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0445 \u043d\u0430\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 Interactor. <\/p>\n<h2>\u0412\u043c\u0435\u0441\u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0430 <\/h2>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u0445\u043e\u0434\u0443 \u043c\u044b \u0438\u043c\u0435\u0435\u043c: <\/p>\n<ul>\n<li>\n<p>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043b\u0435\u0433\u043a\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u044f\u0447\u0435\u0435\u043a \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u044b \u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 <\/p>\n<\/li>\n<li>\n<p>\u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u044f\u0447\u0435\u0435\u043a \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 <\/p>\n<\/li>\n<li>\n<p>\u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442\u0441\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438\u0437 \u044f\u0447\u0435\u0435\u043a<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u0443\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u0412\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u0430! \u0415\u0441\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u044b &#8212; \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u0432\u0435\u0442\u0438\u043c!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/649253\/\"> https:\/\/habr.com\/ru\/post\/649253\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u043e, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 UITableView \u043d\u0430 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438. <\/p>\n<p>\u041a \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0434\u0445\u043e\u0434\u0443 \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438. <\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435, \u0447\u0435\u043c \u043d\u0430\u0447\u0430\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 \u0432\u0441\u0435 \u043a\u0435\u0439\u0441\u044b \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0438 \u0432 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0430\u0436\u0435 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438. <\/p>\n<h3>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0431\u044b\u0447\u043d\u043e?<\/h3>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0437\u043d\u0430\u044e\u0442 \u0435\u0449\u0435 \u0441 \u043f\u0435\u0440\u0432\u044b\u0445 \u0443\u0440\u043e\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434 iOS \u0442\u0430\u043a\u043e\u0439 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043a\u0430\u043a UITableView. <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"swift\">class SomeScreen: UIViewController {    @IBOutlet weak var tableView: UITableView!      private var someDataToDisplay: [SomeModel] = []    override func viewDidLoad() {  super.viewDidLoad()   self.tableView.delegate = self     self.tableView.dataSource = self   }    }  extension SomeScreen: UITableViewDelegate, UITableViewDataSource {      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {     return someDataToDisplay.count   }      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {     guard let cell = tableView.dequeueReusableCell(withIdentifier: \"myCell\",                                                         for: indexPath) as? MyCellClass else {           return }     cell.name = someDataToDisplay[indexPath.row]    cell.someData = someDataToDisplay[indexPath.row]     return cell   }    }<\/code><\/pre>\n<p>\u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0441 \u0442\u0430\u043a\u0438\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c,  \u043a\u043e\u0442\u043e\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0445 \u0436\u0435 \u0443\u0440\u043e\u043a\u0430\u0445 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e iOS \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c UIKit \u0437\u043d\u0430\u043a\u043e\u043c\u044b, \u0432 \u0442\u043e\u043c \u0438\u043b\u0438 \u0438\u043d\u043e\u043c \u0432\u0438\u0434\u0435, \u0431\u0435\u0437 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0432\u0441\u0435.  \u0418 \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u0434\u0430\u0436\u0435\u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u0442\u0430\u043a\u0438\u0445 \u0441\u0443\u043f\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043a\u0435\u0439\u0441\u0430\u0445. <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044f\u0447\u0435\u0435\u043a, \u043c\u0435\u0442\u043e\u0434 <\/p>\n<p><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableView<\/code><\/p>\n<p>\u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"swift\">  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {     {       switch indexPath.row {       case 0:          guard let cell = tableView.dequeueReusableCell(withIdentifier: \"myCell\",                                                         for: indexPath) as? MyCellClass else {           return }    cell.name = someDataToDisplay[indexPath.row]    cell.someData = someDataToDisplay[indexPath.row]     return cell       case 1: ........          \/\/ \u0434\u0430\u043b\u0435\u0435 \u0438\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0432\u0438\u0434\u043e\u0432 \u044f\u0447\u0435\u0435\u043a        }            } <\/code><\/pre>\n<h3>\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439: <\/h3>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u044d\u043a\u0440\u0430\u043d \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 API \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0438\u0441\u043a \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044f\u0447\u0435\u0439\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u044f\u0447\u0435\u0439\u043a\u0438 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u043d\u044c\u0448\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u043b\u0438\u0441\u044c \u0441 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c \u043f\u043e \u043a\u043b\u0438\u043a\u0443 \u043d\u0430 \u0442\u043e\u0432\u0430\u0440;<\/p>\n<\/li>\n<li>\n<p>\u044f\u0447\u0435\u0439\u043a\u0430 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u043e\u0432\u0430\u0440\u0430, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0441 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c \u043f\u043e \u043a\u043b\u0438\u043a\u0443 \u043d\u0430 \u0442\u043e\u0432\u0430\u0440;<\/p>\n<\/li>\n<li>\n<p>\u044f\u0447\u0435\u0439\u043a\u0430 \u0434\u043b\u044f \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043a \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0442\u043e\u0432\u0430\u0440\u043e\u0432;<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u044f\u0447\u0435\u0435\u043a \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043d\u044b\u0435. \u0412 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c VIPER, \u043d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0441\u0435\u0439\u0447\u0430\u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e TableManager, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043d\u0435\u0433\u043e \u043c\u044b \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 &#8212; \u044d\u0442\u043e \u0440\u043e\u043b\u0438 \u043d\u0435 \u0441\u044b\u0433\u0440\u0430\u0435\u0442. <\/p>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0440\u043e\u043b\u0438.<\/p>\n<p>Configurator &#8212; \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u0435\u0431\u0435 \u0438\u043d\u043a\u0430\u043f\u0443\u0441\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<p>TableManager &#8212; \u043a\u043b\u0430\u0441\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u043e\u0442 \u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u043a \u0431\u043e\u043b\u044c\u0448\u0435\u043c\u0443 \u0438 \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u044b, \u043a\u0430\u043a\u0443\u044e \u0440\u043e\u043b\u044c \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0433\u0440\u0430\u0442\u044c \u0438 \u0437\u0430\u0447\u0435\u043c \u043e\u043d\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0430\u043c \u0442\u0443\u0442 \u043d\u0443\u0436\u043d\u044b.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 &#8212; \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u044b.<\/p>\n<pre><code class=\"swift\">enum CatalogCellType {   \/\/ \u044f\u0447\u0435\u0439\u043a\u0430 \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0438\u0437 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u0438\u0441\u043a\u0430   case historyCell   \/\/ \u044f\u0447\u0435\u0439\u043a\u0430 \u0441 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u043c, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435   case productCell   \/\/ \u044f\u0447\u0435\u0439\u043a\u0430 \u0441 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0435\u0439   case categoryCell }  protocol Configurator {   \/\/ \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u044f\u0447\u0435\u0439\u043a\u0438 \u0441 reuse id  var reuseId: String { get }   \/\/ \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u044f\u0447\u0435\u0439\u043a\u0443   var cellType: CatalogCellType { get }   \/\/ \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u044f\u0447\u0435\u0439\u043a\u0438 func setupCell(_ cell: UIView) }<\/code><\/pre>\n<p> \u0422\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0432\u0432\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 &#8212; \u0438\u043c\u0435\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 <\/p>\n<pre><code class=\"swift\">struct SearchResponseModel: Codable {   \/\/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0438 \u043f\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c   let searchProductsResponse: [SearchProductModel]   \/\/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0438 \u043f\u043e \u0441\u0435\u043a\u0446\u0438\u044f\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430   let searchSectionResponse: [CatalogSectionModel] }  struct CatalogSectionModel: Codable {     let sectionId: String     let sectionName: String     let sectionIconURL: String? }  struct SearchProductModel: Codable {     let productId: String     let productName: String     let productIconURL: String? }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u044f\u0447\u0435\u0435\u043a: <\/p>\n<pre><code class=\"swift\">\/\/ \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u044f\u0447\u0435\u0435\u043a \u0441 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0435\u0439 \u043f\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c final class SearchProductConfigurator: Configurator {      \/\/ reuse id \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044f\u0447\u0435\u0439\u043a\u0435 var reuseId: String { String(describing: SearchProductCell.self) }   \/\/ \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f var cellType: CatalogCellType { .productCell }   \/\/ \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u044f\u0447\u0435\u0439\u043a\u0435   var model: SearchProductModel?      \/\/ \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f\u0447\u0435\u0439\u043a\u0438   func setupCell(_ cell: UIView) {     guard let cell = cell as? SearchProductCellProtocol,      let productModel = model else { return }     \/\/ \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438, \u0447\u0442\u043e \u0432 \u044f\u0447\u0435\u0439\u043a\u0435     \/\/ \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u043e\u0442\u043e\u0431\u043e\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043d\u0435\u0439.     cell.displayData(productModel: productModel)   }  }  \/\/ \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u044f\u0447\u0435\u0435\u043a \u0441 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0435\u0439 \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 final class SearchSectionConfigurator: Configurator {      \/\/ reuse id \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044f\u0447\u0435\u0439\u043a\u0435 var reuseId: String { String(describing: SearchSectionCell.self) }   \/\/ \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f var cellType: CatalogCellType { .categoryCell }   \/\/ \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u044f\u0447\u0435\u0439\u043a\u0435   var model: CatalogSectionModel?      \/\/ \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f\u0447\u0435\u0439\u043a\u0438   func setupCell(_ cell: UIView) {     guard let cell = cell as? SearchSectionCellCellProtocol,      let sectionModel = model else { return }     \/\/ \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438, \u0447\u0442\u043e \u0432 \u044f\u0447\u0435\u0439\u043a\u0435     \/\/ \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u043e\u0442\u043e\u0431\u043e\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043d\u0435\u0439.     cell.displayData(sectionModel: sectionModel)   }  }  \/\/ \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u044f\u0447\u0435\u0435\u043a \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0435\u0439  final class SearchPreviousRequestConfigurator: Configurator {      \/\/ reuse id \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044f\u0447\u0435\u0439\u043a\u0435 var reuseId: String { String(describing: SearchPreviousCell.self) }   \/\/ \u0442\u0438\u043f \u044f\u0447\u0435\u0439\u043a\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f var cellType: CatalogCellType { .historyCell }   \/\/ \u0442\u0435\u043a\u0441\u0442 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u044f\u0447\u0435\u0439\u043a\u0435   var model: String?      \/\/ \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f\u0447\u0435\u0439\u043a\u0438   func setupCell(_ cell: UIView) {     guard let cell = cell as? SearchPreviousCellProtocol,      let searchModel = model else { return }     \/\/ \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438, \u0447\u0442\u043e \u0432 \u044f\u0447\u0435\u0439\u043a\u0435     \/\/ \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u043e\u0442\u043e\u0431\u043e\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043d\u0435\u0439.     cell.displayData(searchModel: searchModel)   }  }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u044b &#8212; \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a TableManager. \u041d\u0430\u0434\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c &#171;\u0441\u043d\u0430\u0440\u0443\u0436\u0438&#187;. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u044d\u0442\u043e \u0432 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0435<\/p>\n<pre><code class=\"swift\">protocol SearchTableManagerProtocol: AnyObject {   \/\/ \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440   func attachTable(_ tableView: UITableView)   \/\/ \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432   func displayPreviousRequests(requests: [String])   \/\/ \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0438   func displaySearchResult(_ results: SearchResponseModel)      \/\/ \u043a\u043e\u043b\u0431\u0435\u043a\u0438 \u043d\u0430 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u044f\u0447\u0435\u0435\u043a   var didProductTapped((SearchProductModel) -> Void)? { get set }   var didCategoryTapped((CatalogSectionModel) -> Void)? { get set }   var didPreviousSearchTapped((String) -> Void)? { get set } }<\/code><\/pre>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 VIPER \u043c\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c TableManager \u0432 \u0441\u043b\u043e\u0435 Interactor, \u043a\u0443\u0434\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u0437 ViewController \u0447\u0435\u0440\u0435\u0437 Presenter \u0438 Interactor \u0430\u0442\u0442\u0430\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e TableManager<\/p>\n<pre><code class=\"swift\">final class SearchTableManager: NSObject, SearchTableManagerProtocol {      \/\/ MARK: - Private properties      \/\/ MARK: - Callbacks      var didProductTapped((SearchProductModel?) -> Void)?    var didCategoryTapped((CatalogSectionModel?) -> Void)?   var didPreviousSearchTapped((String?) -> Void)?      \/\/ MARK: - Public functions      func attachTable(_ tableView: UITableView) {        }      func displayPreviousRequests(requests: [String]) {        }      func displaySearchResult(_ results: SearchResponseModel) {        }      \/\/ MARK: - Private functions    }<\/code><\/pre>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<blockquote>\n<p>func attachTable(_ tableView: UITableView)<\/p>\n<\/blockquote>\n<p>\u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"swift\">private var table: UITableView?   func attachTable(_ tableView: UITableView) { self.table = tableView   table.dataSource = self   table.delegate = self   \/\/ \u0434\u0430\u043b\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044f\u0447\u0435\u0439\u043a\u0438   \/\/ \u043d\u043e, \u0447\u0442\u043e \u0435\u0449\u0435 \u043b\u0443\u0447\u0448\u0435, \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430\u0448\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 TableManager \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u0435\u0435 \u043f\u0435\u0440\u0432\u043e\u043d\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e. \u0422\u0430\u043a \u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u043d\u0435\u0433\u043e \u043a \u043d\u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0439\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0448 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c delegate , datasource. \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c. <\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0443 \u043d\u0430\u0441 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435. \u041d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u044f\u0447\u0435\u0435\u043a. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438, \u043d\u043e \u0432\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0430 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b Configurator.  <\/p>\n<pre><code class=\"swift\">private var configuratorsDataSource: [Configurator] = []<\/code><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u0443\u043d\u043a\u0442\u0435. \u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044f\u0447\u0435\u0439\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0435.<\/p>\n<p>\u0422.\u0435. \u0434\u043b\u044f 1 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a configuratorsDataSource[0], \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. <\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0435\u043a\u0446\u0438\u0439<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0435\u043a\u0446\u0438\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c configuratorsDataSource: [[Configurator]], \u0433\u0434\u0435 \u0447\u0442\u043e\u0431\u044b<\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-328956","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328956","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=328956"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/328956\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=328956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=328956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=328956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}