1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-02 09:27:55 +01:00
Telegram/Telegraph/TGYoutubeDataContentProperty.m
2015-10-01 19:19:52 +03:00

30 lines
682 B
Objective-C

#import "TGYoutubeDataContentProperty.h"
#import "PSKeyValueCoder.h"
@implementation TGYoutubeDataContentProperty
- (instancetype)initWithTitle:(NSString *)title duration:(NSUInteger)duration
{
self = [super init];
if (self != nil)
{
_title = title;
_duration = duration;
}
return self;
}
- (instancetype)initWithKeyValueCoder:(PSKeyValueCoder *)coder
{
return [self initWithTitle:[coder decodeStringForCKey:"t"] duration:(NSUInteger)[coder decodeInt32ForCKey:"d"]];
}
- (void)encodeWithKeyValueCoder:(PSKeyValueCoder *)coder
{
[coder encodeString:_title forCKey:"t"];
[coder encodeInt32:(int32_t)_duration forCKey:"d"];
}
@end