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
38
39
//
// VICacheSessionManager.m
// VIMediaCacheDemo
//
// Created by Vito on 4/21/16.
// Copyright © 2016 Vito. All rights reserved.
//
#import "VICacheSessionManager.h"
@interface VICacheSessionManager ()
@property (nonatomic, strong) NSOperationQueue *downloadQueue;
@end
@implementation VICacheSessionManager
+ (instancetype)shared {
static id instance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
instance = [[self alloc] init];
});
return instance;
}
- (instancetype)init {
self = [super init];
if (self) {
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
queue.name = @"com.vimediacache.download";
_downloadQueue = queue;
}
return self;
}
@end