Skip to content

Commit 1554d3e

Browse files
authored
Merge pull request #17863 from wordpress-mobile/task/msd-remove-blog-details-table-header-view
My Site Dashboard: Remove table header view from BlogDetailsViewController
2 parents db1bea7 + f6b6828 commit 1554d3e

File tree

5 files changed

+40
-405
lines changed

5 files changed

+40
-405
lines changed

WordPress/Classes/Extensions/UIScrollView+Helpers.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ extension UIScrollView {
2121
height: safeAreaLayoutGuide.layoutFrame.height)
2222
scrollRectToVisible(targetRect, animated: animated)
2323
} else {
24-
scrollToBottom()
24+
scrollToBottom(animated: true)
2525
}
2626

2727
// This ensures scrolling to the correct position, especially when there are layout changes
@@ -32,10 +32,15 @@ extension UIScrollView {
3232
}
3333
}
3434

35-
@objc func scrollToBottom() {
35+
@objc func scrollToTop(animated: Bool) {
36+
let topOffset = CGPoint(x: 0, y: -adjustedContentInset.top)
37+
setContentOffset(topOffset, animated: animated)
38+
}
39+
40+
@objc func scrollToBottom(animated: Bool) {
3641
let bottomOffset = CGPoint(x: 0, y: contentSize.height - bounds.size.height + adjustedContentInset.bottom)
3742
if bottomOffset.y > 0 {
38-
setContentOffset(bottomOffset, animated: true)
43+
setContentOffset(bottomOffset, animated: animated)
3944
}
4045
}
4146

WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController+FancyAlerts.swift

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,18 @@ extension BlogDetailsViewController {
1212
guard self?.blog.managedObjectContext != nil else {
1313
return
1414
}
15-
self?.toggleSpotlightForSiteTitle()
16-
self?.refreshSiteIcon()
1715
self?.configureTableViewData()
1816
self?.reloadTableViewPreservingSelection()
1917

2018
if let info = notification.userInfo?[QuickStartTourGuide.notificationElementKey] as? QuickStartTourElement {
2119
switch info {
2220
case .noSuchElement:
23-
if FeatureFlag.mySiteDashboard.enabled,
24-
let parentVC = self?.parent as? MySiteViewController {
25-
parentVC.additionalSafeAreaInsets = .zero
26-
} else {
27-
self?.additionalSafeAreaInsets = .zero
21+
guard let parentVC = self?.parent as? MySiteViewController else {
22+
return
2823
}
2924

25+
parentVC.additionalSafeAreaInsets = .zero
26+
3027
case .siteIcon, .siteTitle:
3128
// handles the padding in case the element is not in the table view
3229
self?.additionalSafeAreaInsets = UIEdgeInsets(top: 0, left: 0, bottom: BlogDetailsViewController.bottomPaddingForQuickStartNotices, right: 0)
@@ -115,9 +112,7 @@ extension BlogDetailsViewController {
115112
private func showQuickStart(with type: QuickStartType) {
116113
let checklist = QuickStartChecklistViewController(blog: blog, type: type)
117114
let navigationViewController = UINavigationController(rootViewController: checklist)
118-
present(navigationViewController, animated: true) { [weak self] in
119-
self?.toggleSpotlightOnHeaderView()
120-
}
115+
present(navigationViewController, animated: true)
121116

122117
QuickStartTourGuide.shared.visited(.checklist)
123118

0 commit comments

Comments
 (0)