Skip to content

CoreSpotlight iOS xcode14.0 beta5

tj_devel709 edited this page Aug 18, 2022 · 3 revisions

#CoreSpotlight.framework https://github.com/xamarin/xamarin-macios/pull/15701

diff -ruN /Applications/Xcode_14.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchQuery.h /Applications/Xcode_14.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchQuery.h
--- /Applications/Xcode_14.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchQuery.h	2022-07-25 15:36:26.000000000 -0400
+++ /Applications/Xcode_14.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchQuery.h	2022-08-05 16:55:39.000000000 -0400
@@ -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-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItem.h /Applications/Xcode_14.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItem.h
--- /Applications/Xcode_14.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItem.h	2022-07-25 15:36:26.000000000 -0400
+++ /Applications/Xcode_14.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItem.h	2022-08-05 16:55:39.000000000 -0400
@@ -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-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSuggestion.h /Applications/Xcode_14.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSuggestion.h
--- /Applications/Xcode_14.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSuggestion.h	2022-07-25 15:36:26.000000000 -0400
+++ /Applications/Xcode_14.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSuggestion.h	2022-08-05 16:55:40.000000000 -0400
@@ -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-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSUserQuery.h /Applications/Xcode_14.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSUserQuery.h
--- /Applications/Xcode_14.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSUserQuery.h	2022-07-25 15:36:26.000000000 -0400
+++ /Applications/Xcode_14.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSUserQuery.h	2022-08-05 16:55:39.000000000 -0400
@@ -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