From 2936922269b52cadbcd1ce1c9e4e8f432fffbb72 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 22 Nov 2024 21:05:58 -0800 Subject: [PATCH] Fix some deprecation warnings. --- Mac/AppDelegate.swift | 2 +- Shared/Activity/ActivityManager.swift | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index 463b59c12..b32d49f9d 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -476,7 +476,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, // MARK: UNUserNotificationCenterDelegate func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { - completionHandler([.alert, .badge, .sound]) + completionHandler([.banner, .badge, .sound]) } func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { diff --git a/Shared/Activity/ActivityManager.swift b/Shared/Activity/ActivityManager.swift index 624bc4a30..f2d1a9c85 100644 --- a/Shared/Activity/ActivityManager.swift +++ b/Shared/Activity/ActivityManager.swift @@ -13,6 +13,7 @@ import RSCore import Account import Articles import Intents +import UniformTypeIdentifiers class ActivityManager { @@ -246,7 +247,7 @@ private extension ActivityManager { func updateSelectingActivityFeedSearchAttributes(with feed: WebFeed) { - let attributeSet = CSSearchableItemAttributeSet(itemContentType: kUTTypeItem as String) + let attributeSet = CSSearchableItemAttributeSet(contentType: UTType.compositeContent) attributeSet.title = feed.nameForDisplay attributeSet.keywords = makeKeywords(feed.nameForDisplay) attributeSet.relatedUniqueIdentifier = ActivityManager.identifier(for: feed) @@ -265,7 +266,7 @@ private extension ActivityManager { // itself because the relatedUniqueIdentifier on the activity attributeset is populated. if let attributeSet = activity.contentAttributeSet { let identifier = attributeSet.relatedUniqueIdentifier - let tempAttributeSet = CSSearchableItemAttributeSet(itemContentType: kUTTypeItem as String) + let tempAttributeSet = CSSearchableItemAttributeSet(contentType: UTType.item) let searchableItem = CSSearchableItem(uniqueIdentifier: identifier, domainIdentifier: nil, attributeSet: tempAttributeSet) CSSearchableIndex.default().indexSearchableItems([searchableItem]) }