1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-04 10:27:46 +01:00
Telegram/Watch/Extension/TGIndexPath.m

38 lines
781 B
Mathematica
Raw Normal View History

2015-10-01 18:19:52 +02:00
#import "TGIndexPath.h"
@implementation TGIndexPath
+ (instancetype)indexPathForRow:(NSUInteger)row inSection:(NSUInteger)section
{
TGIndexPath *indexPath = [[TGIndexPath alloc] init];
indexPath.section = section;
indexPath.row = row;
return indexPath;
}
- (id)copyWithZone:(NSZone *)zone
{
TGIndexPath *copy = [[[self class] alloc] init];
if (copy != nil)
{
copy.section = self.section;
copy.row = self.row;
}
return copy;
}
- (BOOL)isEqual:(id)object
{
if (object == self)
return YES;
if (!object || ![object isKindOfClass:[self class]])
return NO;
TGIndexPath *indexPath = (TGIndexPath *)object;
return self.section == indexPath.section && self.row == indexPath.row;
}
@end