I'm trying to figure out how I'm suppose to work with this API on UIFindSession:
- (void)performSearchWithQuery:(NSString *)query options:(nullable UITextSearchOptions *)options;
I want to provide a UITextSearchOptions object, but the properties are readonly so I'm not sure what purpose it serves exposing it in the public API?
@interface UITextSearchOptions : NSObject
/// See UITextSearchMatchMethod above.
@property (nonatomic, readonly) UITextSearchMatchMethod wordMatchMethod;
/// Comparison options to use when searching for strings.
@property (nonatomic, readonly) NSStringCompareOptions stringCompareOptions;
@end
So I can't simply invoke a search like this...which would've really been nice...
UIFindSession *session = findInterfaction.activeFindSession;
UITextSearchOptions *searchOptions = [[UITextSearchOptions alloc]init];
searchOptions.stringCompareOptions = NSCaseInsensitiveSearch; //readonly can't...
[session performSearchWithQuery:searchString options:searchOptions];
There is this API:
/// available in @c UITextSearchOptions, which can be either modified, augmented, or omitted.
@property (nonatomic, readwrite, copy, nullable) UIMenu *_Nullable (^optionsMenuProvider)(NSArray<UIMenuElement *> *defaultOptions);
So I can remove menu items that edit the UITextSearchOptions but how exactly do I "override" them for my needs?