forked from Apollo-Reborn/Apollo-Reborn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApolloUserProfileCache.h
More file actions
37 lines (27 loc) · 1.29 KB
/
Copy pathApolloUserProfileCache.h
File metadata and controls
37 lines (27 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
extern NSString * const ApolloUserProfileInfoUpdatedNotification;
extern NSString * const ApolloUserProfileUsernameKey;
@interface ApolloUserProfileInfo : NSObject
@property(nonatomic, copy) NSString *username;
@property(nonatomic, strong) NSURL *iconURL;
@property(nonatomic, strong) NSURL *bannerURL;
@property(nonatomic, strong) NSURL *snoovatarURL;
@property(nonatomic, strong) NSURL *decoratorURL;
@property(nonatomic, strong) NSDate *fetchedAt;
@property(nonatomic, copy) NSString *avatarFrameKind;
@property(nonatomic) BOOL defaultSnoo;
@property(nonatomic) BOOL hasSnoovatar;
- (instancetype)initWithUsername:(NSString *)username
iconURL:(NSURL *)iconURL
bannerURL:(NSURL *)bannerURL
defaultSnoo:(BOOL)defaultSnoo
fetchedAt:(NSDate *)fetchedAt;
@end
@interface ApolloUserProfileCache : NSObject
+ (instancetype)sharedCache;
- (ApolloUserProfileInfo *)cachedInfoForUsername:(NSString *)username;
- (void)requestInfoForUsername:(NSString *)username completion:(void (^)(ApolloUserProfileInfo *info))completion;
- (UIImage *)cachedImageForURL:(NSURL *)url;
- (void)requestImageForURL:(NSURL *)url completion:(void (^)(UIImage *image))completion;
@end