From 2c4531f481b9c8e41f49bf84356839c34582e292 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 2 Sep 2019 15:14:26 -0500 Subject: [PATCH] Add the Add scene as a home page quick action. --- iOS/AppDelegate.swift | 6 +++++- iOS/SceneDelegate.swift | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index 46d947a7b..7efd477d5 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -206,7 +206,11 @@ private extension AppDelegate { let searchIcon = UIApplicationShortcutIcon(systemImageName: "magnifyingglass") let searchItem = UIApplicationShortcutItem(type: "com.ranchero.NetNewsWire.ShowSearch", localizedTitle: searchTitle, localizedSubtitle: nil, icon: searchIcon, userInfo: nil) - UIApplication.shared.shortcutItems = [searchItem, unreadItem] + let addTitle = NSLocalizedString("Add", comment: "Add") + let addIcon = UIApplicationShortcutIcon(systemImageName: "plus") + let addItem = UIApplicationShortcutItem(type: "com.ranchero.NetNewsWire.ShowAdd", localizedTitle: addTitle, localizedSubtitle: nil, icon: addIcon, userInfo: nil) + + UIApplication.shared.shortcutItems = [addItem, searchItem, unreadItem] } } diff --git a/iOS/SceneDelegate.swift b/iOS/SceneDelegate.swift index 3e476b931..03e7cab9a 100644 --- a/iOS/SceneDelegate.swift +++ b/iOS/SceneDelegate.swift @@ -64,6 +64,8 @@ private extension SceneDelegate { coordinator.selectFirstUnreadInAllUnread() case "com.ranchero.NetNewsWire.ShowSearch": coordinator.showSearch() + case "com.ranchero.NetNewsWire.ShowAdd": + coordinator.showAdd() default: break }