Skip to content

Commit c782fa2

Browse files
authored
Reader: Remove legacy code (#23669)
2 parents 29e5d8d + 4aa74c1 commit c782fa2

File tree

4 files changed

+1
-265
lines changed

4 files changed

+1
-265
lines changed

WordPress/Classes/ViewRelated/Reader/ReaderAnnouncementHeaderView.swift

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

WordPress/Classes/ViewRelated/Reader/ReaderStreamViewController+Helper.swift

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ extension ReaderStreamViewController {
2525
configure(header, topic: topic, isLoggedIn: isLoggedIn, delegate: self)
2626
return header
2727
}
28-
29-
// The announcement header should have the lowest display priority.
30-
// Only return the announcement when there's no other header.
31-
return makeAnnouncementHeader()
28+
return nil
3229
}
3330

3431
func configure(_ header: ReaderHeader?, topic: ReaderAbstractTopic, isLoggedIn: Bool, delegate: ReaderStreamHeaderDelegate) {
@@ -169,56 +166,6 @@ extension ReaderStreamViewController {
169166

170167
}
171168

172-
// MARK: - Reader Announcement Header
173-
174-
extension ReaderStreamViewController {
175-
/// Returns a header view for Reader-related announcements.
176-
/// Note that the announcement can also be shown on topicless streams (e.g., Saved, Tags).
177-
///
178-
/// - Returns: A configured UIView, or nil if the conditions are not met.
179-
func makeAnnouncementHeader() -> UIView? {
180-
// don't show the announcement while searching.
181-
if let readerTopic,
182-
ReaderHelpers.isTopicSearchTopic(readerTopic) {
183-
return nil
184-
}
185-
186-
guard readerAnnouncementCoordinator.canShowAnnouncement,
187-
tableView.tableHeaderView == nil,
188-
!isContentFiltered,
189-
!contentIsEmpty() else {
190-
return nil
191-
}
192-
193-
return ReaderAnnouncementHeaderView(doneButtonTapped: { [weak self] in
194-
// Set the card as dismissed.
195-
self?.readerAnnouncementCoordinator.isDismissed = true
196-
WPAnalytics.track(.readerAnnouncementDismissed)
197-
198-
// Animate the header removal so it feels less jarring.
199-
UIView.animate(withDuration: 0.3) {
200-
self?.tableView.tableHeaderView?.layer.opacity = 0.0
201-
} completion: { _ in
202-
self?.tableView.performBatchUpdates({
203-
self?.tableView.tableHeaderView = nil
204-
})
205-
}
206-
})
207-
}
208-
209-
// The header may be configured when the content is still empty (i.e., Discover stream).
210-
// This method is added to provide a way to inject the announcement card outside of
211-
// `configureStreamHeader()`. For example, after syncing completes.
212-
func showAnnouncementHeaderIfNeeded(completion: (() -> Void)? = nil) {
213-
guard let headerView = makeAnnouncementHeader() else {
214-
return
215-
}
216-
217-
tableView.tableHeaderView = headerView
218-
completion?()
219-
}
220-
}
221-
222169
// MARK: - Tracks
223170
extension ReaderStreamViewController {
224171
func trackSavedListAccessed() {

WordPress/Classes/ViewRelated/Reader/ReaderStreamViewController.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,6 @@ import AutomatticTracks
218218
// We need to ensure that we only fetch the remote data once per tag to avoid the resultsController from refreshing the table view indefinitely.
219219
private var tagStreamSyncTracker = Set<String>()
220220

221-
/// Controls whether the Reader announcement card can be displayed.
222-
///
223-
let readerAnnouncementCoordinator = ReaderAnnouncementCoordinator()
224-
225221
lazy var selectInterestsViewController: ReaderSelectInterestsViewController = {
226222
let title = NSLocalizedString(
227223
"reader.select.tags.title",
@@ -480,8 +476,6 @@ import AutomatticTracks
480476
}
481477

482478
/// Fetches a tag topic for the value of the `tagSlug` property
483-
///
484-
// TODO: - READERNAV - Remove this when the new reader is released
485479
private func fetchTagTopic() {
486480
if isViewLoaded {
487481
displayLoadingStream()
@@ -1051,14 +1045,6 @@ import AutomatticTracks
10511045
}
10521046
strongSelf.updateLastSyncedForTopic(objectID)
10531047
}
1054-
1055-
// Show the announcement card if possible.
1056-
// Context: `configureStreamHeader()` may be called while the content is still empty.
1057-
// Calling it here manually ensures that we know whether the content is actually empty or not.
1058-
self?.showAnnouncementHeaderIfNeeded { [weak self] in
1059-
self?.refreshTableViewHeaderLayout()
1060-
}
1061-
10621048
success?(hasMore)
10631049
}
10641050
}

WordPress/WordPress.xcodeproj/project.pbxproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5675,8 +5675,6 @@
56755675
FE50965A2A17A69F00DDD071 /* TwitterDeprecationTableFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE5096582A17A69F00DDD071 /* TwitterDeprecationTableFooterView.swift */; };
56765676
FE50965C2A20D0F300DDD071 /* CommentTableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE50965B2A20D0F300DDD071 /* CommentTableHeaderView.swift */; };
56775677
FE50965D2A20D0F300DDD071 /* CommentTableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE50965B2A20D0F300DDD071 /* CommentTableHeaderView.swift */; };
5678-
FE59025F2BF2558300115D08 /* ReaderAnnouncementHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE59025E2BF2558300115D08 /* ReaderAnnouncementHeaderView.swift */; };
5679-
FE5902602BF3795600115D08 /* ReaderAnnouncementHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE59025E2BF2558300115D08 /* ReaderAnnouncementHeaderView.swift */; };
56805678
FE6AFE432B18EDF200F76520 /* BloganuaryTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE6AFE422B18EDF200F76520 /* BloganuaryTracker.swift */; };
56815679
FE6AFE442B18EDF200F76520 /* BloganuaryTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE6AFE422B18EDF200F76520 /* BloganuaryTracker.swift */; };
56825680
FE6AFE472B1A351F00F76520 /* SOTWCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE6AFE462B1A351F00F76520 /* SOTWCardView.swift */; };
@@ -9778,7 +9776,6 @@
97789776
FE5096572A13D5BA00DDD071 /* WordPress 149.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 149.xcdatamodel"; sourceTree = "<group>"; };
97799777
FE5096582A17A69F00DDD071 /* TwitterDeprecationTableFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TwitterDeprecationTableFooterView.swift; sourceTree = "<group>"; };
97809778
FE50965B2A20D0F300DDD071 /* CommentTableHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommentTableHeaderView.swift; sourceTree = "<group>"; };
9781-
FE59025E2BF2558300115D08 /* ReaderAnnouncementHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReaderAnnouncementHeaderView.swift; sourceTree = "<group>"; };
97829779
FE59DA9527D1FD0700624D26 /* WordPress 138.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 138.xcdatamodel"; sourceTree = "<group>"; };
97839780
FE5F52D82AF9461200371A3A /* WordPress 153.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 153.xcdatamodel"; sourceTree = "<group>"; };
97849781
FE6AFE422B18EDF200F76520 /* BloganuaryTracker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BloganuaryTracker.swift; sourceTree = "<group>"; };
@@ -17870,7 +17867,6 @@
1787017867
E6D2E16B1B8B423B0000ED14 /* ReaderStreamHeader.swift */,
1787117868
E6D2E1661B8AAD8C0000ED14 /* ReaderTagStreamHeader.swift */,
1787217869
E6D2E1601B8AA4410000ED14 /* ReaderTagStreamHeader.xib */,
17873-
FE59025E2BF2558300115D08 /* ReaderAnnouncementHeaderView.swift */,
1787417870
);
1787517871
name = Headers;
1787617872
sourceTree = "<group>";
@@ -22554,7 +22550,6 @@
2255422550
8BD66ED42787530C00CCD95A /* PostsCardViewModel.swift in Sources */,
2255522551
7E58879A20FE8D9300DB6F80 /* AppEnvironment.swift in Sources */,
2255622552
591232691CCEAA5100B86207 /* AbstractPostListViewController.swift in Sources */,
22557-
FE5902602BF3795600115D08 /* ReaderAnnouncementHeaderView.swift in Sources */,
2255822553
E14200781C117A2E00B3B115 /* ManagedAccountSettings.swift in Sources */,
2255922554
0C23F3362AC4AD3400EE6117 /* SiteMediaSelectionTitleView.swift in Sources */,
2256022555
401AC82722DD2387006D78D4 /* Blog+Plans.swift in Sources */,
@@ -25188,7 +25183,6 @@
2518825183
FABB231F2602FC2C00C8785C /* SignupUsernameTableViewController.swift in Sources */,
2518925184
FABB23202602FC2C00C8785C /* Blog+Editor.swift in Sources */,
2519025185
FABB23212602FC2C00C8785C /* ReaderCardService.swift in Sources */,
25191-
FE59025F2BF2558300115D08 /* ReaderAnnouncementHeaderView.swift in Sources */,
2519225186
FABB23222602FC2C00C8785C /* UITableViewCell+Stats.swift in Sources */,
2519325187
FABB23232602FC2C00C8785C /* Delay.swift in Sources */,
2519425188
FABB23242602FC2C00C8785C /* Pageable.swift in Sources */,

0 commit comments

Comments
 (0)