Skip to content

CoreSpotlight tvOS xcode14.0 rc

Israel Soto edited this page Sep 7, 2022 · 1 revision

#CoreSpotlight.framework

diff -ruN /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchQuery.h /Applications/Xcode_14.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchQuery.h
--- /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchQuery.h	2022-08-06 02:26:50.000000000 -0500
+++ /Applications/Xcode_14.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchQuery.h	2022-08-20 00:17:53.000000000 -0500
@@ -28,17 +28,8 @@
 API_AVAILABLE(macos(10.12), ios(10.0)) CS_TVOS_UNAVAILABLE
 @interface CSSearchQueryContext : NSObject<NSSecureCoding, NSCopying>
 
-
-#ifdef USE_SUGGESTIONS_API
-@property (nonatomic, strong) NSArray<NSFileProtectionType> *protectionClasses;
 @property (nonatomic, strong) NSArray<NSString *> *fetchAttributes;
 @property (nonatomic, copy) NSArray<NSString *> *filterQueries;
-#else
-@property (nullable, nonatomic, strong) NSArray<NSString *> *fetchAttributes;
-@property (nullable, nonatomic, strong) NSArray<NSString *> *protectionClasses;
-@property (nullable, nonatomic, copy) NSArray<NSString*>* filterQueries;
-#endif
-
 @property (nullable, nonatomic, strong) NSString *keyboardLanguage;
 
 @property (nonatomic, assign) CSSearchQuerySourceOptions sourceOptions API_AVAILABLE(macos(13));
@@ -50,7 +41,7 @@
 - (instancetype)init NS_UNAVAILABLE;
 
 // queryString: The query string (e.g., 'contentType == "public.email-message" && subject != "Re:*"')
-- (instancetype)initWithQueryString:(NSString * _Nonnull)queryString queryContext:(CSSearchQueryContext *)queryContext NS_DESIGNATED_INITIALIZER API_AVAILABLE(macos(10.13), ios(16.0)) CS_TVOS_UNAVAILABLE;
+- (instancetype)initWithQueryString:(NSString * _Nonnull)queryString queryContext:(CSSearchQueryContext * _Nullable)queryContext NS_DESIGNATED_INITIALIZER API_AVAILABLE(macos(10.13), ios(16.0)) CS_TVOS_UNAVAILABLE;
 
 // queryString: The query string (e.g., 'contentType == "public.email-message" && subject != "Re:*"')
 // attributes: The attributes to be fetched for the searchable items
diff -ruN /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItem.h /Applications/Xcode_14.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItem.h
--- /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItem.h	2022-08-06 02:26:50.000000000 -0500
+++ /Applications/Xcode_14.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItem.h	2022-08-20 00:17:53.000000000 -0500
@@ -42,6 +42,9 @@
                         domainIdentifier:(nullable NSString *)domainIdentifier
                             attributeSet:(CSSearchableItemAttributeSet *)attributeSet;
 
+// For comparison of items ranked by the query
+- (NSComparisonResult)compareByRank:(CSSearchableItem *)other API_AVAILABLE(macos(10.13), ios(16.0)) CS_TVOS_UNAVAILABLE;
+
 // Should be unique to your application group.
 // REQUIRED since this is the way you will refer to the item to update the index / delete it from the index
 // Starts with an UUID for ease of use, but you can replace it with an UID of your own before the item is first indexed if you wish.
diff -ruN /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSuggestion.h /Applications/Xcode_14.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSuggestion.h
--- /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSuggestion.h	2022-08-06 02:26:50.000000000 -0500
+++ /Applications/Xcode_14.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSuggestion.h	2022-08-20 00:17:53.000000000 -0500
@@ -24,6 +24,9 @@
 @property (nonnull, nonatomic, readonly) NSAttributedString *localizedAttributedSuggestion NS_REFINED_FOR_SWIFT;
 @property (nonatomic, readonly) CSSuggestionKind suggestionKind;
 
+// For suggestions that have been ranked by the query
+- (NSComparisonResult)compareByRank:(CSSuggestion *)other;
+
 - (NSComparisonResult)compare:(CSSuggestion *)other;
 
 @end
diff -ruN /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSUserQuery.h /Applications/Xcode_14.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSUserQuery.h
--- /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSUserQuery.h	2022-08-06 02:26:49.000000000 -0500
+++ /Applications/Xcode_14.0.0-rc.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSUserQuery.h	2022-08-20 00:17:52.000000000 -0500
@@ -10,14 +10,18 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-/****************    User Query    ****************/
-
 API_AVAILABLE(macos(10.13), ios(16.0)) CS_TVOS_UNAVAILABLE
 @interface CSUserQueryContext : CSSearchQueryContext
 
 + (CSUserQueryContext *)userQueryContext;
 + (CSUserQueryContext *)userQueryContextWithCurrentSuggestion:(CSSuggestion * _Nullable)currentSuggestion;
 
+@property (nonatomic, assign) BOOL enableRankedResults;
+
+// maxResultCount is maximum number of search results to retrieve. (defaults to 0)
+// If maxResultCount == 0, Spotlight will retrieve all results related to query. (committed search)
+@property (nonatomic, assign) NSInteger maxResultCount;
+// maxSuggestionCount is maximum number of suggestion results to retrieve. (defaults to 0)
 @property (nonatomic, assign) NSInteger maxSuggestionCount;
 
 @end
@@ -25,7 +29,7 @@
 API_AVAILABLE(macos(10.13), ios(16.0)) CS_TVOS_UNAVAILABLE
 @interface CSUserQuery : CSSearchQuery
 
-- (instancetype)initWithUserQueryString:(NSString * _Nullable)userQueryString queryContext:(CSUserQueryContext *)queryContext NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithUserQueryString:(NSString * _Nullable)userQueryString userQueryContext:(CSUserQueryContext * _Nullable)userQueryContext NS_DESIGNATED_INITIALIZER;
 
 // The query will update the count before each foundSuggestionsHandler invocation to reflect
 // the number of suggestions found so far; if foundSuggestionsHandler is nil then the count will be zero.
@@ -40,22 +44,4 @@
 
 @end
 
-/****************    Top Hit Query    ****************/
-
-API_AVAILABLE(macos(10.13), ios(16.0)) CS_TVOS_UNAVAILABLE
-@interface CSTopHitQueryContext : CSUserQueryContext
-
-+ (CSTopHitQueryContext *)topHitQueryContext;
-+ (CSTopHitQueryContext *)topHitQueryContextWithCurrentSuggestion:(CSSuggestion * _Nullable)currentSuggestion;
-
-@property (nonatomic, assign) NSInteger maxItemCount;
-
-@end
-
-API_AVAILABLE(macos(10.13), ios(16.0)) CS_TVOS_UNAVAILABLE
-@interface CSTopHitQuery : CSUserQuery
-
-- (instancetype)initWithUserQueryString:(NSString * _Nullable)userQueryString queryContext:(CSTopHitQueryContext *)queryContext NS_DESIGNATED_INITIALIZER;
-
-@end
 NS_ASSUME_NONNULL_END
Clone this wiki locally