Peter 76e5a7fab6 Add 'submodules/HockeySDK-iOS/' from commit 'c7d0c7026303253e2ac576c02655691e5d314fe2'
git-subtree-dir: submodules/HockeySDK-iOS
git-subtree-mainline: 085acd26c4432939403765234266e3c1be0f3dd9
git-subtree-split: c7d0c7026303253e2ac576c02655691e5d314fe2
2019-06-11 18:53:14 +01:00

45 lines
1.2 KiB
Objective-C
Executable File

#import "BITApplication.h"
/// Data contract class for type Application.
@implementation BITApplication
///
/// Adds all members of this class to a dictionary
///
- (NSDictionary *)serializeToDictionary {
NSMutableDictionary *dict = [super serializeToDictionary].mutableCopy;
if (self.version != nil) {
[dict setObject:self.version forKey:@"ai.application.ver"];
}
if (self.build != nil) {
[dict setObject:self.build forKey:@"ai.application.build"];
}
if (self.typeId != nil) {
[dict setObject:self.typeId forKey:@"ai.application.typeId"];
}
return dict;
}
#pragma mark - NSCoding
- (instancetype)initWithCoder:(NSCoder *)coder {
self = [super initWithCoder:coder];
if (self) {
_version = [coder decodeObjectForKey:@"self.version"];
_build = [coder decodeObjectForKey:@"self.build"];
_typeId = [coder decodeObjectForKey:@"self.typeId"];
}
return self;
}
- (void)encodeWithCoder:(NSCoder *)coder {
[super encodeWithCoder:coder];
[coder encodeObject:self.version forKey:@"self.version"];
[coder encodeObject:self.build forKey:@"self.build"];
[coder encodeObject:self.typeId forKey:@"self.typeId"];
}
@end