mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Also, more nullability annotations. NSURL can't be given a nil filepath. This can occur when a previously supported attachment was downloaded, and then viewed after that attachment was no longer supported (e.g. when installing back and forth across versions) // FREEBIE
37 lines
859 B
Objective-C
37 lines
859 B
Objective-C
// Created by Frederic Jacobs on 17/12/14.
|
|
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
|
|
|
#import "TSAttachment.h"
|
|
#if TARGET_OS_IPHONE
|
|
#import <UIKit/UIKit.h>
|
|
#endif
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@interface TSAttachmentStream : TSAttachment
|
|
|
|
@property (nonatomic) BOOL isDownloaded;
|
|
|
|
- (instancetype)initWithIdentifier:(NSString *)identifier
|
|
data:(NSData *)data
|
|
key:(NSData *)key
|
|
contentType:(NSString *)contentType NS_DESIGNATED_INITIALIZER;
|
|
|
|
#if TARGET_OS_IPHONE
|
|
- (nullable UIImage *)image;
|
|
#endif
|
|
|
|
- (BOOL)isAnimated;
|
|
- (BOOL)isImage;
|
|
- (BOOL)isVideo;
|
|
- (nullable NSString *)filePath;
|
|
- (nullable NSURL *)mediaURL;
|
|
|
|
+ (void)deleteAttachments;
|
|
+ (NSString *)attachmentsFolder;
|
|
+ (NSUInteger)numberOfItemsInAttachmentsFolder;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|