diff --git a/iOS/AppDefaults.swift b/iOS/AppDefaults.swift index f7b153aaf..418d16877 100644 --- a/iOS/AppDefaults.swift +++ b/iOS/AppDefaults.swift @@ -273,6 +273,7 @@ final class AppDefaults: ObservableObject { } set { AppDefaults.setBool(for: Key.markArticlesAsReadOnScroll, newValue) + AppDefaults.shared.objectWillChange.send() } } diff --git a/iOS/Settings/Appearance/DisplayAndBehaviorsView.swift b/iOS/Settings/Appearance/DisplayAndBehaviorsView.swift index b4eb40972..1fed884ea 100644 --- a/iOS/Settings/Appearance/DisplayAndBehaviorsView.swift +++ b/iOS/Settings/Appearance/DisplayAndBehaviorsView.swift @@ -22,6 +22,7 @@ struct DisplayAndBehaviorsView: View { Section(header: Text("Timeline", comment: "Display & Behaviours: Timeline section header")) { SettingsViewRows.sortOldestToNewest($appDefaults.timelineSortDirectionBool) SettingsViewRows.groupByFeed($appDefaults.timelineGroupByFeed) + SettingsViewRows.markAsReadOnScroll($appDefaults.markArticlesAsReadOnScroll) SettingsViewRows.refreshToClearReadArticles($appDefaults.refreshClearsReadArticles) SettingsViewRows.timelineLayout } diff --git a/iOS/Settings/General/SettingsRows.swift b/iOS/Settings/General/SettingsRows.swift index 44def8f62..18c335a6b 100644 --- a/iOS/Settings/General/SettingsRows.swift +++ b/iOS/Settings/General/SettingsRows.swift @@ -61,6 +61,16 @@ struct SettingsViewRows { } } + + /// Toggle for determining if articles are marked as read when scrolling the timeline view. + /// - Parameter preference: `Binding` + /// - Returns: `some View` + static func markAsReadOnScroll(_ preference: Binding) -> some View { + Toggle(isOn: preference) { + Text("Mark As Read on Scroll", comment: "Mark As Read on Scroll") + } + } + /// This row, when tapped, will push the the Manage Extension screen /// in to view. static var manageExtensions: some View {