From b94f63b94b726371e7a06f55a0a9681f209edfae Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Wed, 24 Feb 2021 22:33:27 -0800 Subject: [PATCH] New items indicator improvements --- Localizations/Localizable.strings | 1 + View Controllers/TableViewController.swift | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Localizations/Localizable.strings b/Localizations/Localizable.strings index bbfd3da..dfcfca3 100644 --- a/Localizations/Localizable.strings +++ b/Localizations/Localizable.strings @@ -108,6 +108,7 @@ "compose-button.accessibility-label.post" = "Compose Post"; "compose-button.accessibility-label.toot" = "Compose Toot"; "conversation.unread" = "Unread"; +"dismiss" = "Dismiss"; "emoji.custom" = "Custom"; "emoji.default-skin-tone" = "Default skin tone"; "emoji.default-skin-tone-button.accessibility-label" = "Select default skin tone"; diff --git a/View Controllers/TableViewController.swift b/View Controllers/TableViewController.swift index 45da44c..0f4ccb2 100644 --- a/View Controllers/TableViewController.swift +++ b/View Controllers/TableViewController.swift @@ -90,6 +90,11 @@ class TableViewController: UITableViewController { self?.hideNewItemsView() }, for: .touchUpInside) + newItemsView.button.accessibilityCustomActions = [ + UIAccessibilityCustomAction(name: NSLocalizedString("dismiss", comment: "")) { [weak self] _ in + self?.hideNewItemsView() + return true + }] setupViewModelBindings() @@ -111,7 +116,7 @@ class TableViewController: UITableViewController { loadMoreView.directionChanged(up: up) } - if up, newItemsView.alpha > 0 { + if newItemsView.alpha > 0 { hideNewItemsView() } }