mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Fix for scroll indicators on iOS when using Dark Mode
This commit is contained in:
@@ -82,6 +82,28 @@ class WebViewController: UIViewController {
|
||||
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
updateScrollIndicatorStyle()
|
||||
}
|
||||
|
||||
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
|
||||
updateScrollIndicatorStyle()
|
||||
}
|
||||
|
||||
|
||||
// See https://shadowfacts.net/2022/wkwebview-scroll-indicators-again/ for why this is necessary.
|
||||
private func updateScrollIndicatorStyle() {
|
||||
guard #available(iOS 15.4, *) else {
|
||||
return
|
||||
}
|
||||
|
||||
if traitCollection.userInterfaceStyle == .dark {
|
||||
webView?.scrollView.indicatorStyle = .white
|
||||
} else {
|
||||
webView?.scrollView.indicatorStyle = .black
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Notifications
|
||||
|
||||
@objc func webFeedIconDidBecomeAvailable(_ note: Notification) {
|
||||
|
||||
Reference in New Issue
Block a user