cdts/xdts-ios 3/TreeHole/Code/Gategory/BRPickerView/StringPickerView/BRResultModel.m

42 lines
1001 B
Mathematica
Raw Permalink Normal View History

2023-07-27 09:20:00 +08:00
//
// BRResultModel.m
// BRPickerViewDemo
//
// Created by renbo on 2019/10/2.
// Copyright © 2019 irenb. All rights reserved.
//
// https://github.com/91renb/BRPickerView
#import "BRResultModel.h"
@implementation BRResultModel
///
/// @param object
- (BOOL)isEqual:(id)object {
// 1.
if (self == object) {
return YES;
}
if (![object isKindOfClass:[BRResultModel class]]) {
return NO;
}
BRResultModel *model = (BRResultModel *)object;
if (!model) {
return NO;
}
// 2.
BOOL isSameKey = (!self.key && !model.key) || [self.key isEqualToString:model.key];
BOOL isSameValue = (!self.value && !model.value) || [self.value isEqualToString:model.value];
return isSameKey && isSameValue;
}
- (NSUInteger)hash {
return [self.key hash] ^ [self.value hash];
}
@end