Skip to content

Commit 4570036

Browse files
authored
Reader: Remove ReaderFollowedSitesViewController (#23756)
* Remove redundant tableView.contentInsetAdjustmentBehavior = .always * Remove ReaderFollowedSitesViewController * Remove downloadSiteIcon usage from PrepublishingHeaderView
1 parent 60096b9 commit 4570036

File tree

8 files changed

+10
-692
lines changed

8 files changed

+10
-692
lines changed

WordPress/Classes/Extensions/NoResultsViewController+FollowedSites.swift

Lines changed: 0 additions & 44 deletions
This file was deleted.

WordPress/Classes/Extensions/UIImageView+SiteIcon.swift

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -95,47 +95,6 @@ extension UIImageView {
9595
}
9696
})
9797
}
98-
99-
/// Downloads the SiteIcon Image, associated to a given Blog. This method will attempt to optimize the URL, so that
100-
/// the download Image Size matches `imageSize`.
101-
///
102-
/// - Parameters:
103-
/// - blog: reference to the source blog
104-
/// - placeholderImage: Yes. It's the "place holder image".
105-
///
106-
@objc func downloadSiteIcon(
107-
for blog: Blog,
108-
imageSize: CGSize = SiteIconDefaults.imageSize,
109-
placeholderImage: UIImage? = .siteIconPlaceholder
110-
) {
111-
guard let siteIconPath = blog.icon, let siteIconURL = SiteIconViewModel.optimizedURL(for: siteIconPath, imageSize: imageSize, isP2: blog.isAutomatticP2) else {
112-
113-
if blog.isWPForTeams() && placeholderImage == .siteIconPlaceholder {
114-
image = UIImage.gridicon(.p2, size: imageSize)
115-
return
116-
}
117-
118-
image = placeholderImage
119-
return
120-
}
121-
122-
logURLOptimization(from: siteIconPath, to: siteIconURL, for: blog)
123-
124-
let host = MediaHost(with: blog) { error in
125-
// We'll log the error, so we know it's there, but we won't halt execution.
126-
DDLogError("\(error.localizedDescription)")
127-
}
128-
129-
let mediaRequestAuthenticator = MediaRequestAuthenticator()
130-
mediaRequestAuthenticator.authenticatedRequest(
131-
for: siteIconURL,
132-
from: host,
133-
onComplete: { [weak self] request in
134-
self?.downloadSiteIcon(with: request, imageSize: imageSize, placeholderImage: placeholderImage)
135-
}) { error in
136-
DDLogError("\(error.localizedDescription)")
137-
}
138-
}
13998
}
14099

141100
// MARK: - Logging Support

WordPress/Classes/ViewRelated/Post/Prepublishing Nudge/PrepublishingHeaderView.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import UIKit
22

33
final class PrepublishingHeaderView: UIView {
4-
private let blogImageView = UIImageView()
4+
private let blogImageView = SiteIconHostingView()
55
private let publishingToLabel = UILabel()
66
private let blogTitleLabel = UILabel()
77

@@ -34,9 +34,10 @@ final class PrepublishingHeaderView: UIView {
3434
WPStyleGuide.applyBorderStyle(separator)
3535
separator.alpha = 0
3636

37+
let imageSize = SiteIconViewModel.Size.regular.width
3738
NSLayoutConstraint.activate([
38-
blogImageView.widthAnchor.constraint(equalToConstant: 44),
39-
blogImageView.heightAnchor.constraint(equalToConstant: 44),
39+
blogImageView.widthAnchor.constraint(equalToConstant: imageSize),
40+
blogImageView.heightAnchor.constraint(equalToConstant: imageSize),
4041
])
4142

4243
let labelsStackView = UIStackView(arrangedSubviews: [publishingToLabel, blogTitleLabel])
@@ -72,7 +73,7 @@ final class PrepublishingHeaderView: UIView {
7273
}
7374

7475
func configure(_ blog: Blog) {
75-
blogImageView.downloadSiteIcon(for: blog)
76+
blogImageView.setIcon(with: .init(blog: blog, size: .regular))
7677
blogTitleLabel.text = blog.title
7778
}
7879
}

0 commit comments

Comments
 (0)