1
0
mirror of https://github.com/danog/Telegram.git synced 2025-01-22 05:52:06 +01:00
Telegram/Telegraph/TGBotReplyMarkupButton.m
2015-10-01 19:19:52 +03:00

33 lines
669 B
Objective-C

#import "TGBotReplyMarkupButton.h"
#import "PSKeyValueCoder.h"
@implementation TGBotReplyMarkupButton
- (instancetype)initWithText:(NSString *)text
{
self = [super init];
if (self != nil)
{
_text = text;
}
return self;
}
- (instancetype)initWithKeyValueCoder:(PSKeyValueCoder *)coder
{
return [self initWithText:[coder decodeStringForCKey:"text"]];
}
- (void)encodeWithKeyValueCoder:(PSKeyValueCoder *)coder
{
[coder encodeString:_text forCKey:"text"];
}
- (BOOL)isEqual:(id)object
{
return [object isKindOfClass:[TGBotReplyMarkupButton class]] && [((TGBotReplyMarkupButton *)object)->_text isEqualToString:_text];
}
@end