mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
34 lines
876 B
Objective-C
34 lines
876 B
Objective-C
#import "TGBridgeImageMediaAttachment.h"
|
|
#import <UIKit/UIKit.h>
|
|
|
|
const NSInteger TGBridgeImageMediaAttachmentType = 0x269BD8A8;
|
|
|
|
NSString *const TGBridgeImageMediaImageIdKey = @"imageId";
|
|
NSString *const TGBridgeImageMediaDimensionsKey = @"dimensions";
|
|
|
|
@implementation TGBridgeImageMediaAttachment
|
|
|
|
- (instancetype)initWithCoder:(NSCoder *)aDecoder
|
|
{
|
|
self = [super init];
|
|
if (self != nil)
|
|
{
|
|
_imageId = [aDecoder decodeInt64ForKey:TGBridgeImageMediaImageIdKey];
|
|
_dimensions = [aDecoder decodeCGSizeForKey:TGBridgeImageMediaDimensionsKey];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)encodeWithCoder:(NSCoder *)aCoder
|
|
{
|
|
[aCoder encodeInt64:self.imageId forKey:TGBridgeImageMediaImageIdKey];
|
|
[aCoder encodeCGSize:self.dimensions forKey:TGBridgeImageMediaDimensionsKey];
|
|
}
|
|
|
|
+ (NSInteger)mediaType
|
|
{
|
|
return TGBridgeImageMediaAttachmentType;
|
|
}
|
|
|
|
@end
|