VICacheSessionManager.m 769 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // VICacheSessionManager.m
  3. // VIMediaCacheDemo
  4. //
  5. // Created by Vito on 4/21/16.
  6. // Copyright © 2016 Vito. All rights reserved.
  7. //
  8. #import "VICacheSessionManager.h"
  9. @interface VICacheSessionManager ()
  10. @property (nonatomic, strong) NSOperationQueue *downloadQueue;
  11. @end
  12. @implementation VICacheSessionManager
  13. + (instancetype)shared {
  14. static id instance = nil;
  15. static dispatch_once_t onceToken;
  16. dispatch_once(&onceToken, ^{
  17. instance = [[self alloc] init];
  18. });
  19. return instance;
  20. }
  21. - (instancetype)init {
  22. self = [super init];
  23. if (self) {
  24. NSOperationQueue *queue = [[NSOperationQueue alloc] init];
  25. queue.name = @"com.vimediacache.download";
  26. _downloadQueue = queue;
  27. }
  28. return self;
  29. }
  30. @end