mirror of
https://github.com/danog/Telegram.git
synced 2024-12-03 09:57:46 +01:00
32 lines
716 B
Objective-C
32 lines
716 B
Objective-C
#import "TGDocumentHttpFileReference.h"
|
|
|
|
#import "PSKeyValueCoder.h"
|
|
|
|
@implementation TGDocumentHttpFileReference
|
|
|
|
- (instancetype)initWithUrl:(NSString *)url {
|
|
self = [super init];
|
|
if (self != nil) {
|
|
_url = url;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
|
|
return [self initWithUrl:[aDecoder decodeObjectForKey:@"url"]];
|
|
}
|
|
|
|
- (void)encodeWithCoder:(NSCoder *)aCoder {
|
|
[aCoder encodeObject:_url forKey:@"url"];
|
|
}
|
|
|
|
- (instancetype)initWithKeyValueCoder:(PSKeyValueCoder *)coder {
|
|
return [self initWithUrl:[coder decodeStringForCKey:"url"]];
|
|
}
|
|
|
|
- (void)encodeWithKeyValueCoder:(PSKeyValueCoder *)coder {
|
|
[coder encodeString:_url forCKey:"url"];
|
|
}
|
|
|
|
@end
|