@protocol SearchViewDelegate<NSObject>
@optional
- (void)searchTextFieldDidBeginEditing;
- (void)onSearchTextFieldValueChanged:(NSString *)text;
@end
@interface SearchView()
@end
@implementation SearchView
typedef struct {
unsigned int searchTextFieldDidBeginEditing:1;
unsigned int onSearchTextFieldValueChanged:1;
} DelegateRespondsTo;
DelegateRespondsTo delegateRespondsTo;
- (void)setDelegate:(id <SearchViewDelegate>)aDelegate {
if (_delegate != aDelegate) {
_delegate = aDelegate;
delegateRespondsTo.searchTextFieldDidBeginEditing = [_delegate respondsToSelector:@selector(searchTextFieldDidBeginEditing)];
delegateRespondsTo.onSearchTextFieldValueChanged = [_delegate respondsToSelector:@selector(onSearchTextFieldValueChanged:)];
}
}