{"id":355198,"date":"2024-05-20T23:03:37","date_gmt":"2024-05-20T23:03:37","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=355198"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=355198","title":{"rendered":"<span>\u0412\u044b \u043d\u0435 \u0442\u0430\u043a \u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435 Kingfisher, \u0438\u043b\u0438 \u043a\u0430\u043a \u0441\u0430\u043c\u0443\u0440\u0430\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ab6\/360\/585\/ab6360585d3e3567c326bd6a9580cc2d.png\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ab6\/360\/585\/ab6360585d3e3567c326bd6a9580cc2d.png\"\/><\/figure>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u2014 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u0434\u0430\u0447\u0430, \u0434\u043b\u044f \u043d\u0435\u0435 \u043d\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 UI, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0432\u0435\u0431\u0430. \u041a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u0441\u0430\u043c\u0443\u0440\u0430\u0439 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u0443\u0442\u0435\u0439:<\/p>\n<ol>\n<li>\n<p>\u041f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442: \u0441\u0430\u043c\u043e\u043c\u0443 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043a\u044d\u0448\u0435\u043c \u0438 \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0435\u0439, \u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430\u043c\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432, \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430, \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438 \u0438 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u043c \u0435\u0449\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0441\u0440\u0435\u0434\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<\/li>\n<\/ol>\n<p>\u0420\u0435\u0434\u043a\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u043d\u0443\u043b\u044f \u0438 \u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u044d\u0442\u043e \u0445\u0430\u0440\u0430\u043a\u0438\u0440\u0438.<\/p>\n<p>\u0423 \u0441\u0430\u043c\u0443\u0440\u0430\u044f \u043d\u0435\u0442 \u0446\u0435\u043b\u0438, \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0443\u0442\u044c. \u0418 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0441\u0430\u043c\u0443\u0440\u0430\u0439 \u0443\u0436 \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 \u043f\u0443\u0442\u044c \u043f\u0440\u043e\u0435\u0445\u0430\u0442\u044c. \u0412\u043e\u0442 \u0438 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442 \u0446\u0435\u043b\u0438 \u0434\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0440\u0435\u0446\u0435\u043f\u0442 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0435\u0440\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044f \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0434\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442 \u0430\u0432\u0442\u043e\u0440\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a.<\/p>\n<h2>\u0413\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c  <\/h2>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u044f \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0440\u0435\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a: SDWebImage, AlamofireImage \u0438 Kingfisher. \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043d\u0438\u0445 \u0440\u0435\u0448\u0430\u0435\u0442 \u0441\u0430\u043c\u0443\u044e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u2014 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0432 <strong>UIImageView<\/strong>.<\/p>\n<p><strong>SDWebImage<\/strong><\/p>\n<pre><code class=\"swift\">import SDWebImage  imageView.sd_setImage(     with: URL(string: \"&lt;http:\/\/www.domain.com\/path\/to\/image.jpg>\"),     placeholderImage: UIImage(named: \"placeholder.png\") )<\/code><\/pre>\n<p><strong>AlamofireImage<\/strong> <\/p>\n<pre><code class=\"swift\">import AlamofireImage  imageView.af.setImage(     withURL: URL(string: \"&lt;https:\/\/httpbin.org\/image\/png>\"),     placeholderImage: placeholderUIImage(named: \"placeholder\") )<\/code><\/pre>\n<p><strong>Kingfisher<\/strong>  <\/p>\n<pre><code class=\"swift\">import Kingfisher  imageView.kf.setImage(     with: URL(string: \"&lt;https:\/\/example.com\/image.png>\"),     placeholder: UIImage(named: \"placeholderImage\") )<\/code><\/pre>\n<p>\u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a\u043e \u0432\u0441\u0435\u043c \u0442\u0440\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c \u0430\u0432\u0442\u043e\u0440\u044b \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u0447\u0442\u043e \u0437\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0447\u0435\u0440\u0435\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e <strong>UIImageView<\/strong>. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0432\u0437\u044f\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f AlamofireImage, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0438\u043b\u044c\u0442\u0440 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443.\u00a0<\/p>\n<pre><code class=\"swift\">import AlamofireImage  let url = URL(string: \"&lt;https:\/\/httpbin.org\/image\/png>\")! let placeholderImage = UIImage(named: \"placeholder\")!  let filter = AspectScaledToFillSizeWithRoundedCornersFilter(     size: imageView.frame.size,     radius: 20.0 )  imageView.af.setImage(     withURL: url,     placeholderImage: placeholderImage,     filter: filter )<\/code><\/pre>\n<p>\u0418\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0443\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Kingfisher \u043f\u043b\u0435\u0439\u0441\u0445\u043e\u043b\u0434\u0435\u0440 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0438\u043b\u0438 \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u0443\u0442\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.\u00a0<\/p>\n<pre><code class=\"swift\">import Kingfisher  let url = URL(string: \"&lt;https:\/\/example.com\/high_resolution_image.png>\") let processor = DownsamplingImageProcessor(size: imageView.bounds.size)              |> RoundCornerImageProcessor(cornerRadius: 20) imageView.kf.indicatorType = .activity imageView.kf.setImage(     with: url,     placeholder: UIImage(named: \"placeholderImage\"),     options: [         .processor(processor),         .scaleFactor(UIScreen.main.scale),         .transition(.fade(1)),         .cacheOriginalImage     ]) {     result in     switch result {     case .success(let value):         print(\"Task done for: \\\\(value.source.url?.absoluteString ?? \"\")\")     case .failure(let error):         print(\"Job failed: \\\\(error.localizedDescription)\")     } }<\/code><\/pre>\n<p>\u0412\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u2014 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e. \u041f\u0440\u0438\u043a\u0438\u043d\u0435\u043c, \u0447\u0435\u043c \u043c\u044b \u0442\u0443\u0442 \u043c\u043e\u0436\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c:<\/p>\n<ol>\n<li>\n<p>\u0412\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0442\u0438\u043f \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0434\u0430\u0435\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0441 \u043a\u044d\u0448\u0435\u043c;<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u0445<a href=\"https:\/\/github.com\/SDWebImage\/SDWebImage#how-to-use\" rel=\"noopener noreferrer nofollow\"> <u>SDWebImage<\/u><\/a>,<a href=\"https:\/\/github.com\/Alamofire\/AlamofireImage#image-filters-1\" rel=\"noopener noreferrer nofollow\"> <u>AlamofireImage<\/u><\/a> \u0438<a href=\"https:\/\/github.com\/onevcat\/Kingfisher#kingfisher-101\" rel=\"noopener noreferrer nofollow\"> <u>Kingfisher<\/u><\/a> \u0430\u0432\u0442\u043e\u0440\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439.<\/p>\n<p>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u043c.<\/p>\n<pre><code class=\"swift\">import UIKit import Kingfisher import Domain import Networking   final class SomeCell: UITableViewCell {      private lazy var authUseCase = Domain.UseCaseProvider.makeAuthUseCase()      \/\/ Other code      func setup(with imageID: String) {         guard isLocalImage(imageId: imageID) else {             setupImageByUrl(with: imageID)             return         }         setupImageByKey(with: imageID)     }      private func setupImageByUrl(with imageID: String) {         let modifier = AnyModifier { request -> URLRequest? in             self.authUseCase.addAuthHeaders(to: request)         }          let url = Networking.APIBaseURL.appendingPathComponent(\"images\/\\\\(imageID)\")         imageView.kf.setImage(             with: url,             placeholder: nil,             options: [.requestModifier(modifier)]         )     }      private func setupImageByKey(with imageID: String) {         if ImageCache.default.isCached(forKey: imageID) {             ImageCache.default.retrieveImage(forKey: imageID) { result in                 switch result {                 case .success(let value):                     self.imageView.kf.setImage(with: URL(string: imageID), placeholder: value.image)                 case .failure(let error):                     print(error)                 }             }         }     } }<\/code><\/pre>\n<p>\u0413\u043b\u044f\u0434\u044f \u043d\u0430 \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0430\u043c\u0443\u0440\u0430\u0439 \u0434\u0430\u0436\u0435 \u0432 \u0448\u043b\u0435\u043c\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0449\u0435\u0439:<\/p>\n<ol>\n<li>\n<p>\u041a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0432\u0435\u0440\u0441\u0442\u043a\u043e\u0439 \u0437\u0430\u0447\u0435\u043c-\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e, \u043d\u043e \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043d\u0435\u043a\u0443\u044e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u043c\u043f\u043e\u0440\u0442\u044b Networking \u0438 Domain;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u044e\u0437\u043a\u0435\u0439\u0441\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u0430 \u044d\u0442\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0442 \u0445\u0430\u0433\u0430\u043a\u0443\u0440\u044d \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u044b \u0432 \u043e\u0442\u0440\u0430\u0441\u043b\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431 \u044d\u0442\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0437\u043d\u0430\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d;<\/p>\n<\/li>\n<li>\n<p>\u041c\u044b \u043d\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u044d\u0448\u0435\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0441\u043d\u0430\u0440\u0443\u0436\u0438, \u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c.<\/p>\n<\/li>\n<\/ol>\n<h2>\u041c\u0438\u043d\u0443\u0441\u044b \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430  <\/h2>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e, \u0445\u043e\u0442\u044f \u043e\u043d \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u0433\u043e\u0434\u0438\u0442\u0441\u044f. \u0412\u043e\u0442 \u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u0435\u0433\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<ol>\n<li>\n<p>\u0411\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430 UI-\u0441\u043b\u043e\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0421\u0438\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0432\u044f\u0437\u043a\u0430 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0438 \u0445\u043e\u0434\u043e\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<h4>\u0411\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430 UI-\u0441\u043b\u043e\u0435<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0430 UI-\u0441\u043b\u043e\u0435 \u043f\u043e\u0441\u0435\u043b\u0438\u0442\u0441\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430, \u043a\u043e\u0434 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u043c \u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c UI-\u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u0442\u044c \u043a \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0443, \u0435\u0441\u043b\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0434\u0440\u0443\u0433\u043e\u043c UI-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435.  <\/p>\n<h4>\u0421\u0438\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0432\u044f\u0437\u043a\u0430 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/h4>\n<p>\u0426\u0435\u043b\u0438\u043a\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u043f\u0430\u0441\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e:<\/p>\n<ol>\n<li>\n<p>\u0412 \u043d\u0435\u0439 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438\u0441\u044c \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0432\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u0445\u0432\u0430\u0442\u0430\u0442\u044c \u0435\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0433\u0443\u0442 \u0432\u0441\u043f\u043b\u044b\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e;<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c.<\/p>\n<\/li>\n<\/ol>\n<p>\u041e\u0442 \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u2014 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e <strong><em>UIImageView<\/em><\/strong>, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<h4>\u041d\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0438 \u0445\u043e\u0434\u043e\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/h4>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 UI-\u0441\u043b\u043e\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0435\u0449\u0435 \u0438 \u0437\u0430 \u0441\u0442\u0430\u0440\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u0421\u043f\u043e\u0441\u043e\u0431\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u044f\u0432\u043d\u043e \u043d\u0435\u0442. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0441\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d <strong><em>default<\/em><\/strong>, \u0438 \u043d\u0430\u0434\u0435\u044f\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043b\u043e\u0433\u0438\u043a\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 UI-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u044d\u0442\u0438\u043c \u0436\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u043c. \u0418\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c UI-\u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c <strong><em>ViewModel<\/em><\/strong> \u0434\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 <strong><em>View<\/em><\/strong>.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u043b\u044f \u043d\u0430\u0441, \u043a\u0430\u043a \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 UI-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043d\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u043a\u0430\u043a\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0437\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 <strong><em>ViewModel<\/em><\/strong>. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 <strong><em>setup(with imageID: String)<\/em><\/strong>, \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043a\u0430\u043a \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u0442\u0430\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0435\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043a\u044d\u0448\u0430, \u0438 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<pre><code class=\"swift\">func setup(with imageID: String) {     guard isLocalImage(imageId: imageID) else {         setupImageByUrl(with: imageID)         return     }     setupImageByKey(with: imageID) }<\/code><\/pre>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041e\u0442 \u0432\u0441\u0435\u0445 \u0442\u0440\u0435\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a.<\/p>\n<h4>\u0418\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u043e\u0442 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u043d\u0430 UI-\u0441\u043b\u043e\u0435  <\/h4>\n<p>\u0421\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e <strong><em>ViewModel<\/em><\/strong> \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u043c\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0444\u043b\u0430\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 UI \u043c\u043e\u0436\u0435\u0442 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<ol>\n<li>\n<p>\u0421\u043a\u0440\u044b\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043a\u0440\u0430\u0441\u0438\u0442\u044c \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0446\u0432\u0435\u0442;<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <strong><em>UIImage<\/em><\/strong>;<\/p>\n<\/li>\n<li>\n<p>\u0418 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<\/li>\n<\/ol>\n<p><strong><em>ViewModel<\/em><\/strong> \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u043c\u0435\u0442\u044c \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u043b\u0438\u0448\u043d\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 <strong><em>View<\/em><\/strong> \u0431\u0443\u0434\u0443\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <strong><em>isLoggedIn<\/em><\/strong> \u2014 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438, <strong><em>isAuthButtonHidden<\/em><\/strong> \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <strong><em>ViewModel<\/em><\/strong>.<\/p>\n<pre><code class=\"swift\">struct ViewModel: Equatable {     let image: UIImage? }<\/code><\/pre>\n<p><em>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/em><\/p>\n<h4>\u0418\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u043e\u0442 \u0437\u0430\u0432\u044f\u0437\u043a\u0438 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/h4>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e\u0435: \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c.<\/p>\n<pre><code class=\"swift\">protocol ImageDownloaderProtocol {     func getImage(from url: URL) async throws -> UIImage }<\/code><\/pre>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c Kingfisher \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b. \u0421\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u043f\u0446\u0438\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0438 \u043a\u044d\u0448, \u043c\u043e\u0436\u043d\u043e \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0435\u0449\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u044d\u043a\u0440\u0430\u043d\u0430.  <\/p>\n<pre><code class=\"swift\">init(manager: KingfisherManager, options: KingfisherOptionsInfo? = nil) {     self.manager = manager     self.options = options }<\/code><\/pre>\n<p>\u0418 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Kingfisher&#8217;\u0430 \u0441 callback\u2019\u043e\u0432 \u043d\u0430 Swift Concurrency.  <\/p>\n<pre><code class=\"swift\">func getImage(from url: URL) async throws -> UIImage {     return try await withCheckedThrowingContinuation { continuation in         self.manager.retrieveImage(             with: url,             options: options         ) { result in             switch result {             case .success(let image):                 continuation.resume(returning: image.image)             case .failure(let error):                 continuation.resume(throwing: error)             }         }     } }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 <strong><em>ViewModel<\/em><\/strong>, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0430\u0445, \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u043c\u0435\u0441\u0442\u043e \u0438 \u043f\u043e\u0434\u0445\u043e\u0434, \u043a\u0430\u043a \u044d\u0442\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c.<\/p>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0445\u043e\u0434\u043e\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438  <\/h4>\n<p>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443. \u0412 <strong><em>MVI<\/em><\/strong> \u0438\u043b\u0438 <strong><em>VIP<\/em><\/strong> \u2014 <strong><em>Interactor<\/em><\/strong>, \u0432 <strong><em>MVVM<\/em><\/strong> \u2014 <strong><em>ViewModel<\/em><\/strong>. \u0414\u0435\u043c\u043e-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u044f \u0434\u0435\u043b\u0430\u043b \u043d\u0430 <strong><em>MVC<\/em><\/strong>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443 \u043c\u0435\u043d\u044f \u0437\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 <strong><em>ViewController<\/em><\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0434\u0432\u0430.<\/p>\n<p>\u041e\u0434\u0438\u043d \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0432\u0441\u0435\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 <strong><em>UICollectionView<\/em><\/strong>.<\/p>\n<pre><code class=\"swift\">override func viewDidLoad() {     super.viewDidLoad()      setupUI()     setupLayout()     Task {         let photos = await photosRepo.fetchPhotos()         self.viewModels = photos.map(photoToViewModel)         await downloadAllImages()     } }<\/code><\/pre>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043f\u043e \u043c\u0435\u0442\u043e\u0434\u0443 <strong><em><u>UICollectionViewDelegate collectionView(_:willDisplay:forItemAt:)<\/u><\/em><\/strong> \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u043b \u044f\u0447\u0435\u0439\u043a\u0443, \u0435\u0441\u043b\u0438 \u043a \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043e\u043d\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435. <\/p>\n<pre><code class=\"swift\">func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {     if tasks[indexPath] == nil {         tasks[indexPath] = Task {             await loadImages(for: indexPath)             if collectionView.indexPathsForVisibleItems.contains(indexPath) {                 collectionView.reconfigureItems(at: [indexPath])             }         }     } }<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441\u0431\u043e\u0440\u043a\u0438 <strong><em>ViewModel<\/em><\/strong> \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 <strong><em>Builder<\/em><\/strong>.  <\/p>\n<pre><code class=\"swift\">protocol ViewModelBuilderProtocol {     associatedtype DTO     associatedtype ViewModel      func buildViewModel(for object: DTO) -> ViewModel }<\/code><\/pre>\n<p>\u0421\u0443\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <strong><em>Controller<\/em><\/strong> \u0438\u043b\u0438 \u0442\u043e, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443, \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043e\u043a \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439, \u043f\u043e \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430\u043c \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 <strong><em>builder<\/em><\/strong> \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0438 \u043f\u0440\u043e\u0441\u0438\u0442 \u0432\u044b\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e <strong><em>ViewModel.<\/em><\/strong><\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 <strong><em><u>URLComponent<\/u><\/em><\/strong> \u0438\u0437 <strong><em><u>Foundation.<\/u><\/em><\/strong><\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u0447\u0430\u0441\u0442\u044c <strong><em>View<\/em><\/strong>, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0430\u043c\u0438 \u0440\u0435\u0448\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c <strong><em>UI<\/em><\/strong> \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>\u042f \u0440\u0435\u0448\u0438\u043b \u0434\u0435\u043b\u0430\u0442\u044c <strong><em>builder<\/em><\/strong> \u043a\u044d\u0448\u0438\u0440\u0443\u044e\u0449\u0438\u043c \u0438 \u043f\u0440\u0435\u0432\u044c\u044e, \u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0438 \u0438\u0442\u043e\u0433\u043e\u0432\u0443\u044e \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u044c. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0433\u043e\u043d\u043a\u0438, \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b <strong><em><u>ConcurrentQueue<\/u><\/em><\/strong> \u043d\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h3>\u0411\u043b\u043e\u043a-\u0441\u0445\u0435\u043c\u0430 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/716\/857\/2de\/7168572de427f0bbcf7f542253b2f2aa.png\" width=\"681\" height=\"485\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/716\/857\/2de\/7168572de427f0bbcf7f542253b2f2aa.png\"\/><\/figure>\n<h2>\u0412\u044b\u0432\u043e\u0434<\/h2>\n<p>\u041f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043a\u043e\u043b\u044c \u0443\u0433\u043e\u0434\u043d\u043e \u043c\u043d\u043e\u0433\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a. \u0425\u043e\u0442\u0435\u043b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043d\u0430\u0434\u043e, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439, \u043a\u0442\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0442, \u0441\u043c\u043e\u0433 \u043d\u0430\u0439\u0442\u0438 \u0441\u043b\u0430\u0431\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0438 \u043b\u0435\u0433\u043a\u043e \u0438\u0445 \u0437\u0430\u043b\u0430\u0442\u0430\u0442\u044c.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0447\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b\u0438, \u0441\u0430\u043c\u0443\u0440\u0430\u0438! \u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u0441\u043e\u0432\u0435\u0442 \u0438\u0437 \u0431\u0443\u0441\u0438\u0434\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a: \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u0435\u0440\u0436\u0438\u0442\u0435 \u0432 \u0433\u043e\u043b\u043e\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0432\u0437\u044f\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/761772\/\"> https:\/\/habr.com\/ru\/articles\/761772\/<\/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 article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u2014 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u0434\u0430\u0447\u0430, \u0434\u043b\u044f \u043d\u0435\u0435 \u043d\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 UI, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0432\u0435\u0431\u0430. \u041a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u0441\u0430\u043c\u0443\u0440\u0430\u0439 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u0443\u0442\u0435\u0439:<\/p>\n<ol>\n<li>\n<p>\u041f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442: \u0441\u0430\u043c\u043e\u043c\u0443 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043a\u044d\u0448\u0435\u043c \u0438 \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0435\u0439, \u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430\u043c\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432, \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430, \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438 \u0438 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u043c \u0435\u0449\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0441\u0440\u0435\u0434\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<\/li>\n<\/ol>\n<p>\u0420\u0435\u0434\u043a\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u043d\u0443\u043b\u044f \u0438 \u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u044d\u0442\u043e \u0445\u0430\u0440\u0430\u043a\u0438\u0440\u0438.<\/p>\n<p>\u0423 \u0441\u0430\u043c\u0443\u0440\u0430\u044f \u043d\u0435\u0442 \u0446\u0435\u043b\u0438, \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0443\u0442\u044c. \u0418 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0441\u0430\u043c\u0443\u0440\u0430\u0439 \u0443\u0436 \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 \u043f\u0443\u0442\u044c \u043f\u0440\u043e\u0435\u0445\u0430\u0442\u044c. \u0412\u043e\u0442 \u0438 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442 \u0446\u0435\u043b\u0438 \u0434\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0440\u0435\u0446\u0435\u043f\u0442 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0435\u0440\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044f \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0434\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442 \u0430\u0432\u0442\u043e\u0440\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a.<\/p>\n<h2>\u0413\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c  <\/h2>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u044f \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0440\u0435\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a: SDWebImage, AlamofireImage \u0438 Kingfisher. \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043d\u0438\u0445 \u0440\u0435\u0448\u0430\u0435\u0442 \u0441\u0430\u043c\u0443\u044e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u2014 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0432 <strong>UIImageView<\/strong>.<\/p>\n<p><strong>SDWebImage<\/strong><\/p>\n<pre><code class=\"swift\">import SDWebImage  imageView.sd_setImage(     with: URL(string: \"&lt;http:\/\/www.domain.com\/path\/to\/image.jpg>\"),     placeholderImage: UIImage(named: \"placeholder.png\") )<\/code><\/pre>\n<p><strong>AlamofireImage<\/strong> <\/p>\n<pre><code class=\"swift\">import AlamofireImage  imageView.af.setImage(     withURL: URL(string: \"&lt;https:\/\/httpbin.org\/image\/png>\"),     placeholderImage: placeholderUIImage(named: \"placeholder\") )<\/code><\/pre>\n<p><strong>Kingfisher<\/strong>  <\/p>\n<pre><code class=\"swift\">import Kingfisher  imageView.kf.setImage(     with: URL(string: \"&lt;https:\/\/example.com\/image.png>\"),     placeholder: UIImage(named: \"placeholderImage\") )<\/code><\/pre>\n<p>\u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043a\u043e \u0432\u0441\u0435\u043c \u0442\u0440\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c \u0430\u0432\u0442\u043e\u0440\u044b \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u0447\u0442\u043e \u0437\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0447\u0435\u0440\u0435\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e <strong>UIImageView<\/strong>. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0432\u0437\u044f\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f AlamofireImage, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0438\u043b\u044c\u0442\u0440 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443.\u00a0<\/p>\n<pre><code class=\"swift\">import AlamofireImage  let url = URL(string: \"&lt;https:\/\/httpbin.org\/image\/png>\")! let placeholderImage = UIImage(named: \"placeholder\")!  let filter = AspectScaledToFillSizeWithRoundedCornersFilter(     size: imageView.frame.size,     radius: 20.0 )  imageView.af.setImage(     withURL: url,     placeholderImage: placeholderImage,     filter: filter )<\/code><\/pre>\n<p>\u0418\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0443\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Kingfisher \u043f\u043b\u0435\u0439\u0441\u0445\u043e\u043b\u0434\u0435\u0440 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0438\u043b\u0438 \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u0443\u0442\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.\u00a0<\/p>\n<pre><code class=\"swift\">import Kingfisher  let url = URL(string: \"&lt;https:\/\/example.com\/high_resolution_image.png>\") let processor = DownsamplingImageProcessor(size: imageView.bounds.size)              |> RoundCornerImageProcessor(cornerRadius: 20) imageView.kf.indicatorType = .activity imageView.kf.setImage(     with: url,     placeholder: UIImage(named: \"placeholderImage\"),     options: [         .processor(processor),         .scaleFactor(UIScreen.main.scale),         .transition(.fade(1)),         .cacheOriginalImage     ]) {     result in     switch result {     case .success(let value):         print(\"Task done for: \\\\(value.source.url?.absoluteString ?? \"\")\")     case .failure(let error):         print(\"Job failed: \\\\(error.localizedDescription)\")     } }<\/code><\/pre>\n<p>\u0412\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u2014 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e. \u041f\u0440\u0438\u043a\u0438\u043d\u0435\u043c, \u0447\u0435\u043c \u043c\u044b \u0442\u0443\u0442 \u043c\u043e\u0436\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c:<\/p>\n<ol>\n<li>\n<p>\u0412\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0442\u0438\u043f \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0434\u0430\u0435\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0441 \u043a\u044d\u0448\u0435\u043c;<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u0445<a href=\"https:\/\/github.com\/SDWebImage\/SDWebImage#how-to-use\" rel=\"noopener noreferrer nofollow\"> <u>SDWebImage<\/u><\/a>,<a href=\"https:\/\/github.com\/Alamofire\/AlamofireImage#image-filters-1\" rel=\"noopener noreferrer nofollow\"> <u>AlamofireImage<\/u><\/a> \u0438<a href=\"https:\/\/github.com\/onevcat\/Kingfisher#kingfisher-101\" rel=\"noopener noreferrer nofollow\"> <u>Kingfisher<\/u><\/a> \u0430\u0432\u0442\u043e\u0440\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439.<\/p>\n<p>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u043c.<\/p>\n<pre><code class=\"swift\">import UIKit import Kingfisher import Domain import Networking   final class SomeCell: UITableViewCell {      private lazy var authUseCase = Domain.UseCaseProvider.makeAuthUseCase()      \/\/ Other code      func setup(with imageID: String) {         guard isLocalImage(imageId: imageID) else {             setupImageByUrl(with: imageID)             return         }         setupImageByKey(with: imageID)     }      private func setupImageByUrl(with imageID: String) {         let modifier = AnyModifier { request -> URLRequest? in             self.authUseCase.addAuthHeaders(to: request)         }          let url = Networking.APIBaseURL.appendingPathComponent(\"images\/\\\\(imageID)\")         imageView.kf.setImage(             with: url,             placeholder: nil,             options: [.requestModifier(modifier)]         )     }      private func setupImageByKey(with imageID: String) {         if ImageCache.default.isCached(forKey: imageID) {             ImageCache.default.retrieveImage(forKey: imageID) { result in                 switch result {                 case .success(let value):                     self.imageView.kf.setImage(with: URL(string: imageID), placeholder: value.image)                 case .failure(let error):                     print(error)                 }             }         }     } }<\/code><\/pre>\n<p>\u0413\u043b\u044f\u0434\u044f \u043d\u0430 \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0430\u043c\u0443\u0440\u0430\u0439 \u0434\u0430\u0436\u0435 \u0432 \u0448\u043b\u0435\u043c\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0449\u0435\u0439:<\/p>\n<ol>\n<li>\n<p>\u041a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0432\u0435\u0440\u0441\u0442\u043a\u043e\u0439 \u0437\u0430\u0447\u0435\u043c-\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e, \u043d\u043e \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043d\u0435\u043a\u0443\u044e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u043c\u043f\u043e\u0440\u0442\u044b Networking \u0438 Domain;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u044e\u0437\u043a\u0435\u0439\u0441\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u0430 \u044d\u0442\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0442 \u0445\u0430\u0433\u0430\u043a\u0443\u0440\u044d \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u044b \u0432 \u043e\u0442\u0440\u0430\u0441\u043b\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431 \u044d\u0442\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0437\u043d\u0430\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d;<\/p>\n<\/li>\n<li>\n<p>\u041c\u044b \u043d\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u044d\u0448\u0435\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0441\u043d\u0430\u0440\u0443\u0436\u0438, \u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c.<\/p>\n<\/li>\n<\/ol>\n<h2>\u041c\u0438\u043d\u0443\u0441\u044b \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430  <\/h2>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e, \u0445\u043e\u0442\u044f \u043e\u043d \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u0433\u043e\u0434\u0438\u0442\u0441\u044f. \u0412\u043e\u0442 \u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u0435\u0433\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<ol>\n<li>\n<p>\u0411\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430 UI-\u0441\u043b\u043e\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0421\u0438\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0432\u044f\u0437\u043a\u0430 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0438 \u0445\u043e\u0434\u043e\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<h4>\u0411\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430 UI-\u0441\u043b\u043e\u0435<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0430 UI-\u0441\u043b\u043e\u0435 \u043f\u043e\u0441\u0435\u043b\u0438\u0442\u0441\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430, \u043a\u043e\u0434 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u043c \u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c UI-\u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u0442\u044c \u043a \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0443, \u0435\u0441\u043b\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0434\u0440\u0443\u0433\u043e\u043c UI-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435.  <\/p>\n<h4>\u0421\u0438\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0432\u044f\u0437\u043a\u0430 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/h4>\n<p>\u0426\u0435\u043b\u0438\u043a\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u043f\u0430\u0441\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e:<\/p>\n<ol>\n<li>\n<p>\u0412 \u043d\u0435\u0439 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438\u0441\u044c \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0432\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u0445\u0432\u0430\u0442\u0430\u0442\u044c \u0435\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0433\u0443\u0442 \u0432\u0441\u043f\u043b\u044b\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e;<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c.<\/p>\n<\/li>\n<\/ol>\n<p>\u041e\u0442 \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u2014 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e <strong><em>UIImageView<\/em><\/strong>, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<h4>\u041d\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0438 \u0445\u043e\u0434\u043e\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/h4>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 UI-\u0441\u043b\u043e\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0435\u0449\u0435 \u0438 \u0437\u0430 \u0441\u0442\u0430\u0440\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u0421\u043f\u043e\u0441\u043e\u0431\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u044f\u0432\u043d\u043e \u043d\u0435\u0442. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0441\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d <strong><em>default<\/em><\/strong>, \u0438 \u043d\u0430\u0434\u0435\u044f\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043b\u043e\u0433\u0438\u043a\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 UI-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u044d\u0442\u0438\u043c \u0436\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u043c. \u0418\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c UI-\u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c <strong><em>ViewModel<\/em><\/strong> \u0434\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 <strong><em>View<\/em><\/strong>.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u043b\u044f \u043d\u0430\u0441, \u043a\u0430\u043a \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 UI-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043d\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u043a\u0430\u043a\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0437\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 <strong><em>ViewModel<\/em><\/strong>. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 <strong><em>setup(with imageID: String)<\/em><\/strong>, \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043a\u0430\u043a \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u0442\u0430\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0435\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043a\u044d\u0448\u0430, \u0438 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<pre><code class=\"swift\">func setup(with imageID: String) {     guard isLocalImage(imageId: imageID) else {         setupImageByUrl(with: imageID)         return     }     setupImageByKey(with: imageID) }<\/code><\/pre>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041e\u0442 \u0432\u0441\u0435\u0445 \u0442\u0440\u0435\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a.<\/p>\n<h4>\u0418\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u043e\u0442 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u043d\u0430 UI-\u0441\u043b\u043e\u0435  <\/h4>\n<p>\u0421\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e <strong><em>ViewModel<\/em><\/strong> \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u043c\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0444\u043b\u0430\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 UI \u043c\u043e\u0436\u0435\u0442 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<ol>\n<li>\n<p>\u0421\u043a\u0440\u044b\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043a\u0440\u0430\u0441\u0438\u0442\u044c \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0446\u0432\u0435\u0442;<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <strong><em>UIImage<\/em><\/strong>;<\/p>\n<\/li>\n<li>\n<p>\u0418 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<\/li>\n<\/ol>\n<p><strong><em>ViewModel<\/em><\/strong> \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u043c\u0435\u0442\u044c \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u043b\u0438\u0448\u043d\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 <strong><em>View<\/em><\/strong> \u0431\u0443\u0434\u0443\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <strong><em>isLoggedIn<\/em><\/strong> \u2014 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438, <strong><em>isAuthButtonHidden<\/em><\/strong> \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <strong><em>ViewModel<\/em><\/strong>.<\/p>\n<pre><code class=\"swift\">struct ViewModel: Equatable {     let image: UIImage? }<\/code><\/pre>\n<p><em>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/em><\/p>\n<h4>\u0418\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u043e\u0442 \u0437\u0430\u0432\u044f\u0437\u043a\u0438 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/h4>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e\u0435: \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c.<\/p>\n<pre><code class=\"swift\">protocol ImageDownloaderProtocol {     func getImage(from url: URL) async throws -> UIImage }<\/code><\/pre>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c Kingfisher \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b. \u0421\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u043f\u0446\u0438\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0438 \u043a\u044d\u0448, \u043c\u043e\u0436\u043d\u043e \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0435\u0449\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u044d\u043a\u0440\u0430\u043d\u0430.  <\/p>\n<pre><code class=\"swift\">init(manager: KingfisherManager, options: KingfisherOptionsInfo? = nil) {     self.manager = manager     self.options = options }<\/code><\/pre>\n<p>\u0418 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Kingfisher&#8217;\u0430 \u0441 callback\u2019\u043e\u0432 \u043d\u0430 Swift Concurrency.  <\/p>\n<pre><code class=\"swift\">func getImage(from url: URL) async throws -> UIImage {     return try await withCheckedThrowingContinuation { continuation in         self.manager.retrieveImage(             with: url,             options: options         ) { result in             switch result {             case .success(let image):                 continuation.resume(returning: image.image)             case .failure(let error):                 continuation.resume(throwing: error)             }         }     } }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 <strong><em>ViewModel<\/em><\/strong>, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0430\u0445, \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u043c\u0435\u0441\u0442\u043e \u0438 \u043f\u043e\u0434\u0445\u043e\u0434, \u043a\u0430\u043a \u044d\u0442\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c.<\/p>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0445\u043e\u0434\u043e\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438  <\/h4>\n<p>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443. \u0412 <strong><em>MVI<\/em><\/strong> \u0438\u043b\u0438 <strong><em>VIP<\/em><\/strong> \u2014 <strong><em>Interactor<\/em><\/strong>, \u0432 <strong><em>MVVM<\/em><\/strong> \u2014 <strong><em>ViewModel<\/em><\/strong>. \u0414\u0435\u043c\u043e-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u044f \u0434\u0435\u043b\u0430\u043b \u043d\u0430 <strong><em>MVC<\/em><\/strong>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443 \u043c\u0435\u043d\u044f \u0437\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 <strong><em>ViewController<\/em><\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0434\u0432\u0430.<\/p>\n<p>\u041e\u0434\u0438\u043d \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0432\u0441\u0435\u0445<\/p>\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-355198","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/355198","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=355198"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/355198\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=355198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=355198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=355198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}