AI-generated Key Takeaways
-
SearchSuggestionsViewController simplifies the integration of SearchSuggestionsView into UIKit applications.
-
It allows for customization of the search suggestions view through the
customizationOptionsproperty. -
Developers can readily access the underlying UIView via the
viewproperty for layout and integration purposes. -
The
searchSuggestionsproperty is used to populate and display search suggestions within the view. -
Integration involves initializing SearchSuggestionsViewController, adding it to the parent view controller, and assigning search suggestions data.
SearchSuggestionsViewController
@interface SearchSuggestionsViewController : NSObjectA class to make it easier to use the SearchSuggestionsView in UIKit applications. The way this is to be included in a UIViewController is to:
-
Create an instance of a SearchSuggestionsViewController with a specified customization option
_searchSuggestionsViewController = [[SearchSuggestionsViewController alloc] initWithCustomizationOption: [[SearchSuggestionsViewCustomizationOption alloc] init]]; -
Add this to the view controller
[_searchSuggestionsViewController addToViewController:self]; -
Add its view to the parent view
[self.view addSubview:_searchSuggestionsViewController.view]; -
Assign search suggestions to it to render those search suggestions.
dispatch_async(dispatch_get_main_queue(), ^{ _searchSuggestionsViewController.searchSuggestions = _searchSuggestions; }
-
The customization options of the search suggestions view.
Declaration
Objective-C
@property (nonatomic, strong) SearchSuggestionsViewOptions *_Nonnull customizationOptions; -
The UIView of the search suggestions which is converted from the hostingController’s SwiftUI rootview.
Declaration
Objective-C
@property (nonatomic, strong, readonly) UIView *_Nonnull view; -
The search suggestions used to generate the UI.
Declaration
Objective-C
@property (nonatomic, strong) SearchSuggestions *_Nullable searchSuggestions; -
Undocumented
Declaration
Objective-C
- (nonnull instancetype)initWithOptions:(SearchSuggestionsViewOptions * _Nonnull)options OBJC_DESIGNATED_INITIALIZER; -
Undocumented
Declaration
Objective-C
- (void)addToViewController:(UIViewController * _Nonnull)controller; -
Unavailable
Undocumented
Declaration
Objective-C
- (nonnull instancetype)init SWIFT_UNAVAILABLE; -
Unavailable
-init is unavailable
Undocumented
Declaration
Objective-C
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");