Skip to content

Commit 2020110

Browse files
authored
Merge pull request #19769 from wordpress-mobile/enhancement/reader-scroll-to-top
[Reader] Scroll to the top if the tab bar button is tapped
2 parents 88ebfc6 + 8d4f760 commit 2020110

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* [***] You can now migrate your site content to the Jetpack app without a hitch. [#19759]
77
* [**] [internal] Upgrade React Native from 0.66.2 to 0.69.4 [https://github.com/wordpress-mobile/gutenberg-mobile/pull/5193]
88
* [*] [internal] When a user migrates to the Jetpack app and allows notifications, WordPress app notifications are disabled. [#19616, #19611, #19590]
9+
* [*] Reader now scrolls to the top if the tab bar button is tapped. [#19769]
910

1011
21.3
1112
-----

WordPress/Classes/ViewRelated/Reader/Tab Navigation/ReaderTabViewController.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,14 @@ extension ReaderTabViewController {
198198
static let spotlightOffset = UIOffset(horizontal: 20, vertical: -10)
199199
}
200200
}
201+
202+
// MARK: - WPScrollableViewController conformance
203+
extension ReaderTabViewController: WPScrollableViewController {
204+
/// Scrolls the first child VC to the top if it's a `ReaderStreamViewController`.
205+
func scrollViewToTop() {
206+
guard let readerStreamVC = children.first as? ReaderStreamViewController else {
207+
return
208+
}
209+
readerStreamVC.scrollViewToTop()
210+
}
211+
}

0 commit comments

Comments
 (0)