diff --git a/GovUK.xcodeproj/project.pbxproj b/GovUK.xcodeproj/project.pbxproj index e840d303..20d146b8 100644 --- a/GovUK.xcodeproj/project.pbxproj +++ b/GovUK.xcodeproj/project.pbxproj @@ -26,6 +26,7 @@ 16D0D0432CC6819C00944D79 /* TopicTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D0D0422CC6818D00944D79 /* TopicTableViewCell.swift */; }; 16D17D422CC01C7600E99794 /* TopicRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D17D412CC01C6A00E99794 /* TopicRowView.swift */; }; 16E5AD432C6D5719000B8B3A /* SearchWidgetStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16E5AD422C6D5719000B8B3A /* SearchWidgetStackView.swift */; }; + 16E8794C2D2D875D00BCC0FC /* RecentActivitySection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16E8794B2D2D875C00BCC0FC /* RecentActivitySection.swift */; }; 16EE1A412C6F8968005E820F /* SearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16EE1A402C6F8968005E820F /* SearchViewController.swift */; }; 16EE1A432C6F89D9005E820F /* SearchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16EE1A422C6F89D9005E820F /* SearchViewModel.swift */; }; 16EE1A452C6F8ED3005E820F /* SearchCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16EE1A442C6F8ED3005E820F /* SearchCoordinator.swift */; }; @@ -283,6 +284,7 @@ 16D0D0422CC6818D00944D79 /* TopicTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopicTableViewCell.swift; sourceTree = ""; }; 16D17D412CC01C6A00E99794 /* TopicRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopicRowView.swift; sourceTree = ""; }; 16E5AD422C6D5719000B8B3A /* SearchWidgetStackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchWidgetStackView.swift; sourceTree = ""; }; + 16E8794B2D2D875C00BCC0FC /* RecentActivitySection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentActivitySection.swift; sourceTree = ""; }; 16EE1A402C6F8968005E820F /* SearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchViewController.swift; sourceTree = ""; }; 16EE1A422C6F89D9005E820F /* SearchViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchViewModel.swift; sourceTree = ""; }; 16EE1A442C6F8ED3005E820F /* SearchCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchCoordinator.swift; sourceTree = ""; }; @@ -715,6 +717,7 @@ 5DE2834D2CAC48DC00E95800 /* ActivityItemCreateParams.swift */, 5DCDA0FE2CA20C2C00A6DF90 /* MonthGroupKey.swift */, 4E94E8D82C8B18ED00906803 /* RecentActivitiesViewStructure.swift */, + 16E8794B2D2D875C00BCC0FC /* RecentActivitySection.swift */, ); path = RecentActivity; sourceTree = ""; @@ -1595,6 +1598,7 @@ 5DCDA0FF2CA20C2C00A6DF90 /* MonthGroupKey.swift in Sources */, 5DE970572C297CFE009D66C4 /* AppEvent+Convenience.swift in Sources */, 5D0A81292CEDCD0300446F63 /* UserProperty.swift in Sources */, + 16E8794C2D2D875D00BCC0FC /* RecentActivitySection.swift in Sources */, 160A02682C208B9800FE01EB /* AnalyticsService.swift in Sources */, 5D02783C2C29D9BB00F2A4EB /* LaunchViewModel.swift in Sources */, 5DC069ED2C3BFD6400A81AAE /* AccessibilityManager.swift in Sources */, diff --git a/Production/govuk_ios/Model/RecentActivity/RecentActivitySection.swift b/Production/govuk_ios/Model/RecentActivity/RecentActivitySection.swift new file mode 100644 index 00000000..8949cbeb --- /dev/null +++ b/Production/govuk_ios/Model/RecentActivity/RecentActivitySection.swift @@ -0,0 +1,6 @@ +import Foundation + +struct RecentActivitySection: Hashable { + let title: String + let items: [ActivityItem] +} diff --git a/Production/govuk_ios/Resources/Strings/RecentActivity.xcstrings b/Production/govuk_ios/Resources/Strings/RecentActivity.xcstrings index 7b0af5ae..a6d8d320 100644 --- a/Production/govuk_ios/Resources/Strings/RecentActivity.xcstrings +++ b/Production/govuk_ios/Resources/Strings/RecentActivity.xcstrings @@ -12,6 +12,28 @@ } } }, + "doneButtonAccessibilityTitle" : { + "extractionState" : "manual", + "localizations" : { + "en-GB" : { + "stringUnit" : { + "state" : "translated", + "value" : "Finish editing pages you've visited" + } + } + } + }, + "editButtonAccessibilityTitle" : { + "extractionState" : "manual", + "localizations" : { + "en-GB" : { + "stringUnit" : { + "state" : "translated", + "value" : "Edit pages you’ve visited" + } + } + } + }, "recentActivitiesTodaysListTitle" : { "extractionState" : "manual", "localizations" : { diff --git a/Production/govuk_ios/ViewControllers/RecentActivityListViewController.swift b/Production/govuk_ios/ViewControllers/RecentActivityListViewController.swift index 3f7b32c9..7abc5221 100644 --- a/Production/govuk_ios/ViewControllers/RecentActivityListViewController.swift +++ b/Production/govuk_ios/ViewControllers/RecentActivityListViewController.swift @@ -1,3 +1,4 @@ +// swiftlint:disable file_length import Foundation import UIKit @@ -141,6 +142,7 @@ class RecentActivityListViewController: BaseViewController { informationScrollView.addSubview(informationView) removeBarButtonItem.isEnabled = false configureToolbarItems() + setEditButtonAccessibilityLabel() } private func configureConstraints() { @@ -234,6 +236,12 @@ class RecentActivityListViewController: BaseViewController { ]) } + private func setEditButtonAccessibilityLabel() { + editButtonItem.accessibilityLabel = String.recentActivity.localized( + "editButtonAccessibilityTitle" + ) + } + override func setEditing(_ editing: Bool, animated: Bool) { // Needs to be before super to get correct values trackEditingEvent() @@ -242,8 +250,16 @@ class RecentActivityListViewController: BaseViewController { configureToolbarItems(animated: false) self.tabBarController?.tabBar.isHidden = editing editingToolbar.isHidden = !editing + if !editing { + editButtonItem.accessibilityLabel = String.recentActivity.localized( + "editButtonAccessibilityTitle" + ) viewModel.endEditing() + } else { + editButtonItem.accessibilityLabel = String.recentActivity.localized( + "doneButtonAccessibilityTitle" + ) } } @@ -390,8 +406,4 @@ extension RecentActivityListViewController: TrackableScreen { viewModel.pageTitle } } - -struct RecentActivitySection: Hashable { - let title: String - let items: [ActivityItem] -} +// swiftlint:enable file_length