2019-12-19 17:32:49 +00:00
|
|
|
/*
|
2023-04-06 09:44:16 +00:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2019-12-19 17:32:49 +00:00
|
|
|
*
|
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2017-02-21 00:11:56 +00:00
|
|
|
*/
|
|
|
|
|
|
2017-04-07 18:20:37 +00:00
|
|
|
#import "Post.h"
|
2017-02-21 00:11:56 +00:00
|
|
|
|
2017-04-07 18:20:37 +00:00
|
|
|
@implementation Post
|
2017-02-21 00:11:56 +00:00
|
|
|
|
2017-04-07 18:20:37 +00:00
|
|
|
- (instancetype)initWithUsername:(NSString *)username
|
|
|
|
|
comments:(NSArray<NSString *> *)comments {
|
2017-02-21 00:11:56 +00:00
|
|
|
if (self = [super init]) {
|
2017-04-07 18:20:37 +00:00
|
|
|
_username = [username copy];
|
|
|
|
|
_comments = [comments copy];
|
2017-02-21 00:11:56 +00:00
|
|
|
}
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma mark - IGListDiffable
|
|
|
|
|
|
2017-04-07 18:20:37 +00:00
|
|
|
- (id<NSObject>)diffIdentifier {
|
2017-02-21 00:11:56 +00:00
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-07 18:20:37 +00:00
|
|
|
- (BOOL)isEqualToDiffableObject:(id)object {
|
|
|
|
|
// since the diff identifier returns self, object should only be compared with same instance
|
|
|
|
|
return self == object;
|
2017-02-21 00:11:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|