AI-generated Key Takeaways
-
UI delegates can be used for customization and monitoring.
-
A
SearchContentClickNotificationDelegate
can be implemented to respond to UI click actions, allowing you to define custom behavior when search content is clicked. -
Sample code snippets in Swift and Objective-C demonstrate how to implement and set up the
SearchContentClickNotificationDelegate
.
We provide a list of UI delegates for customization and monitoring purposes.
Click action notification delegate
You can pass in a delegate instance
(SearchContentClickNotificationDelegate
) to respond to the
UI click action.
Swift
...
class PartnerSearchContentClickNotificationDelegate: SearchContentClickNotificationDelegate {
func searchContentClicked(clickProperties: SearchContentClickProperties) {
...
}
}
...
let delegate: PartnerSearchContentClickNotificationDelegate? = PartnerSearchContentClickNotificationDelegate()
...
let customizationOptions = SearchSuggestionsViewOptions()
customizationOptions.clickNotificationDelegate = delegate
...
Objective-C
/// In the .h header file.
#import "googlemac/iPhone/Shared/SearchInApps/SDK/SourcesLib-Swift.h"
...
@interface PartnerSearchContentClickNotificationDelegate: NSObject<SearchContentClickNotificationDelegate>
@end
/// In the .m file.
#import "googlemac/iPhone/Shared/SearchInApps/SDK/SourcesLib-Swift.h"
...
@interface PartnerSearchContentClickNotificationDelegate () <SearchContentClickNotificationDelegate>
@end
@implementation PartnerSearchContentClickNotificationDelegate
- (void)searchContentClickedWithClickProperties: (SearchContentClickProperties *) properties
{
...
}
@end
...
PartnerSearchContentClickNotificationDelegate *_partnerSearchContentClickNotificationDelegate = [[PartnerSearchContentClickNotificationDelegate alloc] init];
...
SearchSuggestionsViewOptions *customizationOptions = [[SearchSuggestionsViewOptions alloc] init];
customizationOptions.clickNotificationDelegate = _partnerSearchContentClickNotificationDelegate;
...