RITLPhotosConfiguration.m 921 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // RITLPhotosConfiguration.m
  3. // RITLPhotoDemo
  4. //
  5. // Created by YueWen on 2018/5/17.
  6. // Copyright © 2018年 YueWen. All rights reserved.
  7. //
  8. #import "RITLPhotosConfiguration.h"
  9. @implementation RITLPhotosConfiguration
  10. - (instancetype)init
  11. {
  12. if (self = [super init]) {
  13. self.maxCount = 9;
  14. self.containVideo = true;
  15. self.containImage = true;
  16. self.isRichScan = false;
  17. }
  18. return self;
  19. }
  20. + (instancetype)defaultConfiguration
  21. {
  22. static __weak RITLPhotosConfiguration *instance;
  23. RITLPhotosConfiguration *strongInstance = instance;
  24. @synchronized(self){
  25. if (strongInstance == nil) {
  26. strongInstance = self.new;
  27. instance = strongInstance;
  28. }
  29. }
  30. return strongInstance;
  31. }
  32. - (NSInteger)maxCount
  33. {
  34. return MAX(0,_maxCount);
  35. }
  36. - (void)dealloc
  37. {
  38. NSLog(@"[%@] is dealloc",NSStringFromClass(self.class));
  39. }
  40. @end