mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-02 04:38:33 +00:00
36 lines
835 B
Objective-C
36 lines
835 B
Objective-C
#import "BITBase.h"
|
|
#import "BITOrderedDictionary.h"
|
|
|
|
/// Data contract class for type Base.
|
|
@implementation BITBase
|
|
|
|
///
|
|
/// Adds all members of this class to a dictionary
|
|
/// @param dictionary to which the members of this class will be added.
|
|
///
|
|
- (BITOrderedDictionary *)serializeToDictionary {
|
|
BITOrderedDictionary *dict = [super serializeToDictionary];
|
|
if (self.baseType != nil) {
|
|
[dict setObject:self.baseType forKey:@"baseType"];
|
|
}
|
|
return dict;
|
|
}
|
|
|
|
#pragma mark - NSCoding
|
|
|
|
- (instancetype)initWithCoder:(NSCoder *)coder {
|
|
self = [super initWithCoder:coder];
|
|
if(self) {
|
|
_baseType = [coder decodeObjectForKey:@"self.baseType"];
|
|
}
|
|
|
|
return self;
|
|
}
|
|
|
|
- (void)encodeWithCoder:(NSCoder *)coder {
|
|
[super encodeWithCoder:coder];
|
|
[coder encodeObject:self.baseType forKey:@"self.baseType"];
|
|
}
|
|
|
|
@end
|