{"id":330436,"date":"2022-03-09T15:00:30","date_gmt":"2022-03-09T15:00:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=330436"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=330436","title":{"rendered":"<span>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u0410 \u0442\u0430\u043a \u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c\u0438<\/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 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435<a href=\"https:\/\/habr.com\/ru\/post\/652543\/\" rel=\"noopener noreferrer nofollow\"> \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 TabBarController \u0438 NavigationController \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u0432 UIKit. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0443\u043d\u043a\u0442\u044b 6 \u0438 7. \u0410 Bar Button Item \u0438 Alert \u043c\u044b \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0430 \u0434\u0435\u0441\u0435\u0440\u0442 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<h3>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435\u00a0PostViewController\u00a0\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430.<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443 \u043d\u0430\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u043d\u0435 \u0432\u0430\u043b\u044f\u043b\u0438\u0441\u044c, \u0433\u0434\u0435 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u044f \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 <code>Controllers<\/code>  \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0432 \u043d\u0435\u0435 \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432. \u0422\u0430\u043a \u0436\u0435 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0443 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 <code>UIViewController<\/code> c \u0438\u043c\u0435\u043d\u0435\u043c <code>PostViewController<\/code>. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0448 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u043f\u043e\u0441\u0442\u0430.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0434\u0435\u043b\u043e\u043c, \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0438\u0442 \u043d\u0430\u0441 \u0437\u0430\u0434\u0430\u043d\u0438\u0435, \u043f\u043e\u043c\u0435\u043d\u044f\u0439\u0442\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438 \u0446\u0432\u0435\u0442 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 view. \u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u0443\u0442\u0438:<\/p>\n<p>1-\u0439 \u043f\u0443\u0442\u044c \u043a\u0443\u0441\u0442\u0430\u0440\u043d\u043e-\u0442\u043e\u043f\u043e\u0440\u043d\u044b\u0439 \u0438 \u043a \u043d\u0435\u043c\u0443 \u043d\u0435\u0442 \u043f\u0440\u0438\u0442\u0435\u043d\u0437\u0438\u0439. \u041f\u0440\u043e\u0441\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 <code>viewDidLoad<\/code> \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0430\u0434\u043e:<\/p>\n<p><code>override func viewDidLoad() {<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 super.viewDidLoad()<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 \/\/ \u0417\u0430\u0434\u0430\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0446\u0432\u0435\u0442<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.view.backgroundColor = .lightGray<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 \/\/ \u0412\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c title \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430.<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.navigationItem.title = \"\u041c\u043e\u0439 \u043f\u043e\u0441\u0442\"<\/code><\/p>\n<p><code>\u00a0 \u00a0 }<\/code><\/p>\n<p>2-\u0439 \u0431\u043e\u043b\u0435\u0435 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u044b\u0439 \u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432 \u0432\u0430\u0441 \u0437\u0430\u0434\u0430\u0442\u043a\u0438 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u043d\u0430\u0432\u044b\u043a\u0438 \u041e\u041e\u041f. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0438\u0448\u0435\u043c \u0442\u043e, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 <code>viewDidLoad<\/code>  :<\/p>\n<p>\u00a0<code>private func setupView() {<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.view.backgroundColor = .lightGray<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.navigationItem.title = \"\u041c\u043e\u0439 \u043f\u043e\u0441\u0442\"<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.navigationItem.rightBarButtonItem = button<\/code><\/p>\n<p><code>\u00a0 \u00a0 }<\/code><\/p>\n<p>\u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043f\u043e\u0441\u0442\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c. \u0410 \u043a\u0430\u043a \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u043e\u043f\u0430\u0441\u0442\u044c? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0438 \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0430\u043c \u0434\u0430\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0430.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432 FeedViewController \u043a\u043d\u043e\u043f\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430  <code>PostViewController<\/code>:<\/p>\n<p>\u00a0<code>\/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430<\/code><\/p>\n<p><code>\u00a0 \u00a0 private lazy var button: UIButton = {<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 let button = UIButton()<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 button.backgroundColor = .blue<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 button.layer.cornerRadius = 12<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 button.setTitle(\"\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u043f\u043e\u0441\u0442\", for: .normal)<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 button.setTitleColor(.lightGray, for: .normal)<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 24)<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 button.addTarget(self, action: #selector(buttonAction), for: .touchUpInside)<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 button.translatesAutoresizingMaskIntoConstraints = false<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 return button<\/code><\/p>\n<p><code>\u00a0 \u00a0 }()<\/code><\/p>\n<p>\u041a\u043d\u043e\u043f\u043a\u0430 \u0443 \u043d\u0430\u0441 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <code>private<\/code> . \u0427\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e \u043d\u0435\u0439 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043d\u0435 \u0434\u0443\u043c\u0430\u043b \u0438 \u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u043b\u0441\u044f \u043e\u043d\u0430 \u0443 \u043d\u0430\u0441 <code>lazy<\/code>.  \u0418 \u0434\u0430\u043b\u0435\u0435 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u044b \u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u0430\u043a \u043a\u043d\u043e\u043f\u043a\u0443 <code>UIButton()<\/code> . \u041c\u0435\u0442\u043e\u0434\u043e\u043c <code>.backgroundColor<\/code> \u0437\u0430\u0434\u0430\u0435\u043c \u0435\u0439 \u0446\u0432\u0435\u0442. <code>.layer.cornerRadius<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u0441\u043a\u0440\u0443\u0433\u043b\u0438\u0442\u044c \u0443\u0433\u043b\u044b \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0435 \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0439. \u0422\u0430\u043a \u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u0442\u0435\u043a\u0441\u0442 \u0434\u043b\u044f \u0435\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f <code>.setTitle()<\/code> \u0438 \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0442\u0435\u043a\u0441\u0442\u0443 \u0446\u0432\u0435\u0442 <code>.setTitleColor()<\/code>, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0438 \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0448\u0440\u0438\u0444\u0442\u0430 <code>.titleLabel?.font<\/code>.  \u041e\u0442\u043a\u043b\u044e\u0447\u0430\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f (\u043a\u043e\u043d\u0441\u0442\u0440\u0435\u0439\u043d\u0442\u044b) <code>.translatesAutoresizingMaskIntoConstraints = false<\/code>  \u0438\u0445 \u043c\u044b \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435. \u0418 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435  <code>.addTarget(self, action: #selector(buttonAction), for: .touchUpInside)<\/code>, \u0430 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043c\u044b \u0435\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0441\u043e\u0437\u0434\u0430\u043b\u0438.<\/p>\n<p>\u0410\u0445 \u0434\u0430&#8230; \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u0443 \u0441\u0430\u043c\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443 \u0432\u0435\u0440\u043d\u0443\u0442\u044c <code> return button<\/code><\/p>\n<p>\u041d\u0443 \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f, \u043f\u043e\u043b \u0434\u0435\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u043d\u043e! \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435. \u041a\u0430\u043a \u044f \u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u043e <code>viewDidLoad<\/code>  \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0438 \u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c &#8212; \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<p><code>private func setupButton {<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.view.addSubview(self.button)<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.button.bottomAnchor.constraint(equalTo: self.view.bottomAnchor, constant: -100).isActive = true <\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.button.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: 20).isActive = true<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.button.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: -20).isActive = true<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.button.heightAnchor.constraint(equalToConstant: 50).isActive = true<\/code><\/p>\n<p><code>\u00a0 \u00a0 }<\/code><\/p>\n<p><code>self.view.addSubview(self.button)<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0448\u0443 \u043a\u043d\u043e\u043f\u043a\u0443 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043e <code>view<\/code> , \u0430 \u0434\u0430\u043b\u0435\u0435 \u043c\u044b \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u043a \u043d\u0438\u0437\u0443 \u0441 \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u043c \u0432 100 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 (\u0442.\u043a. \u043e\u0442\u0441\u0442\u0443\u043f \u0443 \u043d\u0430\u0441 \u0438\u0434\u0435\u0442 \u0432\u0432\u0435\u0440\u0445, \u0442\u043e \u0438 \u0437\u043d\u0430\u043a &#171;-&#171;. \u042d\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0438 \u043a \u043e\u0442\u0441\u0442\u0443\u043f\u0430\u043c \u0441\u043f\u0440\u0430\u0432\u0430), \u0441\u043f\u0440\u0430\u0432\u0430 \u0438 \u0441\u043b\u0435\u0432\u0430, \u0438 \u0437\u0430\u0434\u0430\u0435\u043c \u0432\u044b\u0441\u043e\u0442\u0443.<\/p>\n<p>\u041d\u0443 \u0441\u043e\u043e\u0442\u0441\u0432\u0435\u0442\u0441\u0432\u0435\u043d\u043d\u043e \u0438 \u0441\u0430\u043c \u043c\u0435\u0442\u043e\u0434 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430.<\/p>\n<p>\u00a0<code>@objc private func buttonAction() {<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 let postViewController = PostViewController()<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.navigationController?.pushViewController(postViewController, animated: true)<\/code><\/p>\n<p><code>\u00a0 \u00a0 }<\/code><\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0442\u0443\u0442 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0430\u043c <code>UIViewController<\/code> \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0438 \u043f\u043e\u0442\u043e\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 (\u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u044f\u0442 &#8212; \u0437\u0430\u043f\u0443\u0448\u0438\u0442\u044c), \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0432 \u0435\u0433\u043e \u0432 <code>NavigationController<\/code><\/p>\n<p>\u041d\u0443 \u0438 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0432 <code>viewDidLoad<\/code><\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c\u0438<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f. \u041e\u043d \u043d\u0430\u0443\u0447\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Data \u0438 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c\u0438. <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 <code>Data<\/code>  \u0438 \u0432 \u043d\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c swift \u0444\u0430\u0439\u043b <code>Post<\/code> \u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e \u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443\u00a0<code>Post<\/code>\u00a0\u0441\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c\u00a0<code>title: String<\/code>. <\/p>\n<p><code>struct Post {<\/code><\/p>\n<p><code>\u00a0 \u00a0 var title: String<\/code><\/p>\n<p><code>}<\/code><\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430\u00a0<code>Post<\/code>\u00a0\u0432\u00a0<code>FeedViewController<\/code>\u00a0\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0435\u0433\u043e \u0432\u00a0<code>PostViewController<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>post<\/code> \u0441\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c <code>Post<\/code> \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <code>FeedViewController<\/code><\/p>\n<p><code>class FeedViewController: UIViewController {<\/code><\/p>\n<p><code>\u00a0 \u00a0 \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 Post \u0432 FeedViewController<\/code><\/p>\n<p><code>\u00a0 \u00a0 var post = Post(title: \"\u041c\u043e\u0439 \u043f\u043e\u0441\u0442\")<\/code><\/p>\n<p>\u0410 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u0432  <code>PostViewController<\/code>  \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u044e\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u044b \u0438\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f. \u041d\u0435\u0442, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0434\u043e!<\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0443\u043d\u043a\u0442\u0435 \u043c\u044b \u0443\u0436\u0435 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435<code>buttonAction()<\/code> \u0441\u043e\u0437\u0434\u0430\u043b\u0438 <code>UIViewController<\/code> , \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432 \u043a \u043d\u0435\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f.<\/p>\n<p>\u0418 \u0441\u0435\u0439\u0447\u0430\u0441, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u043f\u043e\u0441\u0442\u0430 \u0432 <code>PostViewController<\/code>:<\/p>\n<p><code>class PostViewController: UIViewController {<\/code><\/p>\n<p><code>\u00a0 \u00a0 var titlePost: String = \"Anonymous\"<\/code><\/p>\n<p>\u00a0 \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <code>buttonAction()<\/code> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>titlePost<\/code>  \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>post<\/code> :<\/p>\n<p>\u00a0postViewController.titlePost = post.title<\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 <code>self.navigationItem.title<\/code> \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c <code>\"\u041c\u043e\u0439 \u043f\u043e\u0441\u0442\"<\/code> \u043d\u0430 <code>titlePost<\/code> :<\/p>\n<p>\u00a0<code>self.navigationItem.title = titlePost<\/code><\/p>\n<p>\u041d\u0443 \u0432\u043e\u0442 \u0438 \u0432\u0441\u0435! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043c\u0435\u0436\u0434\u0443 <code>ViewController.<\/code> \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432\u0432\u043e\u0434\u043d\u0443 \u0432 <code>Data<\/code> &#8212; \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0438\u043c\u0438. <\/p>\n<p>\u0410 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c <code>Bar Button Item<\/code> \u0438 <code>UIAlertAction<\/code>.  <\/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\/654839\/\"> https:\/\/habr.com\/ru\/post\/654839\/<\/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 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435<a href=\"https:\/\/habr.com\/ru\/post\/652543\/\" rel=\"noopener noreferrer nofollow\"> \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 TabBarController \u0438 NavigationController \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u0432 UIKit. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0443\u043d\u043a\u0442\u044b 6 \u0438 7. \u0410 Bar Button Item \u0438 Alert \u043c\u044b \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0430 \u0434\u0435\u0441\u0435\u0440\u0442 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<h3>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435\u00a0PostViewController\u00a0\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430.<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443 \u043d\u0430\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u043d\u0435 \u0432\u0430\u043b\u044f\u043b\u0438\u0441\u044c, \u0433\u0434\u0435 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u044f \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 <code>Controllers<\/code>  \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0432 \u043d\u0435\u0435 \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432. \u0422\u0430\u043a \u0436\u0435 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0443 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 <code>UIViewController<\/code> c \u0438\u043c\u0435\u043d\u0435\u043c <code>PostViewController<\/code>. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0448 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u043f\u043e\u0441\u0442\u0430.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0434\u0435\u043b\u043e\u043c, \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0438\u0442 \u043d\u0430\u0441 \u0437\u0430\u0434\u0430\u043d\u0438\u0435, \u043f\u043e\u043c\u0435\u043d\u044f\u0439\u0442\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0438 \u0446\u0432\u0435\u0442 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 view. \u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u0443\u0442\u0438:<\/p>\n<p>1-\u0439 \u043f\u0443\u0442\u044c \u043a\u0443\u0441\u0442\u0430\u0440\u043d\u043e-\u0442\u043e\u043f\u043e\u0440\u043d\u044b\u0439 \u0438 \u043a \u043d\u0435\u043c\u0443 \u043d\u0435\u0442 \u043f\u0440\u0438\u0442\u0435\u043d\u0437\u0438\u0439. \u041f\u0440\u043e\u0441\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 <code>viewDidLoad<\/code> \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0430\u0434\u043e:<\/p>\n<p><code>override func viewDidLoad() {<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 super.viewDidLoad()<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 \/\/ \u0417\u0430\u0434\u0430\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0446\u0432\u0435\u0442<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.view.backgroundColor = .lightGray<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 \/\/ \u0412\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c title \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430.<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.navigationItem.title = \"\u041c\u043e\u0439 \u043f\u043e\u0441\u0442\"<\/code><\/p>\n<p><code>\u00a0 \u00a0 }<\/code><\/p>\n<p>2-\u0439 \u0431\u043e\u043b\u0435\u0435 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u044b\u0439 \u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432 \u0432\u0430\u0441 \u0437\u0430\u0434\u0430\u0442\u043a\u0438 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u043d\u0430\u0432\u044b\u043a\u0438 \u041e\u041e\u041f. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0438\u0448\u0435\u043c \u0442\u043e, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 <code>viewDidLoad<\/code>  :<\/p>\n<p>\u00a0<code>private func setupView() {<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.view.backgroundColor = .lightGray<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.navigationItem.title = \"\u041c\u043e\u0439 \u043f\u043e\u0441\u0442\"<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.navigationItem.rightBarButtonItem = button<\/code><\/p>\n<p><code>\u00a0 \u00a0 }<\/code><\/p>\n<p>\u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043f\u043e\u0441\u0442\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c. \u0410 \u043a\u0430\u043a \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u043e\u043f\u0430\u0441\u0442\u044c? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0438 \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0430\u043c \u0434\u0430\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0430.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432 FeedViewController \u043a\u043d\u043e\u043f\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430  <code>PostViewController<\/code>:<\/p>\n<p>\u00a0<code>\/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430<\/code><\/p>\n<p><code>\u00a0 \u00a0 private lazy var button: UIButton = {<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 let button = UIButton()<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 button.backgroundColor = .blue<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 button.layer.cornerRadius = 12<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 button.setTitle(\"\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u043f\u043e\u0441\u0442\", for: .normal)<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 button.setTitleColor(.lightGray, for: .normal)<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 24)<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 button.addTarget(self, action: #selector(buttonAction), for: .touchUpInside)<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 button.translatesAutoresizingMaskIntoConstraints = false<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 return button<\/code><\/p>\n<p><code>\u00a0 \u00a0 }()<\/code><\/p>\n<p>\u041a\u043d\u043e\u043f\u043a\u0430 \u0443 \u043d\u0430\u0441 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <code>private<\/code> . \u0427\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e \u043d\u0435\u0439 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043d\u0435 \u0434\u0443\u043c\u0430\u043b \u0438 \u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u043b\u0441\u044f \u043e\u043d\u0430 \u0443 \u043d\u0430\u0441 <code>lazy<\/code>.  \u0418 \u0434\u0430\u043b\u0435\u0435 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u044b \u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u0430\u043a \u043a\u043d\u043e\u043f\u043a\u0443 <code>UIButton()<\/code> . \u041c\u0435\u0442\u043e\u0434\u043e\u043c <code>.backgroundColor<\/code> \u0437\u0430\u0434\u0430\u0435\u043c \u0435\u0439 \u0446\u0432\u0435\u0442. <code>.layer.cornerRadius<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u0441\u043a\u0440\u0443\u0433\u043b\u0438\u0442\u044c \u0443\u0433\u043b\u044b \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0435 \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0439. \u0422\u0430\u043a \u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u0442\u0435\u043a\u0441\u0442 \u0434\u043b\u044f \u0435\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f <code>.setTitle()<\/code> \u0438 \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0442\u0435\u043a\u0441\u0442\u0443 \u0446\u0432\u0435\u0442 <code>.setTitleColor()<\/code>, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0438 \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0448\u0440\u0438\u0444\u0442\u0430 <code>.titleLabel?.font<\/code>.  \u041e\u0442\u043a\u043b\u044e\u0447\u0430\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f (\u043a\u043e\u043d\u0441\u0442\u0440\u0435\u0439\u043d\u0442\u044b) <code>.translatesAutoresizingMaskIntoConstraints = false<\/code>  \u0438\u0445 \u043c\u044b \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435. \u0418 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435  <code>.addTarget(self, action: #selector(buttonAction), for: .touchUpInside)<\/code>, \u0430 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043c\u044b \u0435\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0441\u043e\u0437\u0434\u0430\u043b\u0438.<\/p>\n<p>\u0410\u0445 \u0434\u0430&#8230; \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u0443 \u0441\u0430\u043c\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443 \u0432\u0435\u0440\u043d\u0443\u0442\u044c <code> return button<\/code><\/p>\n<p>\u041d\u0443 \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f, \u043f\u043e\u043b \u0434\u0435\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u043d\u043e! \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435. \u041a\u0430\u043a \u044f \u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u043e <code>viewDidLoad<\/code>  \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0438 \u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c &#8212; \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<p><code>private func setupButton {<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.view.addSubview(self.button)<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.button.bottomAnchor.constraint(equalTo: self.view.bottomAnchor, constant: -100).isActive = true <\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.button.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: 20).isActive = true<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.button.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: -20).isActive = true<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.button.heightAnchor.constraint(equalToConstant: 50).isActive = true<\/code><\/p>\n<p><code>\u00a0 \u00a0 }<\/code><\/p>\n<p><code>self.view.addSubview(self.button)<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0448\u0443 \u043a\u043d\u043e\u043f\u043a\u0443 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043e <code>view<\/code> , \u0430 \u0434\u0430\u043b\u0435\u0435 \u043c\u044b \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u043a \u043d\u0438\u0437\u0443 \u0441 \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u043c \u0432 100 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 (\u0442.\u043a. \u043e\u0442\u0441\u0442\u0443\u043f \u0443 \u043d\u0430\u0441 \u0438\u0434\u0435\u0442 \u0432\u0432\u0435\u0440\u0445, \u0442\u043e \u0438 \u0437\u043d\u0430\u043a &#171;-&#171;. \u042d\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0438 \u043a \u043e\u0442\u0441\u0442\u0443\u043f\u0430\u043c \u0441\u043f\u0440\u0430\u0432\u0430), \u0441\u043f\u0440\u0430\u0432\u0430 \u0438 \u0441\u043b\u0435\u0432\u0430, \u0438 \u0437\u0430\u0434\u0430\u0435\u043c \u0432\u044b\u0441\u043e\u0442\u0443.<\/p>\n<p>\u041d\u0443 \u0441\u043e\u043e\u0442\u0441\u0432\u0435\u0442\u0441\u0432\u0435\u043d\u043d\u043e \u0438 \u0441\u0430\u043c \u043c\u0435\u0442\u043e\u0434 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430.<\/p>\n<p>\u00a0<code>@objc private func buttonAction() {<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 let postViewController = PostViewController()<\/code><\/p>\n<p><code>\u00a0 \u00a0 \u00a0 \u00a0 self.navigationController?.pushViewController(postViewController, animated: true)<\/code><\/p>\n<p><code>\u00a0 \u00a0 }<\/code><\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0442\u0443\u0442 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0430\u043c <code>UIViewController<\/code> \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0438 \u043f\u043e\u0442\u043e\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 (\u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u044f\u0442 &#8212; \u0437\u0430\u043f\u0443\u0448\u0438\u0442\u044c), \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0432 \u0435\u0433\u043e \u0432 <code>NavigationController<\/code><\/p>\n<p>\u041d\u0443 \u0438 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0432 <code>viewDidLoad<\/code><\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c\u0438<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f. \u041e\u043d \u043d\u0430\u0443\u0447\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Data \u0438 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c\u0438. <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 <code>Data<\/code>  \u0438 \u0432 \u043d\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c swift \u0444\u0430\u0439\u043b <code>Post<\/code> \u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e \u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443\u00a0<code>Post<\/code>\u00a0\u0441\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c\u00a0<code>title: String<\/code>. <\/p>\n<p><code>struct Post {<\/code><\/p>\n<p><code>\u00a0 \u00a0 var title: String<\/code><\/p>\n<p><code>}<\/code><\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430\u00a0<code>Post<\/code>\u00a0\u0432\u00a0<code>FeedViewController<\/code>\u00a0\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0435\u0433\u043e \u0432\u00a0<code>PostViewController<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>post<\/code> \u0441\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c <code>Post<\/code> \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <code>FeedViewController<\/code><\/p>\n<p><code>class FeedViewController: UIViewController {<\/code><\/p>\n<p><code>\u00a0 \u00a0 \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 Post \u0432 FeedViewController<\/code><\/p>\n<p><code>\u00a0 \u00a0 var post = Post(title: \"\u041c\u043e\u0439 \u043f\u043e\u0441\u0442\")<\/code><\/p>\n<p>\u0410 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u0432  <code>PostViewController<\/code>  \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u044e\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u044b \u0438\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f. \u041d\u0435\u0442, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0434\u043e!<\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0443\u043d\u043a\u0442\u0435 \u043c\u044b \u0443\u0436\u0435 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435<code>buttonAction()<\/code> \u0441\u043e\u0437\u0434\u0430\u043b\u0438 <code>UIViewController<\/code> , \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432 \u043a \u043d\u0435\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f.<\/p>\n<p>\u0418 \u0441\u0435\u0439\u0447\u0430\u0441, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u043f\u043e\u0441\u0442\u0430 \u0432 <code>PostViewController<\/code>:<\/p>\n<p><code>class PostViewController: UIViewController {<\/code><\/p>\n<p><code>\u00a0 \u00a0 var titlePost: String = \"Anonymous\"<\/code><\/p>\n<p>\u00a0 \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <code>buttonAction()<\/code> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>titlePost<\/code>  \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>post<\/code> :<\/p>\n<p>\u00a0postViewController.titlePost = post.title<\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 <code>self.navigationItem.title<\/code> \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c <code>\"\u041c\u043e\u0439 \u043f\u043e\u0441\u0442\"<\/code> \u043d\u0430 <code>titlePost<\/code> :<\/p>\n<p>\u00a0<code>self.navigationItem.title = titlePost<\/code><\/p>\n<p>\u041d\u0443 \u0432\u043e\u0442 \u0438 \u0432\u0441\u0435! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043c\u0435\u0436\u0434\u0443 <code>ViewController.<\/code> \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432\u0432\u043e\u0434\u043d\u0443 \u0432 <code>Data<\/code> &#8212; \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0438\u043c\u0438. <\/p>\n<p>\u0410 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c <code>Bar Button Item<\/code> \u0438 <code>UIAlertAction<\/code>.  <\/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\/654839\/\"> https:\/\/habr.com\/ru\/post\/654839\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-330436","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/330436","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=330436"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/330436\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}