From ffc364f7cfff6b88611c330d1f4d741c3b1b491f Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 29 Apr 2019 06:01:53 -0500 Subject: [PATCH] Change to have mark as read be the default action on timeline swiping instead of starred --- .../MasterTimelineViewController.swift | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index 8b69139db..5070e23df 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -126,23 +126,6 @@ class MasterTimelineViewController: ProgressTableViewController, UndoableCommand return nil } - // Set up the star action - let starTitle = article.status.starred ? - NSLocalizedString("Unstar", comment: "Unstar") : - NSLocalizedString("Star", comment: "Star") - - let starAction = UIContextualAction(style: .normal, title: starTitle) { [weak self] (action, view, completionHandler) in - guard let undoManager = self?.undoManager, - let markReadCommand = MarkStatusCommand(initialArticles: [article], markingStarred: !article.status.starred, undoManager: undoManager) else { - return - } - self?.runCommand(markReadCommand) - completionHandler(true) - } - - starAction.image = AppAssets.starClosedImage - starAction.backgroundColor = AppAssets.starColor - // Set up the read action let readTitle = article.status.read ? NSLocalizedString("Unread", comment: "Unread") : @@ -160,7 +143,24 @@ class MasterTimelineViewController: ProgressTableViewController, UndoableCommand readAction.image = AppAssets.circleClosedImage readAction.backgroundColor = AppAssets.timelineUnreadCircleColor - let configuration = UISwipeActionsConfiguration(actions: [starAction, readAction]) + // Set up the star action + let starTitle = article.status.starred ? + NSLocalizedString("Unstar", comment: "Unstar") : + NSLocalizedString("Star", comment: "Star") + + let starAction = UIContextualAction(style: .normal, title: starTitle) { [weak self] (action, view, completionHandler) in + guard let undoManager = self?.undoManager, + let markReadCommand = MarkStatusCommand(initialArticles: [article], markingStarred: !article.status.starred, undoManager: undoManager) else { + return + } + self?.runCommand(markReadCommand) + completionHandler(true) + } + + starAction.image = AppAssets.starClosedImage + starAction.backgroundColor = AppAssets.starColor + + let configuration = UISwipeActionsConfiguration(actions: [readAction, starAction]) return configuration }